summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/test/mach-o/function-scope.yaml44
-rw-r--r--lld/test/mach-o/lit.cfg17
2 files changed, 61 insertions, 0 deletions
diff --git a/lld/test/mach-o/function-scope.yaml b/lld/test/mach-o/function-scope.yaml
new file mode 100644
index 00000000000..966d8644375
--- /dev/null
+++ b/lld/test/mach-o/function-scope.yaml
@@ -0,0 +1,44 @@
+# RUN: lld -flavor darwin -arch x86_64 -r -print_atoms %s -o %t | FileCheck %s
+#
+# Test parsing of scope of functions.
+#
+
+--- !mach-o
+arch: x86_64
+file-type: MH_OBJECT
+flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
+has-UUID: false
+OS: unknown
+sections:
+ - segment: __TEXT
+ section: __text
+ type: S_REGULAR
+ attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
+ alignment: 4
+ address: 0x0000000000000000
+ content: [ 0xC3, 0xC3, 0xC3 ]
+local-symbols:
+ - name: _myStatic
+ type: N_SECT
+ sect: 1
+ value: 0x0000000000000002
+global-symbols:
+ - name: _myGlobal
+ type: N_SECT
+ scope: [ N_EXT ]
+ sect: 1
+ value: 0x0000000000000000
+ - name: _myHidden
+ type: N_SECT
+ scope: [ N_EXT, N_PEXT ]
+ sect: 1
+ value: 0x0000000000000001
+...
+
+# CHECK: name: _myGlobal
+# CHECK: scope: global
+# CHECK: name: _myHidden
+# CHECK: scope: hidden
+# CHECK: name: _myStatic
+# CHECK-NOT: scope: global
+# CHECK-NOT: scope: hidden
diff --git a/lld/test/mach-o/lit.cfg b/lld/test/mach-o/lit.cfg
new file mode 100644
index 00000000000..a4b3f1e5765
--- /dev/null
+++ b/lld/test/mach-o/lit.cfg
@@ -0,0 +1,17 @@
+# -*- Python -*-
+
+import os
+import platform
+import re
+import subprocess
+
+import lit.formats
+import lit.util
+
+# Configuration file for the 'lit' test runner.
+
+config.name = 'lld'
+
+# suffixes: A list of file extensions to treat as test files.
+# Do NOT list .yaml in this directory because these are pure input files.
+config.suffixes = ['.yaml']
OpenPOWER on IntegriCloud