From 0fdba212a7eeb9cbbe97d695a759c16eb43f416b Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 11 Dec 2006 21:25:10 +0000 Subject: Add a test for constant folding of bitcast to/from floating point. llvm-svn: 32446 --- llvm/test/Feature/fold-fpcast.ll | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 llvm/test/Feature/fold-fpcast.ll (limited to 'llvm/test/Feature/fold-fpcast.ll') 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) +} + -- cgit v1.2.3