Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/allocate-11.c

raw
1 /* TODO: enable for C++ once implemented. */
2 /* { dg-do compile { target c } } */
3
4 void bar();
5 void use (int*);
6
7 void
8 f (int i)
9 {
10 switch (i) /* { dg-note "switch starts here" } */
11 {
12 int j; /* { dg-note "'j' declared here" } */
13 #pragma omp allocate(j)
14 case 42: /* { dg-error "switch jumps over OpenMP 'allocate' allocation" } */
15 bar ();
16 /* { dg-warning "statement will never be executed \\\[-Wswitch-unreachable\\\]" "" { target *-*-* } .-1 } */
17 break;
18 case 51: /* { dg-error "switch jumps over OpenMP 'allocate' allocation" } */
19 use (&j);
20 break;
21 }
22 }
23
24 int
25 h (int i2)
26 {
27 if (i2 == 5)
28 goto label; /* { dg-error "jump skips OpenMP 'allocate' allocation" } */
29 return 5;
30
31 int k2; /* { dg-note "'k2' declared here" } */
32 int j2 = 4; /* { dg-note "'j2' declared here" } */
33 #pragma omp allocate(k2, j2)
34 label: /* { dg-note "label 'label' defined here" } */
35 k2 = 4;
36 return j2 + k2;
37 }