From 3f85d24df431d29743366f365c444934b3fe391f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 29 Nov 2015 15:52:12 +0000 Subject: Add a passing test. When a comdat is discarded, any globals defined in it become undefined. llvm-svn: 254258 --- llvm/test/tools/gold/X86/Inputs/comdat2.ll | 9 +++++++++ llvm/test/tools/gold/X86/comdat2.ll | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 llvm/test/tools/gold/X86/Inputs/comdat2.ll create mode 100644 llvm/test/tools/gold/X86/comdat2.ll (limited to 'llvm/test/tools') diff --git a/llvm/test/tools/gold/X86/Inputs/comdat2.ll b/llvm/test/tools/gold/X86/Inputs/comdat2.ll new file mode 100644 index 00000000000..5b7f74cf0b2 --- /dev/null +++ b/llvm/test/tools/gold/X86/Inputs/comdat2.ll @@ -0,0 +1,9 @@ +$foo = comdat any +@foo = global i8 1, comdat +define void @zed() { + call void @bar() + ret void +} +define void @bar() comdat($foo) { + ret void +} diff --git a/llvm/test/tools/gold/X86/comdat2.ll b/llvm/test/tools/gold/X86/comdat2.ll new file mode 100644 index 00000000000..2156efd207b --- /dev/null +++ b/llvm/test/tools/gold/X86/comdat2.ll @@ -0,0 +1,19 @@ +; RUN: llvm-as %s -o %t.bc +; RUN: llvm-as %p/Inputs/comdat2.ll -o %t2.bc +; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: --plugin-opt=emit-llvm \ +; RUN: -shared %t.bc %t2.bc -o %t3.bc +; RUN: llvm-dis %t3.bc -o - | FileCheck %s + + +$foo = comdat any +@foo = global i8 0, comdat + +; CHECK: @foo = global i8 0, comdat + +; CHECK: define void @zed() { +; CHECK: call void @bar() +; CHECK: ret void +; CHECK: } + +; CHECK: declare void @bar() -- cgit v1.2.3