diff options
| author | Jim Laskey <jlaskey@mac.com> | 2006-06-13 13:10:44 +0000 |
|---|---|---|
| committer | Jim Laskey <jlaskey@mac.com> | 2006-06-13 13:10:44 +0000 |
| commit | fe25b30c6dc34d41c7a0090fca59696d5f9d70eb (patch) | |
| tree | 02078f0b4945287e59a5da02eaa4efa70439214e /llvm/test/Regression/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll | |
| parent | 8cac9cd5f6ab1606e484e31875362bdfa93fef9c (diff) | |
| download | bcm5719-llvm-fe25b30c6dc34d41c7a0090fca59696d5f9d70eb.tar.gz bcm5719-llvm-fe25b30c6dc34d41c7a0090fca59696d5f9d70eb.zip | |
Tests to make sure that ComputeMaskedBits discards bits for shifts.
llvm-svn: 28766
Diffstat (limited to 'llvm/test/Regression/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll')
| -rw-r--r-- | llvm/test/Regression/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/llvm/test/Regression/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll b/llvm/test/Regression/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll new file mode 100644 index 00000000000..4b69386d887 --- /dev/null +++ b/llvm/test/Regression/CodeGen/Generic/2006-06-13-ComputeMaskedBitsCrash.ll @@ -0,0 +1,50 @@ +; RUN: llvm-as < %s | llc -fast + +uint %test1(uint %tmp1) { + %tmp2 = or uint %tmp1, 2147483648 + %tmp3 = shr uint %tmp2, ubyte 31 + %tmp4 = and uint %tmp3, 2147483648 + %tmp5 = seteq uint %tmp4, 0 + br bool %tmp5, label %cond_true, label %cond_false + +cond_true: + ret uint %tmp1 + +cond_false: + + ret uint %tmp2 +} + + +uint %test2(uint %tmp1) { + %tmp2 = or uint %tmp1, 2147483648 + %tmp3 = cast uint %tmp2 to int + %tmp4 = shr int %tmp3, ubyte 31 + %tmp5 = cast int %tmp4 to uint + %tmp6 = and uint %tmp5, 2147483648 + %tmp7 = seteq uint %tmp6, 0 + br bool %tmp7, label %cond_true, label %cond_false + +cond_true: + ret uint %tmp1 + +cond_false: + + ret uint %tmp2 +} + + +uint %test3(uint %tmp1) { + %tmp2 = or uint %tmp1, 1 + %tmp3 = shl uint %tmp2, ubyte 31 + %tmp4 = and uint %tmp3, 1 + %tmp5 = seteq uint %tmp4, 0 + br bool %tmp5, label %cond_true, label %cond_false + +cond_true: + ret uint %tmp1 + +cond_false: + + ret uint %tmp2 +} |

