| 1 |
/* Functional tests for the "target" attribute and pragma. */ |
| 2 |
|
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-require-effective-target target_attribute } */ |
| 5 |
/* { dg-options "-O3 -march=zEC12 -mno-htm -fno-ipa-icf" } */ |
| 6 |
|
| 7 |
#pragma GCC target("htm") |
| 8 |
void p1(void) |
| 9 |
{ |
| 10 |
#ifndef __HTM__ |
| 11 |
#error __HTM__ is not defined |
| 12 |
#endif |
| 13 |
__builtin_tend (); |
| 14 |
} |
| 15 |
#pragma GCC reset_options |
| 16 |
|
| 17 |
#pragma GCC target("no-htm") |
| 18 |
void p0(void) |
| 19 |
{ |
| 20 |
#ifdef __HTM__ |
| 21 |
#error __HTM__ is defined |
| 22 |
#endif |
| 23 |
__builtin_tend (); /* { dg-error "is not supported without '-mhtm'" } */ |
| 24 |
} |
| 25 |
#pragma GCC reset_options |
| 26 |
|
| 27 |
__attribute__ ((target("htm"))) |
| 28 |
void a1(void) |
| 29 |
{ |
| 30 |
#ifdef __HTM__ |
| 31 |
#error __HTM__ is defined |
| 32 |
#endif |
| 33 |
__builtin_tend (); |
| 34 |
} |
| 35 |
|
| 36 |
__attribute__ ((target("no-htm"))) |
| 37 |
void a0(void) |
| 38 |
{ |
| 39 |
#ifdef __HTM__ |
| 40 |
#error __HTM__ is defined |
| 41 |
#endif |
| 42 |
__builtin_tend (); /* { dg-error "is not supported without '-mhtm'" } */ |
| 43 |
} |
| 44 |
|
| 45 |
void htmd(void) |
| 46 |
{ |
| 47 |
#ifdef __HTM__ |
| 48 |
#error __HTM__ is defined |
| 49 |
#endif |
| 50 |
__builtin_tend (); /* { dg-error "is not supported without '-mhtm'" } */ |
| 51 |
} |