1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X64
5 ; Test coverage for matchAddressRecursively's MUL handling
15 ; void foo(bool b, int i) {
18 ; int j = c.m_data[i + 1].m_bar();
22 %struct.A = type { [5 x i32] }
24 define void @foo(i1 zeroext, i32) nounwind {
27 ; X86-NEXT: movb {{[0-9]+}}(%esp), %al
28 ; X86-NEXT: testb %al, %al
29 ; X86-NEXT: je .LBB0_1
32 ; X86-NEXT: .LBB0_1: # %.preheader
33 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
34 ; X86-NEXT: .p2align 4, 0x90
35 ; X86-NEXT: .LBB0_2: # =>This Inner Loop Header: Depth=1
36 ; X86-NEXT: leal (%eax,%eax,4), %eax
37 ; X86-NEXT: leal 20(,%eax,4), %eax
38 ; X86-NEXT: pushl %eax
40 ; X86-NEXT: addl $4, %esp
41 ; X86-NEXT: jmp .LBB0_2
45 ; X64-NEXT: pushq %rax
46 ; X64-NEXT: testl %edi, %edi
47 ; X64-NEXT: je .LBB0_1
51 ; X64-NEXT: .LBB0_1: # %.preheader
52 ; X64-NEXT: movl %esi, %eax
53 ; X64-NEXT: .p2align 4, 0x90
54 ; X64-NEXT: .LBB0_2: # =>This Inner Loop Header: Depth=1
57 ; X64-NEXT: shlq $2, %rax
58 ; X64-NEXT: leaq (%rax,%rax,4), %rdi
60 ; X64-NEXT: jmp .LBB0_2
61 br i1 %0, label %9, label %3
63 %4 = phi i32 [ %8, %3 ], [ %1, %2 ]
64 %5 = add nsw i32 %4, 1
65 %6 = sext i32 %5 to i64
66 %7 = getelementptr inbounds %struct.A, %struct.A* null, i64 %6
67 %8 = tail call i32 @bar(%struct.A* %7)
73 declare i32 @bar(%struct.A*)