1 /* PR debug/43150 */ 2 /* { dg-do run } */ 3 /* { dg-options "-g" } */ 4 5 void __attribute__((noinline)) bar(short * p)6bar (short *p) 7 { 8 __builtin_memset (p, '\0', 17 * sizeof (*p)); 9 asm volatile ("" : : "r" (p) : "memory"); 10 } 11 12 int __attribute__((noinline)) f1(int i)13f1 (int i) 14 { 15 char a[i + 1]; 16 a[0] = 5; /* { dg-final { gdb-test 17 "i" "5" } } */ 17 return a[0]; /* { dg-final { gdb-test 17 "sizeof (a)" "6" } } */ 18 } 19 20 int __attribute__((noinline)) f2(int i)21f2 (int i) 22 { 23 short a[i * 2 + 7]; /* { dg-final { gdb-test 24 "i" "5" } } */ 24 bar (a); /* { dg-final { gdb-test 24 "sizeof (a)" "17 * sizeof (short)" } } */ 25 return a[i + 4]; 26 } 27 28 int main()29main () 30 { 31 volatile int j; 32 int i = 5; 33 asm volatile ("" : "=r" (i) : "0" (i)); 34 j = f1 (i); 35 f2 (i); 36 return 0; 37 } 38