1 2 /* The restrict keyword can only qualify pointers to objects */ 3 4 #ifdef TEST1_C99 5 restrict a; /* ERROR */ 6 #endif 7 8 #ifdef TEST2_C99 9 restrict int a; /* ERROR */ 10 #endif 11 12 #ifdef TEST3_C99 13 restrict int a[10]; /* ERROR */ 14 #endif 15 16 #ifdef TEST4_C99 17 restrict int * a; /* ERROR */ 18 #endif 19 20 #ifdef TEST5_C99 21 restrict struct 22 { 23 int a; 24 int b; 25 } x; /* ERROR */ 26 #endif 27 28 #ifdef TEST6_C99 func(void)29restrict int func(void) { /* ERROR */ 30 return 0; 31 } 32 #endif 33 34 #ifdef TEST7_C99 func(restrict int x)35void func(restrict int x) { /* ERROR */ 36 x; /* IGNORE */ 37 } 38 #endif 39 40 #ifdef TEST8_C99 func(void (* restrict p)(void))41void func(void (*restrict p)(void)) { /* ERROR */ 42 p(); /* IGNORE */ 43 } 44 #endif 45 46 47 #ifdef TEST_GOOD1_C99 48 int * restrict a; 49 #endif 50 51 #ifdef TEST_GOOD2_C99 func(int * restrict x)52int * func(int * restrict x) 53 { 54 return x; 55 } 56 #endif 57 58 #ifdef TEST_GOOD3_C99 func(int * restrict x)59void func(int * restrict x) 60 { 61 x; /* IGNORE */ 62 } 63 #endif 64