| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ |
| 3 |
/* { dg-require-effective-target power10_ok } */ |
| 4 |
|
| 5 |
/* Verify that power10 can explicity include functions compiled for power8. |
| 6 |
The issue was -mcpu=power8 enables -mpower8-fusion, but -mcpu=power9 or |
| 7 |
-mcpu=power10 do not set power8-fusion by default. Thus when doing this |
| 8 |
compilation, they would get an error that the inline function failed in its |
| 9 |
inlining due to having incompatible options. */ |
| 10 |
|
| 11 |
static inline int __attribute__ ((always_inline,target("cpu=power8"))) |
| 12 |
foo (int *b) |
| 13 |
{ |
| 14 |
*b += 10; |
| 15 |
return *b; |
| 16 |
} |
| 17 |
|
| 18 |
int |
| 19 |
bar (int *a) |
| 20 |
{ |
| 21 |
*a = foo (a); |
| 22 |
return 0; |
| 23 |
} |