diff options
author | Chris Lattner <sabre@nondot.org> | 2002-03-21 03:01:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-03-21 03:01:14 +0000 |
commit | f7f04098ce84d4955c6d20b55223c57611300b05 (patch) | |
tree | cf6d22bd3d01e0b0a70e54f0f5f6ef70a3cc4ff9 /test | |
parent | 99584c69b66550424f7b961bbdfa13cf5f086bfd (diff) | |
download | external_llvm-f7f04098ce84d4955c6d20b55223c57611300b05.zip external_llvm-f7f04098ce84d4955c6d20b55223c57611300b05.tar.gz external_llvm-f7f04098ce84d4955c6d20b55223c57611300b05.tar.bz2 |
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/LevelRaise/2002-03-20-BadCodegen.ll | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/Transforms/LevelRaise/2002-03-20-BadCodegen.ll b/test/Transforms/LevelRaise/2002-03-20-BadCodegen.ll new file mode 100644 index 0000000..84f0505 --- /dev/null +++ b/test/Transforms/LevelRaise/2002-03-20-BadCodegen.ll @@ -0,0 +1,54 @@ +; This testcase tests whether the raise pass generates bad code for a +; getelementptr instruction... with a bad level raise pass, this code +; will segfault on execution. +; +; RUN: as < %s | opt -raise |lli -abort-on-exception + + %Village = type { [4 x \3 *], \2 *, { \2 *, { int, int, int, \5 * } *, \2 * }, { int, int, int, { \2 *, { int, int, int, \6 * } *, \2 * }, { \2 *, { int, int, + int, \6 * } *, \2 * }, { \2 *, { int, int, int, \6 * } *, \2 * }, { \2 *, { int, int, int, \6 * } *, \2 * } }, int, int } + + + +implementation + +void "foo"(%Village *%V) +begin + ret void +end + +void "main"(int %argc, sbyte **%argv) +begin +; <label>:0 ;[#uses=0] + %fval = alloca %Village *, uint 4 ; <%Village * *> [#uses=1] + %reg115 = malloc sbyte, uint 184 ; <sbyte *> [#uses=2] + br label %bb4 + +bb4: ;[#uses=2] + %reg130 = shl int %argc, ubyte 2 ; <int> [#uses=1] + %reg131 = add int %reg130, 3 ; <int> [#uses=1] + %reg132 = add int %reg131, 1 ; <int> [#uses=1] + %cast323 = cast sbyte * %reg115 to %Village * ; <%Village *> [#uses=1] + call void %foo(%Village * %cast323) ; <%Village *> [#uses=0] + br label %bb6 + +bb6: ;[#uses=3] + %reg176 = phi int [ %reg177, %bb6 ], [ 0, %bb4 ] ; <int> [#uses=2] + %cast370 = cast int %reg176 to int ; <int> [#uses=1] + %cast366 = cast int %reg176 to uint ; <uint> [#uses=1] + %reg159 = shl uint %cast366, ubyte 3 ; <uint> [#uses=1] + %cast161 = cast uint %reg159 to ulong ; <ulong> [#uses=1] + %cast160 = cast ulong %cast161 to sbyte * ; <sbyte *> [#uses=2] + %reg162 = add sbyte * %reg115, %cast160 ; <sbyte *> [#uses=0] + %cast367 = cast %Village * * %fval to sbyte * ; <sbyte *> [#uses=1] + %reg169 = add sbyte * %cast367, %cast160 ; <sbyte *> [#uses=1] + %cast368 = cast sbyte * %reg169 to sbyte * * ; <sbyte * *> [#uses=1] + %reg170 = load sbyte * * %cast368 ; <sbyte *> [#uses=1] + %V = cast sbyte *%reg170 to %Village* + call void %foo(%Village *%V) + %reg177 = add int %cast370, 1 ; <int> [#uses=2] + %cond303 = setle int %reg177, 3 ; <bool> [#uses=1] + br bool %cond303, label %bb6, label %bb7 + +bb7: ;[#uses=1] + ret void +end |