1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/test/Transforms/InstCombine/malloc-free-delete.ll
Victor Hernandez e8998896f5 Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.

llvm-svn: 84987
2009-10-24 04:23:03 +00:00

14 lines
445 B
LLVM

; RUN: opt < %s -instcombine -globaldce -S | FileCheck %s
; PR1201
define i32 @main(i32 %argc, i8** %argv) {
%c_19 = alloca i8* ; <i8**> [#uses=2]
%malloc_206 = malloc i8, i32 10 ; <i8*> [#uses=1]
; CHECK-NOT: malloc
store i8* %malloc_206, i8** %c_19
%tmp_207 = load i8** %c_19 ; <i8*> [#uses=1]
free i8* %tmp_207
; CHECK-NOT: free
ret i32 0
; CHECK: ret i32 0
}