blob: 3e4bd02097ad7cc44b037299b0c7476a550b0d50 [file] [log] [blame]
Tim Northoverb4ddc082014-05-30 10:09:59 +00001; RUN: llc < %s -mtriple=thumbv7-apple-darwin -arm-atomic-cfg-tidy=0 -mcpu=cortex-a8 -relocation-model=pic -disable-fp-elim | FileCheck %s
Evan Cheng43219992009-11-01 21:12:51 +00002; rdar://7352504
3; Make sure we use "str r9, [sp, #+28]" instead of "sub.w r4, r7, #256" followed by "str r9, [r4, #-32]".
4
5%0 = type { i16, i8, i8 }
6%1 = type { [2 x i32], [2 x i32] }
7%2 = type { %union.rec* }
8%struct.FILE_POS = type { i8, i8, i16, i32 }
9%struct.GAP = type { i8, i8, i16 }
10%struct.LIST = type { %union.rec*, %union.rec* }
11%struct.STYLE = type { %union.anon, %union.anon, i16, i16, i32 }
12%struct.head_type = type { [2 x %struct.LIST], %union.FIRST_UNION, %union.SECOND_UNION, %union.THIRD_UNION, %union.FOURTH_UNION, %union.rec*, %2, %union.rec*, %union.rec*, %union.rec*, %union.rec*, %union.rec*, %union.rec*, %union.rec*, %union.rec*, i32 }
13%union.FIRST_UNION = type { %struct.FILE_POS }
14%union.FOURTH_UNION = type { %struct.STYLE }
15%union.SECOND_UNION = type { %0 }
16%union.THIRD_UNION = type { %1 }
17%union.anon = type { %struct.GAP }
18%union.rec = type { %struct.head_type }
19
20@zz_hold = external global %union.rec* ; <%union.rec**> [#uses=2]
21@zz_res = external global %union.rec* ; <%union.rec**> [#uses=1]
22
Rafael Espindola29dda212010-06-17 15:18:27 +000023define %union.rec* @Manifest(%union.rec* %x, %union.rec* %env, %struct.STYLE* %style, %union.rec** %bthr, %union.rec** %fthr, %union.rec** %target, %union.rec** %crs, i32 %ok, i32 %need_expand, %union.rec** %enclose, i32 %fcr) nounwind {
Evan Cheng43219992009-11-01 21:12:51 +000024entry:
Jakob Stoklund Olesen831ae012011-06-18 01:14:46 +000025; CHECK: ldr{{(.w)?}} {{(r[0-9]+)|(lr)}}, [r7, #28]
Evan Cheng43219992009-11-01 21:12:51 +000026 %xgaps.i = alloca [32 x %union.rec*], align 4 ; <[32 x %union.rec*]*> [#uses=0]
27 %ycomp.i = alloca [32 x %union.rec*], align 4 ; <[32 x %union.rec*]*> [#uses=0]
Dan Gohmandf6b33e2010-06-24 15:04:11 +000028 br label %bb20
Evan Cheng43219992009-11-01 21:12:51 +000029
30bb20: ; preds = %entry
31 switch i32 undef, label %bb1287 [
Kyle Butt5e241b12016-03-29 00:23:41 +000032 i32 110, label %bb119
33 i32 120, label %bb119
34 i32 210, label %bb420
35 i32 230, label %bb420
36 i32 450, label %bb438
37 i32 460, label %bb438
38 i32 550, label %bb533
39 i32 560, label %bb569
40 i32 640, label %bb745
41 i32 780, label %bb1098
Evan Cheng43219992009-11-01 21:12:51 +000042 ]
43
44bb119: ; preds = %bb20, %bb20
45 unreachable
46
47bb420: ; preds = %bb20, %bb20
Evan Cheng2a6c92f2009-11-19 06:32:27 +000048; CHECK: bb420
Jakob Stoklund Olesen8ec1a922011-11-12 22:39:34 +000049; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp
50; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp
51; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp
52; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp
Evan Cheng43219992009-11-01 21:12:51 +000053 store %union.rec* null, %union.rec** @zz_hold, align 4
54 store %union.rec* null, %union.rec** @zz_res, align 4
55 store %union.rec* %x, %union.rec** @zz_hold, align 4
Rafael Espindola29dda212010-06-17 15:18:27 +000056 %0 = call %union.rec* @Manifest(%union.rec* undef, %union.rec* %env, %struct.STYLE* %style, %union.rec** %bthr, %union.rec** %fthr, %union.rec** %target, %union.rec** %crs, i32 %ok, i32 %need_expand, %union.rec** %enclose, i32 %fcr) nounwind ; <%union.rec*> [#uses=0]
Evan Cheng43219992009-11-01 21:12:51 +000057 unreachable
58
59bb438: ; preds = %bb20, %bb20
60 unreachable
61
62bb533: ; preds = %bb20
63 ret %union.rec* %x
64
65bb569: ; preds = %bb20
66 unreachable
67
68bb745: ; preds = %bb20
69 unreachable
70
71bb1098: ; preds = %bb20
72 unreachable
73
74bb1287: ; preds = %bb20
75 unreachable
76}