diff options
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Linker/Inputs/struct-mapping.ll | 4 | ||||
| -rw-r--r-- | llvm/test/Linker/struct-mapping.ll | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Linker/Inputs/struct-mapping.ll b/llvm/test/Linker/Inputs/struct-mapping.ll new file mode 100644 index 00000000000..d4fa07313c6 --- /dev/null +++ b/llvm/test/Linker/Inputs/struct-mapping.ll @@ -0,0 +1,4 @@ +%struct.Baz = type { i64, i64, %struct.Foo }
+%struct.Foo = type { i64, i64 }
+
+@baz = global %struct.Baz zeroinitializer
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
|

