1 // { dg-skip-if "not yet" { c++ } } 2 foo()3void foo() 4 { 5 int l; 6 7 bad1: 8 #pragma acc parallel 9 goto bad1; // { dg-error "invalid branch to/from OpenACC structured block" } 10 #pragma acc kernels 11 goto bad1; // { dg-error "invalid branch to/from OpenACC structured block" } 12 #pragma acc data 13 goto bad1; // { dg-error "invalid branch to/from OpenACC structured block" } 14 #pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ 15 for (l = 0; l < 2; ++l) 16 goto bad1; // { dg-error "invalid branch to/from OpenACC structured block" } 17 18 goto bad2_parallel; // { dg-error "invalid entry to OpenACC structured block" } 19 #pragma acc parallel 20 { 21 bad2_parallel: ; 22 } 23 24 goto bad2_kernels; // { dg-error "invalid entry to OpenACC structured block" } 25 #pragma acc kernels 26 { 27 bad2_kernels: ; 28 } 29 30 goto bad2_data; // { dg-error "invalid entry to OpenACC structured block" } 31 #pragma acc data 32 { 33 bad2_data: ; 34 } 35 36 goto bad2_loop; // { dg-error "invalid entry to OpenACC structured block" } 37 #pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ 38 for (l = 0; l < 2; ++l) 39 { 40 bad2_loop: ; 41 } 42 43 #pragma acc parallel 44 { 45 int i; 46 goto ok1_parallel; 47 for (i = 0; i < 10; ++i) 48 { ok1_parallel: break; } 49 } 50 51 #pragma acc kernels 52 { 53 int i; 54 goto ok1_kernels; 55 for (i = 0; i < 10; ++i) 56 { ok1_kernels: break; } 57 } 58 59 #pragma acc data 60 { 61 int i; 62 goto ok1_data; 63 for (i = 0; i < 10; ++i) 64 { ok1_data: break; } 65 } 66 67 #pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ 68 for (l = 0; l < 2; ++l) 69 { 70 int i; 71 goto ok1_loop; 72 for (i = 0; i < 10; ++i) 73 { ok1_loop: break; } 74 } 75 } 76