[lld] r208814 - [mach-o] Add test case for parsing nlist -> Scope

Nick Kledzik kledzik at apple.com
Wed May 14 14:37:14 PDT 2014


Author: kledzik
Date: Wed May 14 16:37:14 2014
New Revision: 208814

URL: http://llvm.org/viewvc/llvm-project?rev=208814&view=rev
Log:
[mach-o] Add test case for parsing nlist -> Scope

Added:
    lld/trunk/test/mach-o/
    lld/trunk/test/mach-o/function-scope.yaml
    lld/trunk/test/mach-o/lit.cfg

Added: lld/trunk/test/mach-o/function-scope.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/mach-o/function-scope.yaml?rev=208814&view=auto
==============================================================================
--- lld/trunk/test/mach-o/function-scope.yaml (added)
+++ lld/trunk/test/mach-o/function-scope.yaml Wed May 14 16:37:14 2014
@@ -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

Added: lld/trunk/test/mach-o/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/mach-o/lit.cfg?rev=208814&view=auto
==============================================================================
--- lld/trunk/test/mach-o/lit.cfg (added)
+++ lld/trunk/test/mach-o/lit.cfg Wed May 14 16:37:14 2014
@@ -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']  





More information about the llvm-commits mailing list