| 1 |
/* PR sanitizer/111736 */ |
| 2 |
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ |
| 3 |
/* { dg-options "-fsanitize=null,alignment -fdump-tree-optimized -ffat-lto-objects" } */ |
| 4 |
/* { dg-final { scan-tree-dump-times "__ubsan_handle_type_mismatch" 1 "optimized" } } */ |
| 5 |
/* { dg-final { scan-tree-dump-not "p_\[0-9]*.D. \[=!]= 0" "optimized" } } */ |
| 6 |
|
| 7 |
#ifdef __x86_64__ |
| 8 |
#define SEG __seg_fs |
| 9 |
#else |
| 10 |
#define SEG __seg_gs |
| 11 |
#endif |
| 12 |
|
| 13 |
int |
| 14 |
foo (int SEG *p, int *q) |
| 15 |
{ |
| 16 |
return *p; |
| 17 |
} |
| 18 |
|
| 19 |
__attribute__((no_sanitize("alignment"))) int |
| 20 |
bar (int SEG *p, int *q) |
| 21 |
{ |
| 22 |
return *p; |
| 23 |
} |