|
1 | 1 | // RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc %s -emit-llvm -o - | FileCheck %s --check-prefix=X64
|
2 | 2 | // RUN: %clang_cc1 -fms-extensions -triple thumbv7-windows-msvc %s -emit-llvm -o - | FileCheck %s --check-prefix=ARM
|
3 |
| -// RUN: %clang_cc1 -fms-extensions -triple aarch64-windows-msvc %s -emit-llvm -o - | FileCheck %s --check-prefix=ARM |
| 3 | +// RUN: %clang_cc1 -fms-extensions -triple aarch64-windows-msvc %s -emit-llvm -o - | FileCheck %s --check-prefix=ARM64 -check-prefix=ARM |
4 | 4 |
|
5 | 5 | volatile unsigned char sink = 0;
|
6 | 6 | void test32(long *base, long idx) {
|
@@ -33,6 +33,17 @@ void test_arm(long *base, long idx) {
|
33 | 33 | }
|
34 | 34 | #endif
|
35 | 35 |
|
| 36 | +#if defined(_M_ARM64) |
| 37 | +void test_arm64(__int64 *base, __int64 idx) { |
| 38 | + sink = _interlockedbittestandreset64_acq(base, idx); |
| 39 | + sink = _interlockedbittestandreset64_rel(base, idx); |
| 40 | + sink = _interlockedbittestandreset64_nf(base, idx); |
| 41 | + sink = _interlockedbittestandset64_acq(base, idx); |
| 42 | + sink = _interlockedbittestandset64_rel(base, idx); |
| 43 | + sink = _interlockedbittestandset64_nf(base, idx); |
| 44 | +} |
| 45 | +#endif |
| 46 | + |
36 | 47 | // X64-LABEL: define dso_local void @test32(ptr noundef %base, i32 noundef %idx)
|
37 | 48 | // X64: call i8 asm sideeffect "btl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i32 {{.*}})
|
38 | 49 | // X64: call i8 asm sideeffect "btcl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i32 {{.*}})
|
@@ -127,3 +138,11 @@ void test_arm(long *base, long idx) {
|
127 | 138 | // ARM: atomicrmw or ptr %{{.*}}, i8 {{.*}} acquire, align 1
|
128 | 139 | // ARM: atomicrmw or ptr %{{.*}}, i8 {{.*}} release, align 1
|
129 | 140 | // ARM: atomicrmw or ptr %{{.*}}, i8 {{.*}} monotonic, align 1
|
| 141 | + |
| 142 | +// ARM64-LABEL: define dso_local void @test_arm64(ptr noundef %base, i64 noundef %idx) |
| 143 | +// ARM64: atomicrmw and ptr %{{.*}}, i8 {{.*}} acquire, align 1 |
| 144 | +// ARM64: atomicrmw and ptr %{{.*}}, i8 {{.*}} release, align 1 |
| 145 | +// ARM64: atomicrmw and ptr %{{.*}}, i8 {{.*}} monotonic, align 1 |
| 146 | +// ARM64: atomicrmw or ptr %{{.*}}, i8 {{.*}} acquire, align 1 |
| 147 | +// ARM64: atomicrmw or ptr %{{.*}}, i8 {{.*}} release, align 1 |
| 148 | +// ARM64: atomicrmw or ptr %{{.*}}, i8 {{.*}} monotonic, align 1 |
0 commit comments