diff options
author | Nadav Rotem <nadav.rotem@intel.com> | 2011-02-13 15:45:34 +0000 |
---|---|---|
committer | Nadav Rotem <nadav.rotem@intel.com> | 2011-02-13 15:45:34 +0000 |
commit | bc53ca1b530aa57280c7a373ea518278abb6ae37 (patch) | |
tree | 7884951e017c5629fb68a460aa38c93265eb011e /test | |
parent | 915eeb488786379250808d47668c43e010efe566 (diff) | |
download | llvm-bc53ca1b530aa57280c7a373ea518278abb6ae37.tar.gz llvm-bc53ca1b530aa57280c7a373ea518278abb6ae37.tar.bz2 llvm-bc53ca1b530aa57280c7a373ea518278abb6ae37.tar.xz |
Fix a regression from r125393;
It caused a crash in MultiSource/Benchmarks/Bullet.
Opt hit an assertion with "opt -std-compile-opts" because
Constant::getAllOnesValue doesn't know how to handle floats.
This patch added a test to reproduce the problem and a check that the
destination vector is of integer type.
Thank you Benjamin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/bitcast-vec-uniform.ll | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/bitcast-vec-uniform.ll b/test/Transforms/InstCombine/bitcast-vec-uniform.ll index 1fba163269..ef428894e7 100644 --- a/test/Transforms/InstCombine/bitcast-vec-uniform.ll +++ b/test/Transforms/InstCombine/bitcast-vec-uniform.ll @@ -1,14 +1,30 @@ -; RUN: opt < %s -instcombine -S | not grep bitcast +; RUN: opt < %s -instcombine -S | FileCheck %s +; CHECK: @a +; CHECK-NOT: bitcast +; CHECK: ret define <4 x i32> @a(<1 x i64> %y) { %c = bitcast <2 x i64> <i64 0, i64 0> to <4 x i32> ret <4 x i32> %c } +; CHECK: @b +; CHECK: bitcast +; CHECK: ret + define <4 x i32> @b(<1 x i64> %y) { %c = bitcast <2 x i64> <i64 -1, i64 -1> to <4 x i32> ret <4 x i32> %c } +; CHECK: @foo +; CHECK: bitcast + +; from MultiSource/Benchmarks/Bullet +define <2 x float> @foo() { + %cast = bitcast i64 -1 to <2 x float> + ret <2 x float> %cast +} + |