61 lines · c
1// RUN: %clang_cc1 -triple thumbv6m-apple-unknown-macho %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-V6M2// RUN: %clang_cc1 -triple thumbv7m-apple-unknown-macho %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-V7M3// RUN: %clang_cc1 -triple thumbv7-apple-ios13.0 %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-HOSTED4// RUN: %clang_cc1 -triple thumbv7k-apple-watchos5.0 %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-HOSTED5// RUN: %clang_cc1 -triple arm-linux-gnueabi %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-HOSTED6// RUN: %clang_cc1 -triple armv7-none-eabi %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-HOSTED7// RUN: %clang_cc1 -triple thumbv6k-none-eabi %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-HOSTED8// RUN: %clang_cc1 -triple armv5-none-eabi %s -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK,CHECK-V6M9 10// CHECK-V6M: @always1 = global i32 011// CHECK-V6M: @always4 = global i32 012// CHECK-V6M: @always8 = global i32 013 14// CHECK-V7M: @always1 = global i32 115// CHECK-V7M: @always4 = global i32 116// CHECK-V7M: @always8 = global i32 017 18// CHECK-HOSTED: @always1 = global i32 119// CHECK-HOSTED: @always4 = global i32 120// CHECK-HOSTED: @always8 = global i32 121 22int always1 = __atomic_always_lock_free(1, 0);23int always4 = __atomic_always_lock_free(4, 0);24int always8 = __atomic_always_lock_free(8, 0);25 26int lock_free_1() {27 // CHECK-LABEL: @lock_free_128 // CHECK-V6M: [[RES:%.*]] = call{{.*}}zeroext i1 @__atomic_is_lock_free(i32 noundef 1, ptr noundef null)29 // CHECK-V6M: [[RES32:%.*]] = zext i1 [[RES]] to i3230 // CHECK-V6M: ret i32 [[RES32]]31 32 // CHECK-V7M: ret i32 133 // CHECK-HOSTED: ret i32 134 return __c11_atomic_is_lock_free(1);35}36 37int lock_free_4() {38 // CHECK-LABEL: @lock_free_439 // CHECK-V6M: [[RES:%.*]] = call{{.*}}zeroext i1 @__atomic_is_lock_free(i32 noundef 4, ptr noundef null)40 // CHECK-V6M: [[RES32:%.*]] = zext i1 [[RES]] to i3241 // CHECK-V6M: ret i32 [[RES32]]42 43 // CHECK-V7M: ret i32 144 // CHECK-HOSTED: ret i32 145 return __c11_atomic_is_lock_free(4);46}47 48int lock_free_8() {49 // CHECK-LABEL: @lock_free_850 // CHECK-V6M: [[RES:%.*]] = call{{.*}}zeroext i1 @__atomic_is_lock_free(i32 noundef 8, ptr noundef null)51 // CHECK-V6M: [[RES32:%.*]] = zext i1 [[RES]] to i3252 // CHECK-V6M: ret i32 [[RES32]]53 54 // CHECK-V7M: [[RES:%.*]] = call{{.*}}zeroext i1 @__atomic_is_lock_free(i32 noundef 8, ptr noundef null)55 // CHECK-V7M: [[RES32:%.*]] = zext i1 [[RES]] to i3256 // CHECK-V7M: ret i32 [[RES32]]57 58 // CHECK-HOSTED: ret i32 159 return __c11_atomic_is_lock_free(8);60}61