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