| 1 |
/* PR target/114759 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -mdejagnu-cpu=power7 -mrop-protect" } */ |
| 4 |
|
| 5 |
/* Verify we emit an error if we use -mrop-protect with an unsupported cpu |
| 6 |
or ABI. */ |
| 7 |
|
| 8 |
extern void foo (void); |
| 9 |
|
| 10 |
int |
| 11 |
bar (void) |
| 12 |
{ |
| 13 |
foo (); |
| 14 |
return 5; |
| 15 |
} |
| 16 |
|
| 17 |
/* The correct line number is in the preamble to the error message, not |
| 18 |
in the final line (which is all that dg-error inspects). Hence, we have |
| 19 |
to tell dg-error to ignore the line number. */ |
| 20 |
/* { dg-error "'-mrop-protect' requires '-mcpu=power8'" "PR114759" { target *-*-* } 0 } */ |
| 21 |
/* { dg-error "'-mrop-protect' requires the ELFv2 ABI" "PR114759" { target { ! rop_ok } } 0 } */ |