1 /* Test valid uses of declare directive. */ 2 /* { dg-do compile } */ 3 4 int v0; 5 #pragma acc declare create(v0) 6 7 int v1; 8 #pragma acc declare copyin(v1) 9 10 int *v2; 11 #pragma acc declare deviceptr(v2) 12 13 int v3; 14 #pragma acc declare device_resident(v3) 15 16 int v4; 17 #pragma acc declare link(v4) 18 19 int v5, v6, v7, v8; 20 #pragma acc declare create(v5, v6) copyin(v7, v8) 21 22 void f(void)23f (void) 24 { 25 int va0; 26 #pragma acc declare create(va0) 27 28 int va1; 29 #pragma acc declare copyin(va1) 30 31 int *va2; 32 #pragma acc declare deviceptr(va2) 33 34 int va3; 35 #pragma acc declare device_resident(va3) 36 37 extern int ve0; 38 #pragma acc declare create(ve0) 39 40 extern int ve1; 41 #pragma acc declare copyin(ve1) 42 43 extern int *ve2; 44 #pragma acc declare deviceptr(ve2) 45 46 extern int ve3; 47 #pragma acc declare device_resident(ve3) 48 49 extern int ve4; 50 #pragma acc declare link(ve4) 51 52 int va5; 53 #pragma acc declare copy(va5) 54 55 int va6; 56 #pragma acc declare copyout(va6) 57 58 int va7; 59 #pragma acc declare present(va7) 60 61 int va8; 62 #pragma acc declare present_or_copy(va8) 63 64 int va9; 65 #pragma acc declare present_or_copyin(va9) 66 67 int va10; 68 #pragma acc declare present_or_copyout(va10) 69 70 int va11; 71 #pragma acc declare present_or_create(va11) 72 73 a: 74 { 75 int va0; 76 #pragma acc declare create(va0) 77 if (v1) 78 goto a; 79 else 80 goto b; 81 } 82 b:; 83 } 84