gcc/testsuite/gcc.dg/asan/pr115172.c
raw| 1 | /* PR sanitizer/115172 */ |
| 2 | /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ |
| 3 | /* { dg-options "-O2 -fsanitize=address,bool -ffat-lto-objects -fdump-tree-asan1" } */ |
| 4 | /* { dg-final { scan-tree-dump-not "\.ASAN_CHECK " "asan1" } } */ |
| 5 | |
| 6 | #ifdef __x86_64__ |
| 7 | #define SEG __seg_gs |
| 8 | #else |
| 9 | #define SEG __seg_fs |
| 10 | #endif |
| 11 | |
| 12 | extern struct S { _Bool b; } s; |
| 13 | void bar (void); |
| 14 | |
| 15 | void |
| 16 | foo (void) |
| 17 | { |
| 18 | if (*(volatile _Bool SEG *) (__UINTPTR_TYPE__) &s.b) |
| 19 | bar (); |
| 20 | } |