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
4 ; This test asserted in MachineBlockPlacement during asm-goto bring up.
6 %struct.wibble = type { %struct.pluto, i32, i8* }
7 %struct.pluto = type { i32, i32, i32 }
9 @global = external global [0 x %struct.wibble]
11 define i32 @foo(i32 %arg, i32 (i8*)* %arg3) nounwind {
13 ; CHECK: # %bb.0: # %bb
14 ; CHECK-NEXT: pushq %rbp
15 ; CHECK-NEXT: pushq %r15
16 ; CHECK-NEXT: pushq %r14
17 ; CHECK-NEXT: pushq %r13
18 ; CHECK-NEXT: pushq %r12
19 ; CHECK-NEXT: pushq %rbx
20 ; CHECK-NEXT: pushq %rax
21 ; CHECK-NEXT: movabsq $-2305847407260205056, %rbx # imm = 0xDFFFFC0000000000
22 ; CHECK-NEXT: xorl %eax, %eax
23 ; CHECK-NEXT: testb %al, %al
24 ; CHECK-NEXT: jne .LBB0_5
25 ; CHECK-NEXT: # %bb.1: # %bb5
26 ; CHECK-NEXT: movq %rsi, %r14
27 ; CHECK-NEXT: movslq %edi, %rbp
28 ; CHECK-NEXT: leaq (,%rbp,8), %rax
29 ; CHECK-NEXT: leaq global(%rax,%rax,2), %r15
30 ; CHECK-NEXT: leaq global+4(%rax,%rax,2), %r12
31 ; CHECK-NEXT: xorl %r13d, %r13d
32 ; CHECK-NEXT: .p2align 4, 0x90
33 ; CHECK-NEXT: .LBB0_2: # %bb8
34 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
35 ; CHECK-NEXT: callq bar
36 ; CHECK-NEXT: movq %rax, %rbx
37 ; CHECK-NEXT: movq %rax, %rdi
38 ; CHECK-NEXT: callq *%r14
39 ; CHECK-NEXT: movq %r15, %rdi
40 ; CHECK-NEXT: callq hoge
41 ; CHECK-NEXT: movq %r12, %rdi
42 ; CHECK-NEXT: callq hoge
43 ; CHECK-NEXT: testb %r13b, %r13b
44 ; CHECK-NEXT: jne .LBB0_2
45 ; CHECK-NEXT: # %bb.3: # %bb15
46 ; CHECK-NEXT: leaq (%rbp,%rbp,2), %rax
47 ; CHECK-NEXT: movq %rbx, global+16(,%rax,8)
48 ; CHECK-NEXT: movabsq $-2305847407260205056, %rbx # imm = 0xDFFFFC0000000000
51 ; CHECK-NEXT: .LBB0_4: # %bb17
52 ; CHECK-NEXT: callq widget
53 ; CHECK-NEXT: .Ltmp0: # Block address taken
54 ; CHECK-NEXT: .LBB0_5: # %bb18
55 ; CHECK-NEXT: movw $0, 14(%rbx)
56 ; CHECK-NEXT: addq $8, %rsp
57 ; CHECK-NEXT: popq %rbx
58 ; CHECK-NEXT: popq %r12
59 ; CHECK-NEXT: popq %r13
60 ; CHECK-NEXT: popq %r14
61 ; CHECK-NEXT: popq %r15
62 ; CHECK-NEXT: popq %rbp
65 %tmp = add i64 0, -2305847407260205056
66 %tmp4 = sext i32 %arg to i64
67 br i1 undef, label %bb18, label %bb5
70 %tmp6 = getelementptr [0 x %struct.wibble], [0 x %struct.wibble]* @global, i64 0, i64 %tmp4, i32 0, i32 0
71 %tmp7 = getelementptr [0 x %struct.wibble], [0 x %struct.wibble]* @global, i64 0, i64 %tmp4, i32 0, i32 1
74 bb8: ; preds = %bb8, %bb5
75 %tmp9 = call i8* @bar(i64 undef)
76 %tmp10 = call i32 %arg3(i8* nonnull %tmp9)
77 %tmp11 = ptrtoint i32* %tmp6 to i64
78 call void @hoge(i64 %tmp11)
79 %tmp12 = ptrtoint i32* %tmp7 to i64
80 %tmp13 = add i64 undef, -2305847407260205056
81 call void @hoge(i64 %tmp12)
82 %tmp14 = icmp eq i32 0, 0
83 br i1 %tmp14, label %bb15, label %bb8
86 %tmp16 = getelementptr [0 x %struct.wibble], [0 x %struct.wibble]* @global, i64 0, i64 %tmp4, i32 2
87 store i8* %tmp9, i8** %tmp16
88 callbr void asm sideeffect "", "X"(i8* blockaddress(@foo, %bb18))
89 to label %bb17 [label %bb18]
95 bb18: ; preds = %bb17, %bb15, %bb
96 %tmp19 = add i64 %tmp, 14
97 %tmp20 = inttoptr i64 %tmp19 to i16*
98 store i16 0, i16* %tmp20
102 declare i8* @bar(i64)
104 declare void @widget()
106 declare void @hoge(i64)