1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/test/Transforms/GlobalOpt/compiler-used.ll
Rafael Espindola b64a8ded32 Don't crash when llvm.compiler.used becomes empty.
GlobalOpt simplifies llvm.compiler.used by removing any members that are also
in the more strict llvm.used. Handle the special case where llvm.compiler.used
becomes empty.

llvm-svn: 186778
2013-07-20 23:33:15 +00:00

17 lines
587 B
LLVM

; RUN: opt < %s -globalopt -S | FileCheck %s
; Test that when all members of llvm.compiler.used are found to be redundant
; we delete it instead of crashing.
define void @foo() {
ret void
}
@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata"
; CHECK-NOT: @llvm.compiler.used
; CHECK: @llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata"
; CHECK-NOT: @llvm.compiler.used