[committed] Fix previously latent bug in reorg affecting cris port
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / clone1.c
blob1ed432c631c579515f87b50bedcd1dfad499ef2d
1 /* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
2 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O2" } */
3 /* { dg-require-effective-target powerpc_vsx } */
4 /* { dg-require-effective-target ppc_cpu_supports_hw } */
6 /* Power9 (aka, ISA 3.0) has a MODSD instruction to do modulus, while Power8
7 (aka, ISA 2.07) has to do modulus with divide and multiply. Make sure
8 both clone functions are generated.
10 Restrict ourselves to Linux, since IFUNC might not be supported in other
11 operating systems. */
13 __attribute__((target_clones("cpu=power9,default")))
14 long mod_func (long a, long b)
16 return a % b;
19 long mod_func_or (long a, long b, long c)
21 return mod_func (a, b) | c;
24 /* { Fail due to RS6000_DISABLE_SCALAR_MODULO. */
25 /* { dg-final { scan-assembler-times {\mdivd\M} 1 { xfail *-*-* } } } */
26 /* { dg-final { scan-assembler-times {\mmulld\M} 1 { xfail *-*-* } } } */
27 /* { dg-final { scan-assembler-times {\mmodsd\M} 1 { xfail *-*-* } } } */