diff options
| author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-08-22 03:05:13 +0000 |
|---|---|---|
| committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-08-22 03:05:13 +0000 |
| commit | d25378de83a755ac6071d89250a95b43233840a5 (patch) | |
| tree | 5161bdd4e3aefbf6d7043d3376a952c0f52a8434 | |
| parent | a2f79dac9d52dc98754360e5c01d7a4e4f75ff8d (diff) | |
| download | bcm5719-llvm-d25378de83a755ac6071d89250a95b43233840a5.tar.gz bcm5719-llvm-d25378de83a755ac6071d89250a95b43233840a5.zip | |
Add functions castbool and boolexpr.
llvm-svn: 3448
| -rw-r--r-- | llvm/test/Regression/LLC/select.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/Regression/LLC/select.ll b/llvm/test/Regression/LLC/select.ll index 5976e5f88d4..4a34d587852 100644 --- a/llvm/test/Regression/LLC/select.ll +++ b/llvm/test/Regression/LLC/select.ll @@ -108,6 +108,30 @@ retlbl: end +;; Test use of a boolean result in cast operations. +;; Requires converting a condition code result into a 0/1 value in a reg. +;; +implementation + +int %castbool(int %A, int %B) { +bb0: ; [#uses=0] + %cond213 = setlt int %A, %B ; <bool> [#uses=1] + %cast110 = cast bool %cond213 to ubyte ; <ubyte> [#uses=1] + %cast109 = cast ubyte %cast110 to int ; <int> [#uses=1] + ret int %cast109 +} + + +;; Test use of a boolean result in arithmetic and logical operations. +;; Requires converting a condition code result into a 0/1 value in a reg. +;; +bool %boolexpr(bool %b, int %N) { + %b2 = setge int %N, 0 + %b3 = and bool %b, %b2 + ret bool %b3 +} + + ; Test branch on floating point comparison ; void "testfloatbool"(float %x, float %y) ; Def %0, %1 - float |

