1 ; This testcase tests whether the raise pass generates bad code for a
2 ; getelementptr instruction... with a bad level raise pass, this code
3 ; will segfault on execution.
5 ; RUN: as < %s | opt -raise |lli -abort-on-exception
7 %Village = type { [4 x \3 *], \2 *, { \2 *, { int, int, int, \5 * } *, \2 * }, { int, int, int, { \2 *, { int, int, int, \6 * } *, \2 * }, { \2 *, { int, int,
8 int, \6 * } *, \2 * }, { \2 *, { int, int, int, \6 * } *, \2 * }, { \2 *, { int, int, int, \6 * } *, \2 * } }, int, int }
14 void "foo"(%Village *%V)
19 void "main"(int %argc, sbyte **%argv)
21 ; <label>:0 ;[#uses=0]
22 %fval = alloca %Village *, uint 4 ; <%Village * *> [#uses=1]
23 %reg115 = malloc sbyte, uint 184 ; <sbyte *> [#uses=2]
27 %reg130 = shl int %argc, ubyte 2 ; <int> [#uses=1]
28 %reg131 = add int %reg130, 3 ; <int> [#uses=1]
29 %reg132 = add int %reg131, 1 ; <int> [#uses=1]
30 %cast323 = cast sbyte * %reg115 to %Village * ; <%Village *> [#uses=1]
31 call void %foo(%Village * %cast323) ; <%Village *> [#uses=0]
35 %reg176 = phi int [ %reg177, %bb6 ], [ 0, %bb4 ] ; <int> [#uses=2]
36 %cast370 = cast int %reg176 to int ; <int> [#uses=1]
37 %cast366 = cast int %reg176 to uint ; <uint> [#uses=1]
38 %reg159 = shl uint %cast366, ubyte 3 ; <uint> [#uses=1]
39 %cast161 = cast uint %reg159 to ulong ; <ulong> [#uses=1]
40 %cast160 = cast ulong %cast161 to sbyte * ; <sbyte *> [#uses=2]
41 %reg162 = add sbyte * %reg115, %cast160 ; <sbyte *> [#uses=0]
42 %cast367 = cast %Village * * %fval to sbyte * ; <sbyte *> [#uses=1]
43 %reg169 = add sbyte * %cast367, %cast160 ; <sbyte *> [#uses=1]
44 %cast368 = cast sbyte * %reg169 to sbyte * * ; <sbyte * *> [#uses=1]
45 %reg170 = load sbyte * * %cast368 ; <sbyte *> [#uses=1]
46 %V = cast sbyte *%reg170 to %Village*
47 call void %foo(%Village *%V)
48 %reg177 = add int %cast370, 1 ; <int> [#uses=2]
49 %cond303 = setle int %reg177, 3 ; <bool> [#uses=1]
50 br bool %cond303, label %bb6, label %bb7