| 1 |
/* Functional tests for the "target" attribute and pragma. */ |
| 2 |
|
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-require-effective-target target_attribute } */ |
| 5 |
/* { dg-options "-msoft-float" } */ |
| 6 |
|
| 7 |
#pragma GCC target("hard-float") |
| 8 |
float p1(float f) |
| 9 |
{ |
| 10 |
return 2 * f; |
| 11 |
} |
| 12 |
#pragma GCC reset_options |
| 13 |
|
| 14 |
#pragma GCC target("soft-float") |
| 15 |
float p0(float f) |
| 16 |
{ |
| 17 |
return 2 * f; |
| 18 |
} |
| 19 |
float p0b(float f) |
| 20 |
{ |
| 21 |
return 2 * f; |
| 22 |
} |
| 23 |
#pragma GCC reset_options |
| 24 |
|
| 25 |
__attribute__ ((target("hard-float"))) |
| 26 |
float a1(float f) |
| 27 |
{ |
| 28 |
return 2 * f; |
| 29 |
} |
| 30 |
|
| 31 |
__attribute__ ((target("hard-float"))) |
| 32 |
float a1b(float f) |
| 33 |
{ |
| 34 |
return 2 * f; |
| 35 |
} |
| 36 |
|
| 37 |
__attribute__ ((target("hard-float"))) |
| 38 |
float a1c(float f) |
| 39 |
{ |
| 40 |
return 2 * f; |
| 41 |
} |
| 42 |
|
| 43 |
__attribute__ ((target("hard-float"))) |
| 44 |
float a1d(float f) |
| 45 |
{ |
| 46 |
return 2 * f; |
| 47 |
} |
| 48 |
|
| 49 |
__attribute__ ((target("soft-float"))) |
| 50 |
float a0(float f) |
| 51 |
{ |
| 52 |
return 2 * f; |
| 53 |
} |
| 54 |
|
| 55 |
__attribute__ ((target("soft-float"))) |
| 56 |
float a0b(float f) |
| 57 |
{ |
| 58 |
return 2 * f; |
| 59 |
} |
| 60 |
|
| 61 |
__attribute__ ((target("soft-float"))) |
| 62 |
float a0c(float f) |
| 63 |
{ |
| 64 |
return 2 * f; |
| 65 |
} |
| 66 |
|
| 67 |
__attribute__ ((target("soft-float"))) |
| 68 |
float a0d(float f) |
| 69 |
{ |
| 70 |
return 2 * f; |
| 71 |
} |
| 72 |
|
| 73 |
__attribute__ ((target("soft-float"))) |
| 74 |
float a0e(float f) |
| 75 |
{ |
| 76 |
return 2 * f; |
| 77 |
} |
| 78 |
|
| 79 |
__attribute__ ((target("soft-float"))) |
| 80 |
float a0f(float f) |
| 81 |
{ |
| 82 |
return 2 * f; |
| 83 |
} |
| 84 |
|
| 85 |
__attribute__ ((target("soft-float"))) |
| 86 |
float a0g(float f) |
| 87 |
{ |
| 88 |
return 2 * f; |
| 89 |
} |
| 90 |
|
| 91 |
__attribute__ ((target("soft-float"))) |
| 92 |
float a0h(float f) |
| 93 |
{ |
| 94 |
return 2 * f; |
| 95 |
} |
| 96 |
|
| 97 |
/* { dg-final { scan-assembler-times "\tste\t%f" 5 } } */ |