summaryrefslogtreecommitdiff
path: root/test/core/archive-chain.objtxt
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/archive-chain.objtxt')
-rw-r--r--test/core/archive-chain.objtxt70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/core/archive-chain.objtxt b/test/core/archive-chain.objtxt
new file mode 100644
index 0000000000000..0f80985ec112a
--- /dev/null
+++ b/test/core/archive-chain.objtxt
@@ -0,0 +1,70 @@
+# RUN: lld -core %s | FileCheck %s
+
+#
+# Tests that an undefine in one archive can force a load from another archive.
+#
+
+--- !native
+defined-atoms:
+ - name: foo
+ type: code
+
+undefined-atoms:
+ - name: bar1
+
+--- !archive
+members:
+ - name: bar1.o
+ content: !native
+ defined-atoms:
+ - name: bar1
+ scope: global
+ type: code
+
+ - name: bar1b
+ type: code
+
+ undefined-atoms:
+ - name: baz1
+
+ - name: bar2.o
+ content: !native
+ defined-atoms:
+ - name: bar2
+ scope: global
+ type: code
+
+ - name: bar2b
+ type: code
+
+--- !archive
+members:
+ - name: baz1.o
+ content: !native
+ defined-atoms:
+ - name: baz1
+ scope: global
+ type: code
+
+ - name: baz1b
+ type: code
+
+ - name: baz2.o
+ content: !native
+ defined-atoms:
+ - name: baz2
+ scope: global
+ type: code
+
+ - name: baz2b
+ type: code
+...
+
+# CHECK: name: foo
+# CHECK: name: bar1
+# CHECK: name: bar1b
+# CHECK-NOT: name: bar2
+# CHECK: name: baz1
+# CHECK: name: baz1b
+# CHECK-NOT: name: baz2
+# CHECK: ...