From c61674553bd6c263f0681df4d488b34836b8e82f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 28 Nov 2014 15:45:31 +0000 Subject: [PATCH] Add a testcase reduced from clang lto bootstrap on OS X. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222921 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Linker/Inputs/opaque.ll | 13 +++++++++++++ test/Linker/opaque.ll | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/Linker/Inputs/opaque.ll create mode 100644 test/Linker/opaque.ll diff --git a/test/Linker/Inputs/opaque.ll b/test/Linker/Inputs/opaque.ll new file mode 100644 index 00000000000..2b0d7d3cea8 --- /dev/null +++ b/test/Linker/Inputs/opaque.ll @@ -0,0 +1,13 @@ +%A = type { } +%B = type { %D, %E, %B* } + +%D = type { %E } +%E = type opaque + +@g2 = external global %A +@g3 = external global %B + +define void @f1() { + getelementptr %A* null, i32 0 + ret void +} diff --git a/test/Linker/opaque.ll b/test/Linker/opaque.ll new file mode 100644 index 00000000000..1ba878c6a36 --- /dev/null +++ b/test/Linker/opaque.ll @@ -0,0 +1,21 @@ +; RUN: llvm-link %p/opaque.ll %p/Inputs/opaque.ll -S -o - | FileCheck %s + +; CHECK-DAG: %A = type {} +; CHECK-DAG: %B = type { %C, %C, %B* } +; CHECK-DAG: %B.1 = type { %D, %E, %B.1* } +; CHECK-DAG: %C = type { %A } +; CHECK-DAG: %D = type { %E } +; CHECK-DAG: %E = type opaque + +; CHECK-DAG: @g1 = external global %B +; CHECK-DAG: @g2 = external global %A +; CHECK-DAG: @g3 = external global %B.1 + +; CHECK-DAG: getelementptr %A* null, i32 0 + +%A = type opaque +%B = type { %C, %C, %B* } + +%C = type { %A } + +@g1 = external global %B