xref: /llvm-project/llvm/test/CodeGen/X86/fold-call.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; RUN: llc < %s -mtriple=i686-- | FileCheck %s
2; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s
3
4; CHECK: test1
5; CHECK-NOT: mov
6
7declare void @bar()
8define void @test1(i32 %i0, i32 %i1, i32 %i2, i32 %i3, i32 %i4, i32 %i5, ptr %arg) nounwind {
9	call void @bar()
10	call void %arg()
11	ret void
12}
13
14; PR14739
15; CHECK: test2
16; CHECK: mov{{.*}} $0, ([[REGISTER:%[a-z]+]])
17; CHECK-NOT: jmp{{.*}} *([[REGISTER]])
18
19%struct.X = type { ptr }
20define void @test2(ptr nocapture %x) {
21entry:
22  %0 = load ptr, ptr %x
23  store ptr null, ptr %x
24  tail call void %0()
25  ret void
26}
27