Mark Seaborn | edf0d38 | 2013-07-24 16:25:13 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -triple=le32-unknown-nacl -o - %s | FileCheck %s |
| 2 | |
| 3 | int f(); |
| 4 | |
| 5 | // Test that PNaCl uses the Itanium/x86 ABI in which the static |
| 6 | // variable's guard variable is tested via "load i8 and compare with |
| 7 | // zero" rather than the ARM ABI which uses "load i32 and test the |
| 8 | // bottom bit". |
| 9 | void g() { |
| 10 | static int a = f(); |
| 11 | } |
David Blaikie | a953f28 | 2015-02-27 21:19:58 +0000 | [diff] [blame] | 12 | // CHECK: [[LOAD:%.*]] = load atomic i8, i8* bitcast (i64* @_ZGVZ1gvE1a to i8*) acquire |
Benjamin Kramer | f5f726c | 2013-07-24 17:27:08 +0000 | [diff] [blame] | 13 | // CHECK-NEXT: [[GUARD:%.*]] = icmp eq i8 [[LOAD]], 0 |
| 14 | // CHECK-NEXT: br i1 [[GUARD]] |