1 // RUN: %clang_cc1 -Wall -Werror -triple thumbv8-linux-gnueabi -fno-signed-char -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -Wall -Werror -triple arm64-apple-ios7.0 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-ARM64
3
4 bool b;
5
6 // CHECK-LABEL: @_Z10test_ldrexv()
7 // CHECK: call i32 @llvm.arm.ldrex.p0i8(i8* @b)
8
9 // CHECK-ARM64-LABEL: @_Z10test_ldrexv()
10 // CHECK-ARM64: call i64 @llvm.aarch64.ldxr.p0i8(i8* @b)
11
test_ldrex()12 void test_ldrex() {
13 b = __builtin_arm_ldrex(&b);
14 }
15
16 // CHECK-LABEL: @_Z10tset_strexv()
17 // CHECK: %{{.*}} = call i32 @llvm.arm.strex.p0i8(i32 1, i8* @b)
18
19 // CHECK-ARM64-LABEL: @_Z10tset_strexv()
20 // CHECK-ARM64: %{{.*}} = call i32 @llvm.aarch64.stxr.p0i8(i64 1, i8* @b)
21
tset_strex()22 void tset_strex() {
23 __builtin_arm_strex(true, &b);
24 }
25