1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
3
4; This used to crash due to Live Variable analysis removing the redundant eax
5; and edx clobbers, but not removing the inline asm flag operands that proceed
6; them.
7
8@test_mem = dso_local global [16 x i8] c"UUUUUUUUUUUUUUUU", align 16
9
10; Function Attrs: nounwind uwtable
11define dso_local void @foo() local_unnamed_addr {
12; CHECK-LABEL: foo:
13; CHECK:       # %bb.0: # %entry
14; CHECK-NEXT:    #APP
15; CHECK-EMPTY:
16; CHECK-NEXT:    clc
17; CHECK-NEXT:    cmpxchg8b test_mem(%rip)
18; CHECK-NEXT:    cmpxchg16b test_mem(%rip)
19; CHECK-NEXT:    clc
20; CHECK-EMPTY:
21; CHECK-NEXT:    #NO_APP
22; CHECK-NEXT:    retq
23entry:
24  tail call void asm sideeffect inteldialect "clc\0A\09cmpxchg8b $0\0A\09cmpxchg16b $1\0A\09clc", "=*m,=*m,~{eax},~{edx},~{flags},~{rax},~{rdx},~{dirflag},~{fpsr},~{flags}"([16 x i8]* nonnull @test_mem, [16 x i8]* nonnull @test_mem) #1
25  ret void
26}
27