| 1 |
/* { dg-require-effective-target rop_ok } */ |
| 2 |
/* { dg-options "-O1 -mrop-protect -mdejagnu-cpu=power10" } */ |
| 3 |
|
| 4 |
extern void foo (void); |
| 5 |
|
| 6 |
long int |
| 7 |
__attribute__ ((__optimize__ ("no-inline"))) |
| 8 |
func (long int cond) |
| 9 |
{ |
| 10 |
if (cond) |
| 11 |
foo (); |
| 12 |
return cond; |
| 13 |
} |
| 14 |
|
| 15 |
/* Ensure hashst comes after mflr and hashchk comes after ld 0,16(1). */ |
| 16 |
/* { dg-final { scan-assembler {(?p)\mmflr 0.*\n.*\n.*\mhashst 0,} } } */ |
| 17 |
/* { dg-final { scan-assembler {(?p)ld 0,.*\n.*\n.*\n.*\mhashchk 0,} } } */ |