brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 02c5d7f Raw
69 lines · c
1// REQUIRES: powerpc-registered-target2// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm %s \3// RUN:   -target-cpu pwr9 -o - | FileCheck %s4// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm %s \5// RUN:   -target-cpu pwr9 -o - | FileCheck %s6// RUN: %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm %s \7// RUN:   -target-cpu pwr9 -o - | FileCheck %s8// RUN: not %clang_cc1 -triple powerpc-unknown-aix -emit-llvm-only %s \9// RUN:   -target-cpu pwr9 2>&1 | FileCheck %s --check-prefix=CHECK-32-ERROR10// RUN: not %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm-only %s \11// RUN:   -target-cpu pwr8 2>&1 | FileCheck %s --check-prefix=CHECK-NONPWR9-ERR12 13extern signed long long sll;14extern unsigned long long ull;15double d;16 17void test_compat_builtins() {18  // CHECK-LABEL: @test_compat_builtins(19  // CHECK: %2 = call i64 @llvm.ppc.cmpeqb(i64 %0, i64 %1)20  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets21  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_cmpeqb' needs target feature isa-v30-instructions22  sll = __builtin_ppc_cmpeqb(sll, sll);23 24  // CHECK: %5 = call i64 @llvm.ppc.setb(i64 %3, i64 %4)25  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets26  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_setb' needs target feature isa-v30-instructions27  sll = __builtin_ppc_setb(sll, sll);28 29  // CHECK: %9 = call i64 @llvm.ppc.maddhd(i64 %6, i64 %7, i64 %8)30  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets31  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_maddhd' needs target feature isa-v30-instructions32  sll = __builtin_ppc_maddhd(sll, sll, sll);33 34  // CHECK: %13 = call i64 @llvm.ppc.maddhdu(i64 %10, i64 %11, i64 %12)35  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets36  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_maddhdu' needs target feature isa-v30-instructions37  ull = __builtin_ppc_maddhdu(ull, ull, ull);38 39  // CHECK: %17 = call i64 @llvm.ppc.maddld(i64 %14, i64 %15, i64 %16)40  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets41  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_maddld' needs target feature isa-v30-instructions42  sll = __builtin_ppc_maddld(sll, sll, sll);43 44  // CHECK: %21 = call i64 @llvm.ppc.maddld(i64 %18, i64 %19, i64 %20)45  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets46  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_maddld' needs target feature isa-v30-instructions47  ull = __builtin_ppc_maddld(ull, ull, ull);48 49  // CHECK: %23 = call i64 @llvm.ppc.extract.sig(double %22)50  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets51  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_extract_sig' needs target feature power9-vector52  ull = __extract_sig (d);53 54  // CHECK: %26 = call double @llvm.ppc.insert.exp(double %24, i64 %25)55  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets56  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_insert_exp' needs target feature power9-vector57  d = __insert_exp (d, ull);58 59  // CHECK: %29 = call i64 @llvm.ppc.addex(i64 %27, i64 %28, i32 0)60  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets61  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_addex' needs target feature isa-v30-instructions62  sll = __builtin_ppc_addex(sll, sll, 0);63 64  // CHECK: %32 = call i64 @llvm.ppc.addex(i64 %30, i64 %31, i32 0)65  // CHECK-32-ERROR: error: this builtin is only available on 64-bit targets66  // CHECK-NONPWR9-ERR: error: '__builtin_ppc_addex' needs target feature isa-v30-instructions67  ull = __builtin_ppc_addex(ull, ull, 0);68}69