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, ptr }
7 %struct.pluto = type { i32, i32, i32 }
9 @global = external dso_local global [0 x %struct.wibble]
11 define i32 @foo(i32 %arg, ptr %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, %r14 # 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, %rbx
27 ; CHECK-NEXT: movslq %edi, %rbp
28 ; CHECK-NEXT: leaq (,%rbp,8), %rax
29 ; CHECK-NEXT: leaq global(%rax,%rax,2), %r14
30 ; CHECK-NEXT: leaq global+4(%rax,%rax,2), %r15
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@PLT
36 ; CHECK-NEXT: movq %rax, %r12
37 ; CHECK-NEXT: movq %rax, %rdi
38 ; CHECK-NEXT: callq *%rbx
39 ; CHECK-NEXT: movq %r14, %rdi
40 ; CHECK-NEXT: callq hoge@PLT
41 ; CHECK-NEXT: movq %r15, %rdi
42 ; CHECK-NEXT: callq hoge@PLT
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 %r12, global+16(,%rax,8)
48 ; CHECK-NEXT: movabsq $-2305847407260205056, %r14 # imm = 0xDFFFFC0000000000
51 ; CHECK-NEXT: # %bb.4: # %bb17
52 ; CHECK-NEXT: callq widget@PLT
53 ; CHECK-NEXT: .LBB0_5: # Block address taken
55 ; CHECK-NEXT: # Label of block must be emitted
56 ; CHECK-NEXT: movw $0, 14(%r14)
57 ; CHECK-NEXT: addq $8, %rsp
58 ; CHECK-NEXT: popq %rbx
59 ; CHECK-NEXT: popq %r12
60 ; CHECK-NEXT: popq %r13
61 ; CHECK-NEXT: popq %r14
62 ; CHECK-NEXT: popq %r15
63 ; CHECK-NEXT: popq %rbp
66 %tmp = add i64 0, -2305847407260205056
67 %tmp4 = sext i32 %arg to i64
68 br i1 undef, label %bb18, label %bb5
71 %tmp6 = getelementptr [0 x %struct.wibble], ptr @global, i64 0, i64 %tmp4, i32 0, i32 0
72 %tmp7 = getelementptr [0 x %struct.wibble], ptr @global, i64 0, i64 %tmp4, i32 0, i32 1
75 bb8: ; preds = %bb8, %bb5
76 %tmp9 = call ptr @bar(i64 undef)
77 %tmp10 = call i32 %arg3(ptr nonnull %tmp9)
78 %tmp11 = ptrtoint ptr %tmp6 to i64
79 call void @hoge(i64 %tmp11)
80 %tmp12 = ptrtoint ptr %tmp7 to i64
81 %tmp13 = add i64 undef, -2305847407260205056
82 call void @hoge(i64 %tmp12)
83 %tmp14 = icmp eq i32 0, 0
84 br i1 %tmp14, label %bb15, label %bb8
87 %tmp16 = getelementptr [0 x %struct.wibble], ptr @global, i64 0, i64 %tmp4, i32 2
88 store ptr %tmp9, ptr %tmp16
89 callbr void asm sideeffect "", "!i"()
90 to label %bb17 [label %bb18]
96 bb18: ; preds = %bb17, %bb15, %bb
97 %tmp19 = add i64 %tmp, 14
98 %tmp20 = inttoptr i64 %tmp19 to ptr
99 store i16 0, ptr %tmp20
103 declare ptr @bar(i64)
105 declare void @widget()
107 declare void @hoge(i64)