| 1 |
/* Functional tests for the "target" attribute and pragma. */ |
| 2 |
|
| 3 |
/* { dg-do compile { target { lp64 } } } */ |
| 4 |
/* { dg-require-effective-target target_attribute } */ |
| 5 |
/* { dg-options "-O3 -march=z13 -mno-vx -mno-zvector" } */ |
| 6 |
|
| 7 |
#include <vecintrin.h> |
| 8 |
|
| 9 |
#pragma GCC target("no-zvector") |
| 10 |
__attribute__ ((target("vx"))) |
| 11 |
void a1(void) |
| 12 |
{ |
| 13 |
#ifdef __VEC__ |
| 14 |
#error __VEC__ is defined |
| 15 |
#endif |
| 16 |
vec_load_bndry ((const signed char *)0, 64); |
| 17 |
__builtin_s390_vll ((unsigned int)0, (const void *)8); |
| 18 |
} |
| 19 |
#pragma GCC reset_options |
| 20 |
|
| 21 |
__attribute__ ((target("no-vx"))) |
| 22 |
void a0(void) |
| 23 |
{ |
| 24 |
#ifdef __VEC__ |
| 25 |
#error __VEC__ is defined |
| 26 |
#endif |
| 27 |
__builtin_s390_vll ((unsigned int)0, (const void *)8); /* { dg-error "requires '-mvx'" } */ |
| 28 |
} |
| 29 |
|
| 30 |
void d(void) |
| 31 |
{ |
| 32 |
#ifdef __VEC__ |
| 33 |
#error __VEC__ is defined |
| 34 |
#endif |
| 35 |
__builtin_s390_vll ((unsigned int)0, (const void *)8); /* { dg-error "requires '-mvx'" } */ |
| 36 |
} |