[PATCH] D101222: [lld/mac] simplify export-options.s test a bit

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 23 19:41:35 PDT 2021


thakis created this revision.
thakis added a reviewer: lld-macho.
Herald added a project: lld-macho.
thakis requested review of this revision.

- the macro seems needlessly clever -- shorter and imho clearer without it
- give all filenames an extension so they look like filenames

No behavior change.


https://reviews.llvm.org/D101222

Files:
  lld/test/MachO/export-options.s


Index: lld/test/MachO/export-options.s
===================================================================
--- lld/test/MachO/export-options.s
+++ lld/test/MachO/export-options.s
@@ -30,15 +30,14 @@
 
 #--- default.s
 
-.macro DEFSYM, type, sym
-\type \sym
-\sym:
+.globl _keep_globl, _hide_globl
+_keep_globl:
+  retq
+_hide_globl:
+  retq
+.private_extern _private
+_private:
   retq
-.endm
-
-DEFSYM .globl, _keep_globl
-DEFSYM .globl, _hide_globl
-DEFSYM .private_extern, _private
 
 ## Check that the export trie is unaltered
 # RUN: %lld -dylib %t/default.o -o %t/default
@@ -83,18 +82,17 @@
 
 #--- symdefs.s
 
-.macro DEFSYM, sym
-.globl \sym
-\sym:
+.globl literal_only, literal_also, globby_only, globby_also
+literal_only:
+  retq
+literal_also:
+  retq
+globby_only:
+  retq
+globby_also:
   retq
-.endm
-
-DEFSYM literal_only
-DEFSYM literal_also
-DEFSYM globby_only
-DEFSYM globby_also
 
-#--- literals
+#--- literals.txt
 
   literal_only # comment
   literal_also
@@ -105,7 +103,7 @@
 ## Check that only string-literal patterns match
 ## Check that comments and blank lines are stripped from symbol list
 # RUN: %lld -dylib %t/symdefs.o -o %t/literal \
-# RUN:     -exported_symbols_list %t/literals
+# RUN:     -exported_symbols_list %t/literals.txt
 # RUN: llvm-objdump --macho --exports-trie %t/literal | \
 # RUN:     FileCheck --check-prefix=LITERAL %s
 
@@ -114,7 +112,7 @@
 # LITERAL-DAG: globby_also
 # LITERAL-NOT: globby_only
 
-#--- globbys
+#--- globbys.txt
 
 # literal_only
   l?ter[aeiou]l_*[^y] # comment
@@ -124,7 +122,7 @@
 ## Check that only glob patterns match
 ## Check that comments and blank lines are stripped from symbol list
 # RUN: %lld -dylib %t/symdefs.o -o %t/globby \
-# RUN:     -exported_symbols_list %t/globbys
+# RUN:     -exported_symbols_list %t/globbys.txt
 # RUN: llvm-objdump --macho --exports-trie %t/globby | \
 # RUN:     FileCheck --check-prefix=GLOBBY %s
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101222.340227.patch
Type: text/x-patch
Size: 1918 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210424/b9bdf786/attachment.bin>


More information about the llvm-commits mailing list