diff options
Diffstat (limited to 'llvm/test/Regression/Transforms/InstCombine/cast-malloc.ll')
-rw-r--r-- | llvm/test/Regression/Transforms/InstCombine/cast-malloc.ll | 8 |
1 files changed, 8 insertions, 0 deletions
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 00000000000..25eb4367c69 --- /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 +} |