Skip to content

Conversation

@rupprecht
Copy link
Collaborator

The test added in #161067 writes artifacts to the current dir, i.e. test.o / test.dwo / test.dwp, which might not be writeable. Tests should use %t for test artifact location, i.e. %t.o / %t.dwo / %t.dwp However, since "test.dwo" is part of the assembly source file used as a test input, and that's not something lit will substitute, that typical approach doesn't work. We can instead ensure the output is in a good location by running cd %t (after setting it up).

@llvmbot
Copy link
Member

llvmbot commented Oct 28, 2025

@llvm/pr-subscribers-debuginfo

Author: Jordan Rupprecht (rupprecht)

Changes

The test added in #161067 writes artifacts to the current dir, i.e. test.o / test.dwo / test.dwp, which might not be writeable. Tests should use %t for test artifact location, i.e. %t.o / %t.dwo / %t.dwp However, since "test.dwo" is part of the assembly source file used as a test input, and that's not something lit will substitute, that typical approach doesn't work. We can instead ensure the output is in a good location by running cd %t (after setting it up).


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

1 Files Affected:

  • (modified) llvm/test/tools/llvm-dwarfdump/X86/type_units_split_dwp_v4.s (+6)
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/type_units_split_dwp_v4.s b/llvm/test/tools/llvm-dwarfdump/X86/type_units_split_dwp_v4.s
index becd9d1b55693..519edf043be5d 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/type_units_split_dwp_v4.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/type_units_split_dwp_v4.s
@@ -1,6 +1,12 @@
 ## This test uses TU index for type parsing in dwp and makes sure the DWARF4 type is
 ## successfully retrieved.
 
+## cd to a unique dir so we can refer to the file as just "test.dwo" in the
+## assembly test input below.
+# RUN: rm -rf %t
+# RUN: mkdir %t
+# RUN: cd %t
+
 # RUN: llvm-mc %s --split-dwarf-file=test.dwo -filetype obj -triple x86_64 -o test.o
 # RUN: llvm-dwp -e test.o -o test.dwp
 # RUN: llvm-dwarfdump test.dwp | FileCheck %s

@Sockke
Copy link
Contributor

Sockke commented Oct 28, 2025

Is this fix related to https://lab.llvm.org/buildbot/#/builders/65/builds/24607?

@rupprecht
Copy link
Collaborator Author

Is this fix related to https://lab.llvm.org/buildbot/#/builders/65/builds/24607?

No, that looks like a noisy test/buildbot to me.

This fix is for running this test when the current dir is not writeable.

Copy link
Contributor

@Sockke Sockke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the additional information.

@rupprecht rupprecht merged commit 29c830c into llvm:main Oct 28, 2025
11 of 12 checks passed
@rupprecht rupprecht deleted the test-dwp-dir branch October 28, 2025 13:50
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
The test added in llvm#161067 writes artifacts to the current dir, i.e.
`test.o` / `test.dwo` / `test.dwp`, which might not be writeable. Tests
should use `%t` for test artifact location, i.e. `%t.o` / `%t.dwo` /
`%t.dwp` However, since `"test.dwo"` is part of the assembly source file
used as a test input, and that's not something lit will substitute, that
typical approach doesn't work. We can instead ensure the output is in a
good location by running `cd %t` (after setting it up).
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
The test added in llvm#161067 writes artifacts to the current dir, i.e.
`test.o` / `test.dwo` / `test.dwp`, which might not be writeable. Tests
should use `%t` for test artifact location, i.e. `%t.o` / `%t.dwo` /
`%t.dwp` However, since `"test.dwo"` is part of the assembly source file
used as a test input, and that's not something lit will substitute, that
typical approach doesn't work. We can instead ensure the output is in a
good location by running `cd %t` (after setting it up).
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