xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/pr11415.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-pc-linux %s -o - -regalloc=fast -optimize-regalloc=0 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; We used to consider the early clobber in the second asm statement as
4*9880d681SAndroid Build Coastguard Worker; defining %0 before it was read. This caused us to omit the
5*9880d681SAndroid Build Coastguard Worker; movq	-8(%rsp), %rdx
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; CHECK: 	#APP
8*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:	#NO_APP
9*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:	movq	%rcx, %rax
10*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:	movq	%rax, -8(%rsp)
11*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:	movq	-8(%rsp), %rdx
12*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:	#APP
13*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:	#NO_APP
14*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:	movq	%rdx, %rax
15*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:	movq	%rdx, -8(%rsp)
16*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:	ret
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerdefine i64 @foo() {
19*9880d681SAndroid Build Coastguard Workerentry:
20*9880d681SAndroid Build Coastguard Worker  %0 = tail call i64 asm "", "={cx}"() nounwind
21*9880d681SAndroid Build Coastguard Worker  %1 = tail call i64 asm "", "=&r,0,r,~{rax}"(i64 %0, i64 %0) nounwind
22*9880d681SAndroid Build Coastguard Worker  ret i64 %1
23*9880d681SAndroid Build Coastguard Worker}
24