Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / PowerPC / builtins-ppc-xlcompat-trap-64bit-only.c
blob55796dfd0de108242dfcb8f89ca03201050f6e0b
1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -O2 -triple powerpc64-unknown-linux-gnu \
3 // RUN: -emit-llvm %s -o - -target-cpu pwr7 | \
4 // RUN: FileCheck %s --check-prefixes=CHECK64
5 // RUN: %clang_cc1 -O2 -triple powerpc64le-unknown-linux-gnu \
6 // RUN: -emit-llvm %s -o - -target-cpu pwr8 | \
7 // RUN: FileCheck %s --check-prefixes=CHECK64
8 // RUN: not %clang_cc1 -O2 -triple powerpc-unknown-aix \
9 // RUN: -emit-llvm %s -o - -target-cpu pwr7 2>&1 | \
10 // RUN: FileCheck %s -check-prefixes=CHECK32-ERROR
11 // RUN: %clang_cc1 -O2 -triple powerpc64-unknown-aix \
12 // RUN: -emit-llvm %s -o - -target-cpu pwr7 | \
13 // RUN: FileCheck %s --check-prefixes=CHECK64
15 extern long long lla, llb;
16 extern double da;
18 // tdw
19 void test_xl_tdw(void) {
20 // CHECK64: void @llvm.ppc.tdw(i64 %0, i64 %1, i32 1)
21 // CHECK32-ERROR: error: this builtin is only available on 64-bit targets
22 __tdw(lla, llb, 1);
25 void test_tdw(void) {
26 // CHECK64: void @llvm.ppc.tdw(i64 %0, i64 %1, i32 13)
27 // CHECK32-ERROR: error: this builtin is only available on 64-bit targets
28 __builtin_ppc_tdw(lla, llb, 13);
31 // trapd
32 void test_trapd(void) {
33 // CHECK64: void @llvm.ppc.trapd(i64 %conv)
34 // CHECK32-ERROR: error: this builtin is only available on 64-bit targets
35 __builtin_ppc_trapd(da);
38 void test_xl_trapd(void) {
39 // CHECK64: void @llvm.ppc.trapd(i64 %conv)
40 // CHECK32-ERROR: error: this builtin is only available on 64-bit targets
41 __trapd(da);