File tree Expand file tree Collapse file tree 3 files changed +34
-6
lines changed Expand file tree Collapse file tree 3 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 5
5
// Test that checks wrong function template instantiation and ensures that the type
6
6
// is checked properly when instantiating from the template definition.
7
7
template <typename Ty>
8
- // expected-error@+1{{'max_global_work_dim' attribute requires an integer constant}}
8
+ // expected-error@+1 2 {{'max_global_work_dim' attribute requires an integer constant}}
9
9
[[intel::max_global_work_dim(Ty{})]] void func () {}
10
10
11
11
struct S {};
12
- void var () {
12
+ void test () {
13
13
// expected-note@+1{{in instantiation of function template specialization 'func<S>' requested here}}
14
14
func<S>();
15
+ // expected-note@+1{{in instantiation of function template specialization 'func<float>' requested here}}
16
+ func<float >();
17
+ // no error expected
18
+ func<int >(); // OK
15
19
}
16
20
17
21
// Test that checks expression is not a constant expression.
@@ -48,10 +52,14 @@ int main() {
48
52
49
53
// Test that checks template parameter support on function.
50
54
template <int N>
55
+ // expected-error@+1{{'max_global_work_dim' attribute requires a non-negative integral compile time constant expression}}
51
56
[[intel::max_global_work_dim(N)]] void func3 () {}
52
57
53
58
int check () {
59
+ // no error expected
54
60
func3<2 >();
61
+ // expected-note@+1{{in instantiation of function template specialization 'func3<-1>' requested here}}
62
+ func3<-1 >();
55
63
return 0 ;
56
64
}
57
65
Original file line number Diff line number Diff line change 5
5
// Test that checks wrong function template instantiation and ensures that the type
6
6
// is checked properly when instantiating from the template definition.
7
7
template <typename Ty>
8
- // expected-error@+1{{'num_simd_work_items' attribute requires an integer constant}}
8
+ // expected-error@+2{{'num_simd_work_items' attribute requires a positive integral compile time constant expression}}
9
+ // expected-error@+1 2{{'num_simd_work_items' attribute requires an integer constant}}
9
10
[[intel::num_simd_work_items(Ty{})]] void func () {}
10
11
11
12
struct S {};
12
- void var () {
13
+ void test () {
13
14
// expected-note@+1{{in instantiation of function template specialization 'func<S>' requested here}}
14
15
func<S>();
16
+ // expected-note@+1{{in instantiation of function template specialization 'func<float>' requested here}}
17
+ func<float >();
18
+ // expected-note@+1{{in instantiation of function template specialization 'func<int>' requested here}}
19
+ func<int >();
15
20
}
16
21
17
22
// Test that checks expression is not a constant expression.
@@ -36,6 +41,7 @@ int main() {
36
41
KernelFunctor<-1 >();
37
42
// no error expected
38
43
KernelFunctor<10 >();
44
+ return 0 ;
39
45
}
40
46
41
47
// CHECK: ClassTemplateDecl {{.*}} {{.*}} KernelFunctor
@@ -48,10 +54,14 @@ int main() {
48
54
49
55
// Test that checks template parameter support on function.
50
56
template <int N>
57
+ // expected-error@+1{{'num_simd_work_items' attribute requires a positive integral compile time constant expression}}
51
58
[[intel::num_simd_work_items(N)]] void func3 () {}
52
59
53
60
int check () {
61
+ // no error expected
54
62
func3<8 >();
63
+ // expected-note@+1{{in instantiation of function template specialization 'func3<-1>' requested here}}
64
+ func3<-1 >();
55
65
return 0 ;
56
66
}
57
67
Original file line number Diff line number Diff line change 5
5
// Test that checks wrong function template instantiation and ensures that the type
6
6
// is checked properly when instantiating from the template definition.
7
7
template <typename Ty>
8
- // expected-error@+1{{'reqd_sub_group_size' attribute requires an integer constant}}
8
+ // expected-error@+2{{'reqd_sub_group_size' attribute requires a positive integral compile time constant expression}}
9
+ // expected-error@+1 2{{'reqd_sub_group_size' attribute requires an integer constant}}
9
10
[[intel::reqd_sub_group_size(Ty{})]] void func () {}
10
11
11
12
struct S {};
12
- void var () {
13
+ void test () {
13
14
// expected-note@+1{{in instantiation of function template specialization 'func<S>' requested here}}
14
15
func<S>();
16
+ // expected-note@+1{{in instantiation of function template specialization 'func<float>' requested here}}
17
+ func<float >();
18
+ // expected-note@+1{{in instantiation of function template specialization 'func<int>' requested here}}
19
+ func<int >();
15
20
}
16
21
17
22
// Test that checks expression is not a constant expression.
@@ -36,6 +41,7 @@ int main() {
36
41
KernelFunctor<-1 >();
37
42
// no error expected
38
43
KernelFunctor<10 >();
44
+ return 0 ;
39
45
}
40
46
41
47
// CHECK: ClassTemplateDecl {{.*}} {{.*}} KernelFunctor
@@ -48,10 +54,14 @@ int main() {
48
54
49
55
// Test that checks template parameter support on function.
50
56
template <int N>
57
+ // expected-error@+1{{'reqd_sub_group_size' attribute requires a positive integral compile time constant expression}}
51
58
[[intel::reqd_sub_group_size(N)]] void func3 () {}
52
59
53
60
int check () {
61
+ // no error expected
54
62
func3<12 >();
63
+ // expected-note@+1{{in instantiation of function template specialization 'func3<-1>' requested here}}
64
+ func3<-1 >();
55
65
return 0 ;
56
66
}
57
67
You can’t perform that action at this time.
0 commit comments