[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pcrel-opt-ld-qi.c
blob3a7aad45b55dc76528c17ff2dc312ba45e638d7c
1 /* { dg-do compile } */
2 /* { dg-require-effective-target powerpc_pcrel } */
3 /* { dg-options "-O2 -mdejagnu-cpu=power10 -mpcrel-opt" } */
5 #define TYPE unsigned char
6 #define LARGE 0x20000
8 /* Test whether we get the right number of PCREL_OPT optimizations for unsigned
9 char. */
10 extern TYPE ext[];
12 TYPE
13 get (void)
15 return ext[0]; /* PCREL_OPT relocation. */
18 TYPE
19 get2 (void)
21 return ext[2]; /* PCREL_OPT relocation. */
24 TYPE
25 get_large (void)
27 return ext[LARGE]; /* No PCREL_OPT (load is prefixed). */
30 TYPE
31 get_variable (unsigned long n)
33 return ext[n]; /* No PCREL_OPT (load is indexed). */
36 double
37 get_double (void)
39 return (double) ext[0]; /* No PCREL_OPT (LXSIBZX is indexed). */
42 /* { dg-final { scan-assembler-times "R_PPC64_PCREL_OPT" 2 } } */