47 lines · c
1// REQUIRES: powerpc-registered-target2// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm %s \3// RUN: -target-cpu pwr8 -o - | FileCheck %s -check-prefix=CHECK-PWR84// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm %s \5// RUN: -target-cpu pwr8 -o - | FileCheck %s -check-prefix=CHECK-PWR86// RUN: %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm %s \7// RUN: -target-cpu pwr8 -o - | FileCheck %s -check-prefix=CHECK-PWR88// RUN: %clang_cc1 -triple powerpc-unknown-aix %s -emit-llvm %s \9// RUN: -target-cpu pwr8 -o - | FileCheck %s -check-prefix=CHECK-PWR810// RUN: not %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm %s \11// RUN: -target-cpu pwr7 -o - 2>&1 | FileCheck %s -check-prefix=CHECK-NOPWR812// RUN: not %clang_cc1 -triple powerpc64-unknown-aix -emit-llvm %s \13// RUN: -target-cpu pwr7 -o - 2>&1 | FileCheck %s -check-prefix=CHECK-NOPWR814// RUN: not %clang_cc1 -triple powerpc-unknown-aix %s -emit-llvm %s \15// RUN: -target-cpu pwr7 -o - 2>&1 | FileCheck %s -check-prefix=CHECK-NOPWR816 17extern void *a;18extern volatile char *c_addr;19extern char *ptr;20extern char c;21extern int i;22extern vector unsigned char vuc;23 24void test_xlcompat() {25 // CHECK-PWR8-LABEL: @test_xlcompat(26 // CHECK-PWR8: call void @llvm.ppc.icbt(ptr %{{[0-9]+}})27 // CHECK-NOPWR8: error: '__builtin_ppc_icbt' needs target feature isa-v207-instructions28 __icbt(a);29 30 // CHECK-PWR8: call void @llvm.ppc.icbt(ptr %{{[0-9]+}})31 // CHECK-NOPWR8: error: '__builtin_ppc_icbt' needs target feature isa-v207-instructions32 __builtin_ppc_icbt(a);33 34 // CHECK-PWR8: [[TMP0:%.*]] = load ptr, ptr @c_addr, align {{[0-9]+}}35 // CHECK-PWR8-NEXT: [[TMP1:%.*]] = load i8, ptr @c, align 136 // CHECK-PWR8-NEXT: [[TMP2:%.*]] = sext i8 [[TMP1]] to i3237 // CHECK-PWR8-NEXT: [[TMP3:%.*]] = call i32 @llvm.ppc.stbcx(ptr [[TMP0]], i32 [[TMP2]])38 // CHECK-NOPWR8: error: '__builtin_ppc_stbcx' needs target feature isa-v207-instructions39 i = __builtin_ppc_stbcx(c_addr, c);40 41 // CHECK-NOPWR8: error: '__builtin_vsx_ldrmb' needs target feature isa-v207-instructions42 vuc = __builtin_vsx_ldrmb(ptr, 14);43 44 // CHECK-NOPWR8: error: '__builtin_vsx_strmb' needs target feature isa-v207-instructions45 __builtin_vsx_strmb(ptr, 14, vuc);46}47