[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGen / PowerPC / builtins-ppc-htm.c
blob51585f27e0bc70d6e76cfccc25b4b02efdaf5b73
1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -target-feature +altivec -target-feature +htm -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
3 // RUN: not %clang_cc1 -target-feature +altivec -target-feature -htm -triple powerpc64-unknown-unknown -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=ERROR
5 void test1(long int *r, int code, long int *a, long int *b) {
6 // CHECK-LABEL: define{{.*}} void @test1
8 r[0] = __builtin_tbegin (0);
9 // CHECK: @llvm.ppc.tbegin
10 // ERROR: error: '__builtin_tbegin' needs target feature htm
11 r[1] = __builtin_tbegin (1);
12 // CHECK: @llvm.ppc.tbegin
13 // ERROR: error: '__builtin_tbegin' needs target feature htm
14 r[2] = __builtin_tend (0);
15 // CHECK: @llvm.ppc.tend
16 // ERROR: error: '__builtin_tend' needs target feature htm
17 r[3] = __builtin_tendall ();
18 // CHECK: @llvm.ppc.tendall
19 // ERROR: error: '__builtin_tendall' needs target feature htm
21 r[4] = __builtin_tabort (code);
22 // CHECK: @llvm.ppc.tabort
23 // ERROR: error: '__builtin_tabort' needs target feature htm
24 r[5] = __builtin_tabort (0x1);
25 // CHECK: @llvm.ppc.tabort
26 // ERROR: error: '__builtin_tabort' needs target feature htm
27 r[6] = __builtin_tabortdc (0xf, a[0], b[0]);
28 // CHECK: @llvm.ppc.tabortdc
29 // ERROR: error: '__builtin_tabortdc' needs target feature htm
30 r[7] = __builtin_tabortdci (0xf, a[1], 0x1);
31 // CHECK: @llvm.ppc.tabortdc
32 // ERROR: error: '__builtin_tabortdci' needs target feature htm
33 r[8] = __builtin_tabortwc (0xf, a[2], b[2]);
34 // CHECK: @llvm.ppc.tabortwc
35 // ERROR: error: '__builtin_tabortwc' needs target feature htm
36 r[9] = __builtin_tabortwci (0xf, a[3], 0x1);
37 // CHECK: @llvm.ppc.tabortwc
38 // ERROR: error: '__builtin_tabortwci' needs target feature htm
40 r[10] = __builtin_tcheck ();
41 // CHECK: @llvm.ppc.tcheck
42 // ERROR: error: '__builtin_tcheck' needs target feature htm
43 r[11] = __builtin_trechkpt ();
44 // CHECK: @llvm.ppc.trechkpt
45 // ERROR: error: '__builtin_trechkpt' needs target feature htm
46 r[12] = __builtin_treclaim (0);
47 // CHECK: @llvm.ppc.treclaim
48 // ERROR: error: '__builtin_treclaim' needs target feature htm
49 r[13] = __builtin_tresume ();
50 // CHECK: @llvm.ppc.tresume
51 // ERROR: error: '__builtin_tresume' needs target feature htm
52 r[14] = __builtin_tsuspend ();
53 // CHECK: @llvm.ppc.tsuspend
54 // ERROR: error: '__builtin_tsuspend' needs target feature htm
55 r[15] = __builtin_tsr (0);
56 // CHECK: @llvm.ppc.tsr
57 // ERROR: error: '__builtin_tsr' needs target feature htm
59 r[16] = __builtin_ttest ();
60 // CHECK: @llvm.ppc.ttest
61 // ERROR: error: '__builtin_ttest' needs target feature htm
63 r[17] = __builtin_get_texasr ();
64 // CHECK: @llvm.ppc.get.texasr
65 // ERROR: error: '__builtin_get_texasr' needs target feature htm
66 r[18] = __builtin_get_texasru ();
67 // CHECK: @llvm.ppc.get.texasru
68 // ERROR: error: '__builtin_get_texasru' needs target feature htm
69 r[19] = __builtin_get_tfhar ();
70 // CHECK: @llvm.ppc.get.tfhar
71 // ERROR: error: '__builtin_get_tfhar' needs target feature htm
72 r[20] = __builtin_get_tfiar ();
73 // CHECK: @llvm.ppc.get.tfiar
74 // ERROR: error: '__builtin_get_tfiar' needs target feature htm
76 __builtin_set_texasr (a[21]);
77 // CHECK: @llvm.ppc.set.texasr
78 // ERROR: error: '__builtin_set_texasr' needs target feature htm
79 __builtin_set_texasru (a[22]);
80 // CHECK: @llvm.ppc.set.texasru
81 // ERROR: error: '__builtin_set_texasru' needs target feature htm
82 __builtin_set_tfhar (a[23]);
83 // CHECK: @llvm.ppc.set.tfhar
84 // ERROR: error: '__builtin_set_tfhar' needs target feature htm
85 __builtin_set_tfiar (a[24]);
86 // CHECK: @llvm.ppc.set.tfiar
87 // ERROR: error: '__builtin_set_tfiar' needs target feature htm