mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
1d9b973fd7
to null. Patch by Matti Niemenmaa. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104871 91177308-0d34-0410-b5e6-96231b3b80d8
26 lines
555 B
LLVM
26 lines
555 B
LLVM
; RUN: opt < %s -instcombine -S | FileCheck %s
|
|
; PR1201
|
|
define i32 @main(i32 %argc, i8** %argv) {
|
|
%c_19 = alloca i8*
|
|
%malloc_206 = malloc i8, i32 10
|
|
; CHECK-NOT: malloc
|
|
store i8* %malloc_206, i8** %c_19
|
|
%tmp_207 = load i8** %c_19
|
|
free i8* %tmp_207
|
|
; CHECK-NOT: free
|
|
ret i32 0
|
|
; CHECK: ret i32 0
|
|
}
|
|
|
|
declare i8* @malloc(i32)
|
|
declare void @free(i8*)
|
|
|
|
define i1 @foo() {
|
|
; CHECK: @foo
|
|
; CHECK-NEXT: ret i1 false
|
|
%m = call i8* @malloc(i32 1)
|
|
%z = icmp eq i8* %m, null
|
|
call void @free(i8* %m)
|
|
ret i1 %z
|
|
}
|