34 lines · c
1// REQUIRES: powerpc-registered-target2// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu \3// RUN: -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s4// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu \5// RUN: -emit-llvm %s -o - -target-cpu pwr8 | FileCheck %s6// RUN: %clang_cc1 -triple powerpc64-unknown-aix \7// RUN: -emit-llvm %s -o - -target-cpu pwr7 | FileCheck %s8// RUN: not %clang_cc1 -triple powerpc-unknown-aix \9// RUN: -emit-llvm %s -o - -target-cpu pwr7 2>&1 | FileCheck %s --check-prefix=CHECK-32-ERROR10 11extern unsigned long long ull;12extern unsigned long long *ull_addr;13 14// CHECK-LABEL: @test_builtin_ppc_store8r(15// CHECK: [[TMP0:%.*]] = load i64, ptr @ull, align 816// CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr @ull_addr, align 817// CHECK-NEXT: call void @llvm.ppc.store8r(i64 [[TMP0]], ptr [[TMP1]])18// CHECK-NEXT: ret void19 20// CHECK-32-ERROR: error: this builtin is only available on 64-bit targets21void test_builtin_ppc_store8r() {22 __builtin_ppc_store8r(ull, ull_addr);23}24 25// CHECK-LABEL: @test_builtin_ppc_load8r(26// CHECK: [[TMP0:%.*]] = load ptr, ptr @ull_addr, align 827// CHECK-NEXT: [[TMP2:%.*]] = call i64 @llvm.ppc.load8r(ptr [[TMP0]])28// CHECK-NEXT: ret i64 [[TMP2]]29 30// CHECK-32-ERROR: error: this builtin is only available on 64-bit targets31unsigned long long test_builtin_ppc_load8r() {32 return __builtin_ppc_load8r(ull_addr);33}34