Files
llvm-6502/test/Transforms/GlobalOpt/cleanup-pointer-root-users.ll
Nick Lewycky 39e357fafe Don't wipe out global variables that are probably storing pointers to heap
memory. This makes clang play nice with leak checkers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160529 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 22:35:28 +00:00

21 lines
345 B
LLVM

; RUN: opt -globalopt -S -o - < %s | FileCheck %s
@test1 = internal global i8* null
define void @test1a() {
; CHECK: @test1a
; CHECK-NOT: store
; CHECK-NEXT: ret void
store i8* null, i8** @test1
ret void
}
define void @test1b(i8* %p) {
; CHECK: @test1b
; CHECK-NEXT: store
; CHECK-NEXT: ret void
store i8* %p, i8** @test1
ret void
}