xref: /llvm-project/clang/test/Sema/ppc-attr-target-inline.c (revision 7c1d9b15eee3a34678addab2bab66f3020ac0753)
1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -triple powerpc64le -target-feature +htm -emit-llvm-only %s -verify
3 
4 __attribute__((always_inline))
test1(int * x)5 int test1(int *x) {
6   *x = __builtin_ttest();
7   return *x;
8 }
9 
10 __attribute__((target("no-htm")))
test2(int * x)11 int test2(int *x) {
12   *x = test1(x); // expected-error {{always_inline function 'test1' requires target feature 'htm', but would be inlined into function 'test2' that is compiled without support for 'htm'}}
13   return 0;
14 }
15