summaryrefslogtreecommitdiffstats
path: root/llvm/test/Linker/struct-mapping.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Linker/struct-mapping.ll')
-rw-r--r--llvm/test/Linker/struct-mapping.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Linker/struct-mapping.ll b/llvm/test/Linker/struct-mapping.ll
new file mode 100644
index 00000000000..732ef8c50cd
--- /dev/null
+++ b/llvm/test/Linker/struct-mapping.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-link --initial-module=%s %p/Inputs/struct-mapping.ll -S -o - | FileCheck %s
+
+; Here we check that new type mapping algorithm correctly mapped type of internal
+; member of struct.Baz to struct.Foo. Without it we'd map that type to struct.Bar, because
+; it is recursively isomorphic to struct.Foo and is defined first in source file.
+; CHECK: %struct.Baz = type { i64, i64, %struct.Foo }
+
+%struct.Bar = type { i64, i64 }
+%struct.Foo = type { i64, i64 }
+
+@bar = global %struct.Bar zeroinitializer
+@foo = global %struct.Foo zeroinitializer
OpenPOWER on IntegriCloud