summaryrefslogtreecommitdiff
path: root/test/Transforms/GlobalOpt/compiler-used.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-12-22 00:04:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-12-22 00:04:03 +0000
commitf8af5cf600354830d4ccf59732403f0f073eccb9 (patch)
tree2ba0398b4c42ad4f55561327538044fd2c925a8b /test/Transforms/GlobalOpt/compiler-used.ll
parent59d6cff90eecf31cb3dd860c4e786674cfdd42eb (diff)
Diffstat (limited to 'test/Transforms/GlobalOpt/compiler-used.ll')
-rw-r--r--test/Transforms/GlobalOpt/compiler-used.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/GlobalOpt/compiler-used.ll b/test/Transforms/GlobalOpt/compiler-used.ll
new file mode 100644
index 0000000000000..a710d272edc78
--- /dev/null
+++ b/test/Transforms/GlobalOpt/compiler-used.ll
@@ -0,0 +1,16 @@
+; 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