1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm %s \
3 // RUN: -target-cpu pwr9 -o - | FileCheck %s
4 // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm %s \
5 // RUN: -target-cpu pwr9 -o - | FileCheck %s
6 // RUN: %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm %s \
7 // RUN: -target-cpu pwr9 -o - | FileCheck %s
8 // RUN: %clang_cc1 -triple powerpc-unknown-aix %s -emit-llvm %s \
9 // RUN: -target-cpu pwr9 -o - | FileCheck %s
10 // RUN: not %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm-only %s \
11 // RUN: -target-cpu pwr8 2>&1 | FileCheck %s --check-prefix=CHECK-NONPWR9-ERR
12 // RUN: not %clang_cc1 -target-feature -vsx -target-cpu pwr9 \
13 // RUN: -triple powerpc64-unknown-linux-gnu -emit-llvm-only %s 2>&1 \
14 // RUN: | FileCheck %s --check-prefix=CHECK-NOVSX-ERR
19 int test_builtin_ppc_test() {
20 // CHECK-LABEL: @test_builtin_ppc_test
21 // CHECK: call i32 @llvm.ppc.compare.exp.uo(double %0, double %1)
22 // CHECK: call i32 @llvm.ppc.compare.exp.lt(double %3, double %4)
23 // CHECK: call i32 @llvm.ppc.compare.exp.gt(double %6, double %7)
24 // CHECK: call i32 @llvm.ppc.compare.exp.eq(double %9, double %10)
25 // CHECK: call i32 @llvm.ppc.test.data.class.f64(double %12, i32 0)
26 // CHECK: call i32 @llvm.ppc.test.data.class.f32(float %13, i32 0)
27 // CHECK: call i32 @llvm.ppc.compare.exp.uo(double %14, double %15)
28 // CHECK: call i32 @llvm.ppc.compare.exp.lt(double %17, double %18)
29 // CHECK: call i32 @llvm.ppc.compare.exp.gt(double %20, double %21)
30 // CHECK: call i32 @llvm.ppc.compare.exp.eq(double %23, double %24)
31 // CHECK: call i32 @llvm.ppc.test.data.class.f64(double %26, i32 127)
32 // CHECK: call i32 @llvm.ppc.test.data.class.f32(float %27, i32 127)
34 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions
35 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions
36 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions
37 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions
38 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
39 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
40 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions
41 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions
42 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions
43 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions
44 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
45 // CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
47 // CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions,vsx
48 // CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions,vsx
49 // CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions,vsx
50 // CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions,vsx
51 // CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
52 // CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
53 // CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions,vsx
54 // CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions,vsx
55 // CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions,vsx
56 // CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions,vsx
57 // CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
58 // CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
60 i
= __builtin_ppc_compare_exp_uo(d
, d
);
61 i
= __builtin_ppc_compare_exp_lt(d
, d
);
62 i
= __builtin_ppc_compare_exp_gt(d
, d
);
63 i
= __builtin_ppc_compare_exp_eq(d
, d
);
64 i
= __builtin_ppc_test_data_class(d
, 0);
65 i
= __builtin_ppc_test_data_class(f
, 0);
66 i
= __compare_exp_uo(d
, d
);
67 i
= __compare_exp_lt(d
, d
);
68 i
= __compare_exp_gt(d
, d
);
69 i
= __compare_exp_eq(d
, d
);
70 i
= __test_data_class(d
, 127);
71 i
= __test_data_class(f
, 127);