diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-11 21:25:10 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-11 21:25:10 +0000 |
commit | 0fdba212a7eeb9cbbe97d695a759c16eb43f416b (patch) | |
tree | 88bc72222cb5bc4415bc909ba589caaeb9bad672 | |
parent | 025ca90b7a704f2b8566b384033ea452e6679731 (diff) | |
download | bcm5719-llvm-0fdba212a7eeb9cbbe97d695a759c16eb43f416b.tar.gz bcm5719-llvm-0fdba212a7eeb9cbbe97d695a759c16eb43f416b.zip |
Add a test for constant folding of bitcast to/from floating point.
llvm-svn: 32446
-rw-r--r-- | llvm/test/Feature/fold-fpcast.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Feature/fold-fpcast.ll b/llvm/test/Feature/fold-fpcast.ll new file mode 100644 index 00000000000..cb93ef8c823 --- /dev/null +++ b/llvm/test/Feature/fold-fpcast.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | llvm-dis | not grep bitcast + +int %test1() { + ret int bitcast(float 3.7 to int) +} + +float %test2() { + ret float bitcast(int 17 to float) +} + +long %test3() { + ret long bitcast (double 3.1415926 to long) +} + +double %test4() { + ret double bitcast (long 42 to double) +} + |