summaryrefslogtreecommitdiff
path: root/test/core/gnulinkonce-simple.objtxt
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/gnulinkonce-simple.objtxt')
-rw-r--r--test/core/gnulinkonce-simple.objtxt80
1 files changed, 80 insertions, 0 deletions
diff --git a/test/core/gnulinkonce-simple.objtxt b/test/core/gnulinkonce-simple.objtxt
new file mode 100644
index 0000000000000..da325d48c3669
--- /dev/null
+++ b/test/core/gnulinkonce-simple.objtxt
@@ -0,0 +1,80 @@
+# RUN: lld -core %s | FileCheck %s
+
+#
+# Test that gnu linkonce sections are parsed properly when there is a reference to a
+# atom from outside the gnu linkonce section.
+#
+
+---
+defined-atoms:
+ - name: f1
+ scope: global
+ type: code
+ references:
+ - kind: layout-after
+ target: anotherfunction
+ - name: f2
+ scope: global
+ type: code
+ - name: g1
+ scope: global
+ type: code
+ - name: d1
+ scope: global
+ type: data
+ - name: g1
+ scope: global
+ type: gnu-linkonce
+ references:
+ - kind: group-child
+ target: f1
+ - kind: group-child
+ target: f2
+ - kind: group-child
+ target: d1
+ - kind: group-child
+ target: g1
+ - name: anotherfunction
+ scope: global
+ type: data
+---
+undefined-atoms:
+ - name: f1
+ can-be-null: never
+...
+
+#CHECK: defined-atoms:
+#CHECK: - name: g1
+#CHECK: ref-name: [[PARENT:[a-zA-Z\.0-9_]+]]
+#CHECK: scope: global
+#CHECK: type: gnu-linkonce
+#CHECK: references:
+#CHECK: - kind: group-child
+#CHECK: offset: 0
+#CHECK: target: f1
+#CHECK: - kind: group-child
+#CHECK: offset: 0
+#CHECK: target: f2
+#CHECK: - kind: group-child
+#CHECK: offset: 0
+#CHECK: target: d1
+#CHECK: - kind: group-child
+#CHECK: offset: 0
+#CHECK: target: [[GCHILD:[a-zA-Z\.0-9_]+]]
+#CHECK: - name: f1
+#CHECK: scope: global
+#CHECK: references:
+#CHECK: - kind: layout-after
+#CHECK: offset: 0
+#CHECK: target: anotherfunction
+#CHECK: - name: f2
+#CHECK: scope: global
+#CHECK: - name: d1
+#CHECK: scope: global
+#CHECK: type: data
+#CHECK: - name: g1
+#CHECK: ref-name: [[GCHILD]]
+#CHECK: scope: global
+#CHECK: - name: anotherfunction
+#CHECK: scope: global
+#CHECK: type: data