gcc/testsuite/gcc.dg/guality/pr69947.c
raw| 1 | /* PR debug/69947 */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-options "-g" } */ |
| 4 | |
| 5 | #include "../nop.h" |
| 6 | |
| 7 | static const char *c = "foobar"; |
| 8 | |
| 9 | __attribute__((noinline, noclone)) void |
| 10 | foo (void) |
| 11 | { |
| 12 | static const char a[] = "abcdefg"; |
| 13 | const char *b = a; /* { dg-final { gdb-test .+1 "c\[2\]" "'o'" } } */ |
| 14 | asm (NOP : : : "memory"); /* { dg-final { gdb-test . "b\[4\]" "'e'" } } */ |
| 15 | } |
| 16 | |
| 17 | int |
| 18 | main () |
| 19 | { |
| 20 | foo (); |
| 21 | return 0; |
| 22 | } |