1 /* Use -g0 so that this test case doesn't just fail because 2 of PR52472. */ 3 4 /* { dg-do compile } */ 5 /* { dg-options "-std=gnu99 -g0" } */ 6 7 struct S12 8 { 9 char c; 10 const char *p; 11 }; 12 13 struct S12f 14 { 15 char c; 16 struct S12f (*f)(void); 17 }; 18 19 struct S12labl 20 { 21 char c; 22 void **labl; 23 }; 24 25 struct S121 26 { 27 char c; 28 const char *p; 29 char d; 30 }; 31 32 const char str[5] = "abcd"; 33 test_S12_0(void)34struct S12 test_S12_0 (void) 35 { 36 struct S12 s; 37 s.c = 'A'; 38 s.p = str; 39 return s; 40 } 41 test_S12_4(void)42struct S12 test_S12_4 (void) 43 { 44 struct S12 s; 45 s.c = 'A'; 46 s.p = str + 4; 47 return s; 48 } 49 test_S12f(void)50struct S12f test_S12f (void) 51 { 52 struct S12f s; 53 s.c = 'A'; 54 s.f = test_S12f; 55 return s; 56 } 57 test_S121(void)58struct S121 test_S121 (void) 59 { 60 struct S121 s; 61 s.c = 'c'; 62 s.p = str + 4; 63 s.d = 'd'; 64 return s; 65 } 66 67 extern void use_S12lab (struct S12labl*); 68 test_S12lab(void)69struct S12labl test_S12lab (void) 70 { 71 struct S12labl s; 72 labl:; 73 s.c = 'A'; 74 s.labl = &&labl; 75 return s; 76 } 77 78 #ifdef __MEMX 79 80 struct S13 81 { 82 char c; 83 const __memx char *p; 84 }; 85 86 const __memx char str_x[] = "abcd"; 87 test_S13_0(void)88struct S13 test_S13_0 (void) 89 { 90 struct S13 s; 91 s.c = 'A'; 92 s.p = str_x; 93 return s; 94 } 95 test_S13_4a(void)96struct S13 test_S13_4a (void) 97 { 98 struct S13 s; 99 s.c = 'A'; 100 s.p = str_x + 4; 101 return s; 102 } 103 104 #ifdef __FLASH1 105 106 const __flash1 char str_1[] = "abcd"; 107 test_13_4b(void)108struct S13 test_13_4b (void) 109 { 110 struct S13 s; 111 s.c = 'A'; 112 s.p = str_1 + 4; 113 return s; 114 } 115 116 #endif /* have __flash1 */ 117 #endif /* have __memx */ 118 119