xref: /llvm-project/llvm/test/Transforms/GlobalOpt/compiler-used.ll (revision d586bd5ca231a6022f439d4c6e43cfeeb53eb1d6)
1; RUN: opt < %s -passes=globalopt -S | FileCheck %s
2
3; Test that when all members of llvm.compiler.used are found to be redundant
4; we delete it instead of crashing.
5
6define void @foo() {
7  ret void
8}
9
10@llvm.used = appending global [1 x ptr] [ptr @foo], section "llvm.metadata"
11
12@llvm.compiler.used = appending global [1 x ptr] [ptr @foo], section "llvm.metadata"
13
14; CHECK-NOT: @llvm.compiler.used
15; CHECK: @llvm.used = appending global [1 x ptr] [ptr @foo], section "llvm.metadata"
16; CHECK-NOT: @llvm.compiler.used
17