Skip to content

[lld][MachO] Test with exported_symbol and exported_symbols_list together #127243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

ellishg
Copy link
Contributor

@ellishg ellishg commented Feb 14, 2025

I've been investigating a bug involving -exported_symbol and I discovered that we have no test that uses both -exported_symbol and -exported_symbols_list together. Add this test to ensure they do not override each other now or in the future.

@llvmbot
Copy link
Member

llvmbot commented Feb 14, 2025

@llvm/pr-subscribers-lld

Author: Ellis Hoag (ellishg)

Changes

I've been investigating a bug involving -exported_symbol and I discovered that we have no test that uses both -exported_symbol and -exported_symbols_list together. Add this test to ensure they do not override each other now or in the future.


Full diff: https://github.com/llvm/llvm-project/pull/127243.diff

1 Files Affected:

  • (modified) lld/test/MachO/export-options.s (+6-2)
diff --git a/lld/test/MachO/export-options.s b/lld/test/MachO/export-options.s
index 1a5d409e83383..df2f90e3a4f3f 100644
--- a/lld/test/MachO/export-options.s
+++ b/lld/test/MachO/export-options.s
@@ -117,13 +117,15 @@
 ## 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.txt
+# RUN:     -exported_symbols_list %t/literals.txt \
+# RUN:     -exported_symbol singleton
 # RUN: llvm-objdump --macho --exports-trie %t/literal | \
 # RUN:     FileCheck --check-prefix=LITERAL %s
 
 # LITERAL-DAG: literal_only
 # LITERAL-DAG: literal_also
 # LITERAL-DAG: globby_also
+# LITERAL-DAG: singleton
 # LITERAL-NOT: globby_only
 
 ## Check that only glob patterns match
@@ -245,7 +247,7 @@ _keep_lazy:
 
 #--- symdefs.s
 
-.globl literal_only, literal_also, globby_only, globby_also
+.globl literal_only, literal_also, globby_only, globby_also, singleton
 literal_only:
   retq
 literal_also:
@@ -254,6 +256,8 @@ globby_only:
   retq
 globby_also:
   retq
+singleton:
+  retq
 
 #--- literals.txt
 

@llvmbot
Copy link
Member

llvmbot commented Feb 14, 2025

@llvm/pr-subscribers-lld-macho

Author: Ellis Hoag (ellishg)

Changes

I've been investigating a bug involving -exported_symbol and I discovered that we have no test that uses both -exported_symbol and -exported_symbols_list together. Add this test to ensure they do not override each other now or in the future.


Full diff: https://github.com/llvm/llvm-project/pull/127243.diff

1 Files Affected:

  • (modified) lld/test/MachO/export-options.s (+6-2)
diff --git a/lld/test/MachO/export-options.s b/lld/test/MachO/export-options.s
index 1a5d409e83383..df2f90e3a4f3f 100644
--- a/lld/test/MachO/export-options.s
+++ b/lld/test/MachO/export-options.s
@@ -117,13 +117,15 @@
 ## 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.txt
+# RUN:     -exported_symbols_list %t/literals.txt \
+# RUN:     -exported_symbol singleton
 # RUN: llvm-objdump --macho --exports-trie %t/literal | \
 # RUN:     FileCheck --check-prefix=LITERAL %s
 
 # LITERAL-DAG: literal_only
 # LITERAL-DAG: literal_also
 # LITERAL-DAG: globby_also
+# LITERAL-DAG: singleton
 # LITERAL-NOT: globby_only
 
 ## Check that only glob patterns match
@@ -245,7 +247,7 @@ _keep_lazy:
 
 #--- symdefs.s
 
-.globl literal_only, literal_also, globby_only, globby_also
+.globl literal_only, literal_also, globby_only, globby_also, singleton
 literal_only:
   retq
 literal_also:
@@ -254,6 +256,8 @@ globby_only:
   retq
 globby_also:
   retq
+singleton:
+  retq
 
 #--- literals.txt
 

@ellishg ellishg merged commit 270284d into llvm:main Feb 18, 2025
11 checks passed
@ellishg ellishg deleted the lld-test-exports branch February 18, 2025 16:33
wldfngrs pushed a commit to wldfngrs/llvm-project that referenced this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants