rs6000, remove vector set and vector init built-ins.
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / clone2.c
blobe64940b7952766c327678ce8c67071b9afc1bc77
1 /* { dg-do run { target { powerpc*-*-linux* } } } */
2 /* { dg-options "-mvsx -O2" } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-require-effective-target ppc_cpu_supports_hw } */
6 #include <stddef.h>
7 #include <stdlib.h>
9 /* Power9 (aka, ISA 3.0) has a MODSD instruction to do modulus, while Power8
10 (aka, ISA 2.07) has to do modulus with divide and multiply. Make sure that
11 the basic support for target_clones runs.
13 Restrict ourselves to Linux, since IFUNC might not be supported in other
14 operating systems. */
16 __attribute__((__target_clones__("cpu=power9,default")))
17 long mod_func (long a, long b)
19 return a % b;
22 #define X 53L
23 #define Y 7L
24 int
25 main (void)
27 if (mod_func (X, Y) != (X % Y))
28 abort ();
30 return 0;