Skip to content

[lld][test] Removed curly braces from test to work with lit internal shell #105137

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

Closed
wants to merge 1 commit into from

Conversation

connieyzhu
Copy link
Contributor

This patch rewrites a test to no longer use curly braces, as curly brace syntax is not currently supported by llvm-lit's internal shell implementation.

Fixes #102382.

shell

This patches rewrites a test to no longer use curly braces, as curly
brace syntax is not currently supported by llvm-lit's internal shell
implementation.
@llvmbot
Copy link
Member

llvmbot commented Aug 20, 2024

@llvm/pr-subscribers-lld

@llvm/pr-subscribers-lld-elf

Author: Connie Zhu (connieyzhu)

Changes

This patch rewrites a test to no longer use curly braces, as curly brace syntax is not currently supported by llvm-lit's internal shell implementation.

Fixes #102382.


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

1 Files Affected:

  • (modified) lld/test/ELF/error-handling-script-linux.test (+3-1)
diff --git a/lld/test/ELF/error-handling-script-linux.test b/lld/test/ELF/error-handling-script-linux.test
index 54e1b29ab236a6..c5c7b31ec04043 100755
--- a/lld/test/ELF/error-handling-script-linux.test
+++ b/lld/test/ELF/error-handling-script-linux.test
@@ -18,7 +18,9 @@
 # RUN: not ld.lld -o /dev/null --no-demangle --error-handling-script=%s %t2.o 2>&1 |\
 # RUN:   FileCheck --check-prefix=CHECK-SYM-CXX-NO-DEMANGLE %s
 
-# RUN: { echo 'a_: ret'; echo 'bar: movl a(%rip), %eax' ; } | llvm-mc -filetype=obj -triple=x86_64 - -o %t3.o
+# RUN: echo 'a_: ret' > %t
+# RUN: echo 'bar: movl a(%rip), %eax' >> %t
+# RUN: cat %t | llvm-mc -filetype=obj -triple=x86_64 - -o %t3.o
 # RUN: not ld.lld -o /dev/null --error-handling-script=%s %t3.o 2>&1 |\
 # RUN:   FileCheck --check-prefix=CHECK-SYM-C-CORRECTION -DOBJ=%t3.o %s
 

@lenary
Copy link
Member

lenary commented Aug 20, 2024

Can we use split-file to make the test having several file inputs more obvious?

@connieyzhu
Copy link
Contributor Author

Can we use split-file to make the test having several file inputs more obvious?

@lenary If you check the last line of the file, there's an echo "script: info: called with $*" that is referenced in parts of this file. When I used split-file, I also put that echo command into its own file as well, and replaced the instances of %s that use this command with the temp file name. It seems like lit is not able to handle this command properly when I put it into another file though, and I'm getting an error message saying that the file failed to execute.

Do you happen to know a way to work around this? Let me know if you need more elaboration.

@connieyzhu
Copy link
Contributor Author

CC: @ilovepi @petrhosek @MaskRay

@ilovepi
Copy link
Contributor

ilovepi commented Aug 21, 2024

Does the error happen if you also ‘chmod +x’ the split out script?

@connieyzhu
Copy link
Contributor Author

Does the error happen if you also ‘chmod +x’ the split out script?

Yes, it does.

@MaskRay
Copy link
Member

MaskRay commented Aug 21, 2024

Thanks for bringing this to my attention. This is a tricky one that might be unclear for casual contributors to lld/test/. I cleaned up the test in 12d4c89 and fixed multiple convention issues.

@connieyzhu connieyzhu closed this Aug 21, 2024
@connieyzhu connieyzhu deleted the lld-curly-brace-test branch August 22, 2024 17:29
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.

[llvm-lit] lit internal shell failing to parse and execute curly brace syntax
5 participants