For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.
llvm-svn: 31931
diff --git a/llvm/test/Regression/Transforms/InstCombine/cast-malloc.ll b/llvm/test/Regression/Transforms/InstCombine/cast-malloc.ll
new file mode 100644
index 0000000..25eb436
--- /dev/null
+++ b/llvm/test/Regression/Transforms/InstCombine/cast-malloc.ll
@@ -0,0 +1,8 @@
+; test that casted mallocs get converted to malloc of the right type
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast
+
+int* %test(uint %size) {
+ %X = malloc long, uint %size
+ %ret = bitcast long* %X to int*
+ ret int* %ret
+}