From 68910509fdd638727ce2f244ab7c0e4346671de1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 20 Dec 2011 00:03:52 +0000 Subject: fix PR11464 by preventing the linker from mapping two different struct types from the source module onto the same opaque destination type. An opaque type can only be resolved to one thing or another after all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146929 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Linker/multiple-merged-structs.ll | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/Linker/multiple-merged-structs.ll (limited to 'test/Linker') diff --git a/test/Linker/multiple-merged-structs.ll b/test/Linker/multiple-merged-structs.ll new file mode 100644 index 0000000..348cd89 --- /dev/null +++ b/test/Linker/multiple-merged-structs.ll @@ -0,0 +1,19 @@ +; RUN: echo {%bug_type = type opaque \ +; RUN: declare i32 @bug_a(%bug_type*) \ +; RUN: declare i32 @bug_b(%bug_type*) } > %t.ll +; RUN: llvm-link %t.ll %s +; PR11464 + +%bug_type = type { %bug_type* } +%bar = type { i32 } + +define i32 @bug_a(%bug_type* %fp) nounwind uwtable { +entry: + %d_stream = getelementptr inbounds %bug_type* %fp, i64 0, i32 0 + ret i32 0 +} + +define i32 @bug_b(%bar* %a) nounwind uwtable { +entry: + ret i32 0 +} -- cgit v1.1