34 lines · plain
1; RUN: llc -mtriple=x86_64 < %s | FileCheck %s2 3; Quick test to ensure that atomics which are not naturally-aligned4; emit unsized libcalls, and aren't emitted as native instructions or5; sized libcalls.6define void @test_i32(ptr %a) nounwind {7; CHECK-LABEL: test_i32:8; CHECK: callq __atomic_load9; CHECK: callq __atomic_store10; CHECK: callq __atomic_exchange11; CHECK: callq __atomic_compare_exchange12; CHECK: callq __atomic_compare_exchange13 %t0 = load atomic i32, ptr %a seq_cst, align 214 store atomic i32 1, ptr %a seq_cst, align 215 %t1 = atomicrmw xchg ptr %a, i32 1 seq_cst, align 216 %t3 = atomicrmw add ptr %a, i32 2 seq_cst, align 217 %t2 = cmpxchg ptr %a, i32 0, i32 1 seq_cst seq_cst, align 218 ret void19}20 21define void @test_i128(ptr %a) nounwind {22; CHECK-LABEL: test_i128:23; CHECK: callq __atomic_load24; CHECK: callq __atomic_store25; CHECK: callq __atomic_exchange26; CHECK: callq __atomic_compare_exchange27 %t0 = load atomic i128, ptr %a seq_cst, align 828 store atomic i128 1, ptr %a seq_cst, align 829 %t1 = atomicrmw xchg ptr %a, i128 1 seq_cst, align 830 %t2 = atomicrmw add ptr %a, i128 2 seq_cst, align 831 %t3 = cmpxchg ptr %a, i128 0, i128 1 seq_cst seq_cst, align 832 ret void33}34