[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pcrel-opt-ld-si.c
blobad011d61448f6e5b08f3d097edd7fcaf33bf1acc
1 /* { dg-do compile } */
2 /* { dg-require-effective-target powerpc_pcrel } */
3 /* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
5 #define TYPE int
6 #define LARGE 0x20000
8 /* Test whether we get the right number of PCREL_OPT optimizations for int. */
9 extern TYPE ext[];
11 TYPE
12 get (void)
14 return ext[0]; /* PCREL_OPT relocation. */
17 TYPE
18 get2 (void)
20 return ext[2]; /* PCREL_OPT relocation. */
23 TYPE
24 get_large (void)
26 return ext[LARGE]; /* No PCREL_OPT (load is prefixed). */
29 TYPE
30 get_variable (unsigned long n)
32 return ext[n]; /* No PCREL_OPT (load is indexed). */
35 double
36 get_double (void)
38 return (double) ext[0]; /* No PCREL_OPT (LFIWAX is indexed). */
41 /* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */