1 // RUN: %clang_cc1 %s -fopenacc -verify
5 #pragma acc kernels num_gangs(1)
8 // expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
9 #pragma acc serial num_gangs(1)
12 #pragma acc parallel num_gangs(1)
15 // expected-error@+2{{OpenACC 'num_gangs' clause cannot appear more than once on a 'kernels' directive}}
16 // expected-note@+1{{previous clause is here}}
17 #pragma acc kernels num_gangs(1) num_gangs(2)
20 // expected-error@+2{{OpenACC 'num_gangs' clause cannot appear more than once on a 'parallel' directive}}
21 // expected-note@+1{{previous clause is here}}
22 #pragma acc parallel num_gangs(1) num_gangs(2)
25 // expected-error@+1{{too many integer expression arguments provided to OpenACC 'num_gangs' clause: 'kernels' directive expects maximum of 1, 2 were provided}}
26 #pragma acc kernels num_gangs(1, getS())
29 // expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'serial' directive}}
30 #pragma acc serial num_gangs(1, getS())
32 #pragma acc parallel num_gangs(1, getS())
35 struct NotConvertible
{} NC
;
36 // expected-error@+1{{OpenACC clause 'num_gangs' requires expression of integer type ('struct NotConvertible' invalid)}}
37 #pragma acc parallel num_gangs(NC)
40 // expected-error@+1{{OpenACC clause 'num_gangs' requires expression of integer type ('struct NotConvertible' invalid)}}
41 #pragma acc parallel num_gangs(1, NC)
44 // expected-error@+1{{OpenACC clause 'num_gangs' requires expression of integer type ('struct NotConvertible' invalid)}}
45 #pragma acc parallel num_gangs(NC, 1)
48 #pragma acc parallel num_gangs(getS(), 1, getS())
51 // expected-error@+1{{too many integer expression arguments provided to OpenACC 'num_gangs' clause: 'parallel' directive expects maximum of 3, 4 were provided}}
52 #pragma acc parallel num_gangs(getS(), 1, getS(), 1)
55 // expected-error@+1{{OpenACC 'num_gangs' clause is not valid on 'loop' directive}}
56 #pragma acc loop num_gangs(1)
57 for(int i
= 5; i
< 10;++i
);