File: builtins-ppc-xlcompat-test.c

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (73 lines) | stat: -rw-r--r-- 4,713 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm %s \
// RUN:   -target-cpu pwr9 -o - | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm %s \
// RUN:   -target-cpu pwr9 -o - | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm %s \
// RUN:   -target-cpu pwr9 -o - | FileCheck %s
// RUN: %clang_cc1 -triple powerpc-unknown-aix %s -emit-llvm %s \
// RUN:   -target-cpu pwr9 -o - | FileCheck %s
// RUN: not %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm-only %s \
// RUN:   -target-cpu pwr8 2>&1 | FileCheck %s --check-prefix=CHECK-NONPWR9-ERR
// RUN: not %clang_cc1 -target-feature -vsx -target-cpu pwr9 \
// RUN:   -triple powerpc64-unknown-linux-gnu -emit-llvm-only %s 2>&1 \
// RUN:   | FileCheck %s --check-prefix=CHECK-NOVSX-ERR

extern double d;
extern float f;

int test_builtin_ppc_test() {
// CHECK-LABEL: @test_builtin_ppc_test
// CHECK: call i32 @llvm.ppc.compare.exp.uo(double %0, double %1)
// CHECK: call i32 @llvm.ppc.compare.exp.lt(double %3, double %4)
// CHECK: call i32 @llvm.ppc.compare.exp.gt(double %6, double %7)
// CHECK: call i32 @llvm.ppc.compare.exp.eq(double %9, double %10)
// CHECK: call i32 @llvm.ppc.test.data.class.f64(double %12, i32 0)
// CHECK: call i32 @llvm.ppc.test.data.class.f32(float %13, i32 0)
// CHECK: call i32 @llvm.ppc.compare.exp.uo(double %14, double %15)
// CHECK: call i32 @llvm.ppc.compare.exp.lt(double %17, double %18)
// CHECK: call i32 @llvm.ppc.compare.exp.gt(double %20, double %21)
// CHECK: call i32 @llvm.ppc.compare.exp.eq(double %23, double %24)
// CHECK: call i32 @llvm.ppc.test.data.class.f64(double %26, i32 127)
// CHECK: call i32 @llvm.ppc.test.data.class.f32(float %27, i32 127)

// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions
// CHECK-NONPWR9-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions

// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_uo' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_lt' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_gt' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_compare_exp_eq' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
// CHECK-NOVSX-ERR: error: '__builtin_ppc_test_data_class' needs target feature isa-v30-instructions,vsx
  int i;
  i = __builtin_ppc_compare_exp_uo(d, d);
  i = __builtin_ppc_compare_exp_lt(d, d);
  i = __builtin_ppc_compare_exp_gt(d, d);
  i = __builtin_ppc_compare_exp_eq(d, d);
  i = __builtin_ppc_test_data_class(d, 0);
  i = __builtin_ppc_test_data_class(f, 0);
  i = __compare_exp_uo(d, d);
  i = __compare_exp_lt(d, d);
  i = __compare_exp_gt(d, d);
  i = __compare_exp_eq(d, d);
  i = __test_data_class(d, 127);
  i = __test_data_class(f, 127);
  return i;
}