1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-linux-gnu < %s | FileCheck %s
4 %"struct.std::atomic" = type { %"struct.std::atomic_bool" }
5 %"struct.std::atomic_bool" = type { %"struct.std::__atomic_base" }
6 %"struct.std::__atomic_base" = type { i8 }
8 ; CHECK-LABEL: _Z3fooRSt6atomicIbEb
9 define zeroext i1 @_Z3fooRSt6atomicIbEb(ptr nocapture dereferenceable(1) %a, i1 returned zeroext %b) nounwind {
10 ; CHECK-LABEL: _Z3fooRSt6atomicIbEb:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: movl %esi, %eax
13 ; CHECK-NEXT: movq %rdi, %rcx
14 ; CHECK-NEXT: shrq $3, %rcx
15 ; CHECK-NEXT: movzbl 2147450880(%rcx), %ecx
16 ; CHECK-NEXT: testb %cl, %cl
17 ; CHECK-NEXT: je .LBB0_3
18 ; CHECK-NEXT: # %bb.1:
19 ; CHECK-NEXT: movl %edi, %edx
20 ; CHECK-NEXT: andb $7, %dl
21 ; CHECK-NEXT: cmpb %cl, %dl
22 ; CHECK-NEXT: jge .LBB0_2
23 ; CHECK-NEXT: .LBB0_3:
24 ; CHECK-NEXT: movl %eax, %ecx
25 ; CHECK-NEXT: xchgb %cl, (%rdi)
26 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
28 ; CHECK-NEXT: .LBB0_2:
29 ; CHECK-NEXT: pushq %rax
30 ; CHECK-NEXT: callq __asan_report_store1@PLT
34 %frombool.i.i = zext i1 %b to i8
35 %0 = ptrtoint ptr %a to i64
37 %2 = add i64 %1, 2147450880
38 %3 = inttoptr i64 %2 to ptr
41 br i1 %5, label %6, label %11
43 ; <label>:6: ; preds = %entry
45 %8 = trunc i64 %7 to i8
46 %9 = icmp sge i8 %8, %4
47 br i1 %9, label %10, label %11
49 ; <label>:10: ; preds = %6
50 call void @__asan_report_store1(i64 %0)
51 call void asm sideeffect "", ""()
54 ; <label>:11: ; preds = %6, %entry
55 store atomic i8 %frombool.i.i, ptr %a seq_cst, align 1
59 declare void @__asan_report_store1(i64)