| 1 |
/* Tests of C frontend's address space type-checking. */ |
| 2 |
/* { dg-options "-std=gnu90 -fdiagnostics-show-caret" } */ |
| 3 |
|
| 4 |
/* Verify that we emit helpful diagnostics at a mismatching address space |
| 5 |
at a function call, and that the underlined locations are correct. */ |
| 6 |
|
| 7 |
extern void expects_seg_gs (int i, void __seg_gs *param, int j); /* { dg-line "decl_line" } */ |
| 8 |
|
| 9 |
void |
| 10 |
test_bad_call (void *ptr) |
| 11 |
{ |
| 12 |
expects_seg_gs (0, ptr, 1); /* { dg-line "err_line" } */ |
| 13 |
} |
| 14 |
|
| 15 |
/* { dg-error "passing argument 2 of 'expects_seg_gs' from pointer to non-enclosed address space" "" { target *-*-* } err_line } */ |
| 16 |
/* { dg-begin-multiline-output "" } |
| 17 |
expects_seg_gs (0, ptr, 1); |
| 18 |
^~~ |
| 19 |
{ dg-end-multiline-output "" } */ |
| 20 |
|
| 21 |
/* { dg-message "expected '__seg_gs void \\*' but argument is of type 'void \\*'" "" { target *-*-* } decl_line } */ |
| 22 |
/* { dg-begin-multiline-output "" } |
| 23 |
extern void expects_seg_gs (int i, void __seg_gs *param, int j); |
| 24 |
~~~~~~~~~~~~~~~^~~~~ |
| 25 |
{ dg-end-multiline-output "" } */ |