| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target powerpc_pcrel } */ |
| 3 |
/* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */ |
| 4 |
|
| 5 |
#define TYPE double |
| 6 |
#define LARGE 0x20000 |
| 7 |
|
| 8 |
/* Test whether we get the right number of PCREL_OPT optimizations for |
| 9 |
double. */ |
| 10 |
extern TYPE ext[]; |
| 11 |
|
| 12 |
void |
| 13 |
store (TYPE a) |
| 14 |
{ |
| 15 |
ext[0] = a; /* PCREL_OPT relocation. */ |
| 16 |
} |
| 17 |
|
| 18 |
void |
| 19 |
store2 (TYPE a) |
| 20 |
{ |
| 21 |
ext[2] = a; /* PCREL_OPT relocation. */ |
| 22 |
} |
| 23 |
|
| 24 |
void |
| 25 |
store_large (TYPE a) |
| 26 |
{ |
| 27 |
ext[LARGE] = a; /* No PCREL_OPT (store is prefixed). */ |
| 28 |
} |
| 29 |
|
| 30 |
void |
| 31 |
store_variable (TYPE a, unsigned long n) |
| 32 |
{ |
| 33 |
ext[n] = a; /* No PCREL_OPT (store is indexed). */ |
| 34 |
} |
| 35 |
|
| 36 |
/* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */ |