diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-27 19:54:23 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-27 19:54:23 +0000 |
commit | e434f4ac50aea8da7b73c00c988599a04ec739d0 (patch) | |
tree | 97af5f6e2beb1c8410bf8635a3659c914e797356 /test/CodeGen | |
parent | f357daf2fe4e30c96bf879908a04cde5ebf49244 (diff) | |
download | external_llvm-e434f4ac50aea8da7b73c00c988599a04ec739d0.zip external_llvm-e434f4ac50aea8da7b73c00c988599a04ec739d0.tar.gz external_llvm-e434f4ac50aea8da7b73c00c988599a04ec739d0.tar.bz2 |
Add 3 more test cases for ptrtoint, fptoui and fptosi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r-- | test/CodeGen/X86/trunc-to-bool.ll | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/test/CodeGen/X86/trunc-to-bool.ll b/test/CodeGen/X86/trunc-to-bool.ll index 0af8de2..92a0949 100644 --- a/test/CodeGen/X86/trunc-to-bool.ll +++ b/test/CodeGen/X86/trunc-to-bool.ll @@ -2,7 +2,7 @@ ; sure only the LSBit survives. Test that this is the case both for a returned ; value and as the operand of a branch. ; RUN: llvm-as < %s | llc -march=x86 && -; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | wc -l | grep 3 +; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | wc -l | grep 6 bool %test1(int %X) { %Y = trunc int %X to bool ret bool %Y @@ -30,3 +30,30 @@ cond_true: cond_false: ret int 42 } + +int %test4(sbyte* %ptr) { + %tmp = ptrtoint sbyte* %ptr to bool + br bool %tmp, label %cond_true, label %cond_false +cond_true: + ret int 21 +cond_false: + ret int 42 +} + +int %test5(float %f) { + %tmp = fptoui float %f to bool + br bool %tmp, label %cond_true, label %cond_false +cond_true: + ret int 21 +cond_false: + ret int 42 +} + +int %test6(double %d) { + %tmp = fptosi double %d to bool + br bool %tmp, label %cond_true, label %cond_false +cond_true: + ret int 21 +cond_false: + ret int 42 +} |