1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-apple-darwin -mattr=+sse2 -no-x86-call-frame-opt | FileCheck %s
4 %struct.quad_struct = type { i32, i32, ptr, ptr, ptr, ptr, ptr }
6 define i32 @perimeter(ptr %tree, i32 %size) nounwind {
7 ; CHECK-LABEL: perimeter:
8 ; CHECK: ## %bb.0: ## %entry
9 ; CHECK-NEXT: pushl %esi
10 ; CHECK-NEXT: subl $8, %esp
11 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
12 ; CHECK-NEXT: testl %eax, %eax
13 ; CHECK-NEXT: je LBB0_3
14 ; CHECK-NEXT: ## %bb.1: ## %entry
15 ; CHECK-NEXT: cmpl $2, %eax
16 ; CHECK-NEXT: jne LBB0_3
17 ; CHECK-NEXT: ## %bb.2: ## %bb
18 ; CHECK-NEXT: movl $0, {{[0-9]+}}(%esp)
19 ; CHECK-NEXT: movl $0, (%esp)
20 ; CHECK-NEXT: calll _perimeter
21 ; CHECK-NEXT: movl %eax, %esi
22 ; CHECK-NEXT: movl $0, {{[0-9]+}}(%esp)
23 ; CHECK-NEXT: movl $0, (%esp)
24 ; CHECK-NEXT: calll _perimeter
25 ; CHECK-NEXT: addl %esi, %eax
26 ; CHECK-NEXT: jmp LBB0_4
27 ; CHECK-NEXT: LBB0_3: ## %UnifiedReturnBlock
28 ; CHECK-NEXT: xorl %eax, %eax
29 ; CHECK-NEXT: LBB0_4: ## %UnifiedReturnBlock
30 ; CHECK-NEXT: addl $8, %esp
31 ; CHECK-NEXT: popl %esi
34 switch i32 %size, label %UnifiedReturnBlock [
40 %tmp31 = tail call i32 @perimeter( ptr null, i32 0 ) nounwind ; <i32> [#uses=1]
41 %tmp40 = tail call i32 @perimeter( ptr null, i32 0 ) nounwind ; <i32> [#uses=1]
42 %tmp33 = add i32 0, %tmp31 ; <i32> [#uses=1]
43 %tmp42 = add i32 %tmp33, %tmp40 ; <i32> [#uses=1]
46 bb50: ; preds = %entry
49 UnifiedReturnBlock: ; preds = %entry