1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
3 /* { dg-require-effective-target powerpc_p9vector_ok } */
4 /* { dg-skip-if "" { powerpc*-*-aix* } } */
5 /* { dg-options "-mcpu=power8" } */
6 
7 /* This test should succeed on both 32- and 64-bit configurations.  */
8 #include <altivec.h>
9 
10 /* Though the command line specifies power8 target, this function is
11    to support power9.  */
12 __attribute__((target("cpu=power9")))
get_random()13 int get_random ()
14 {
15   return __builtin_darn_32 ();
16 }
17 
18 /* { dg-final { scan-assembler	   "darn" } } */
19