Debian Codegraph @

gcc/testsuite/gcc.dg/goacc/pr71373.c

raw
1 /* Unintentional nested function usage. */
2 /* Due to missing right braces '}', the following functions are parsed as
3 nested functions. This ran into an ICE. */
4
5 void foo (void)
6 {
7 #pragma acc parallel
8 {
9 #pragma acc loop independent
10 for (int i = 0; i < 16; i++)
11 ;
12 // Note right brace '}' commented out here.
13 //}
14 }
15 void bar (void)
16 {
17 }
18
19 // Adding right brace '}' here, to make this compile.
20 }
21
22
23 // ..., and the other way round:
24
25 void BAR (void)
26 {
27 // Note right brace '}' commented out here.
28 //}
29
30 void FOO (void)
31 {
32 #pragma acc parallel
33 {
34 #pragma acc loop independent
35 for (int i = 0; i < 16; i++)
36 ;
37 }
38 }
39
40 // Adding right brace '}' here, to make this compile.
41 }