• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3
4	%struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
5
6define  i32 @perimeter(%struct.quad_struct* %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
32; CHECK-NEXT:    retl
33entry:
34	switch i32 %size, label %UnifiedReturnBlock [
35		 i32 2, label %bb
36		 i32 0, label %bb50
37	]
38
39bb:		; preds = %entry
40	%tmp31 = tail call  i32 @perimeter( %struct.quad_struct* null, i32 0 ) nounwind 		; <i32> [#uses=1]
41	%tmp40 = tail call  i32 @perimeter( %struct.quad_struct* 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]
44	ret i32 %tmp42
45
46bb50:		; preds = %entry
47	ret i32 0
48
49UnifiedReturnBlock:		; preds = %entry
50	ret i32 0
51}
52