gcc/testsuite/gcc.target/powerpc/pr102059-2.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -mdejagnu-cpu=power8 -mno-htm" } */ |
| 3 | |
| 4 | /* Verify target info for inlining still works even if callee |
| 5 | disables HTM explicitly while caller enables it. */ |
| 6 | |
| 7 | static inline int __attribute__ ((always_inline)) |
| 8 | foo (int *b) |
| 9 | { |
| 10 | *b += 10; |
| 11 | return *b; |
| 12 | } |
| 13 | |
| 14 | #pragma GCC target "htm" |
| 15 | int |
| 16 | bar (int *a) |
| 17 | { |
| 18 | *a = foo (a); |
| 19 | return 0; |
| 20 | } |
| 21 |