Skip to content

[test] Fix incorrect usage of swift_obj_root in unified builds #77330

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
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/SILGen/magic_identifier_file_conflicting.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def fixit_loc(start_col, orig_suffix):
//

// CHECK-LABEL: // Mappings from '#fileID' to '#filePath':
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'BUILD_DIR{{[/\\]}}test-{{[^/]+}}{{[/\\]}}SILGen{{[/\\]}}Output{{[/\\]}}magic_identifier_file_conflicting.swift.gyb.tmp{{[/\\]}}magic_identifier_file_conflicting.swift'
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'BUILD_DIR{{[/\\]}}test-{{[^/]+}}{{[/\\]}}SILGen{{[/\\]}}Output{{[/\\]}}magic_identifier_file_conflicting.swift.gyb.tmp{{[/\\]}}other_path_b{{[/\\]}}magic_identifier_file_conflicting.swift' (alternate)
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'BUILD_DIR{{.*}}{{[/\\]}}test-{{[^/]+}}{{[/\\]}}SILGen{{[/\\]}}Output{{[/\\]}}magic_identifier_file_conflicting.swift.gyb.tmp{{[/\\]}}magic_identifier_file_conflicting.swift'
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'BUILD_DIR{{.*}}{{[/\\]}}test-{{[^/]+}}{{[/\\]}}SILGen{{[/\\]}}Output{{[/\\]}}magic_identifier_file_conflicting.swift.gyb.tmp{{[/\\]}}other_path_b{{[/\\]}}magic_identifier_file_conflicting.swift' (alternate)
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'magic_identifier_file_conflicting.swift' (alternate)
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting_other.swift' => 'SOURCE_DIR{{[/\\]}}test{{[/\\]}}SILGen{{[/\\]}}Inputs{{[/\\]}}magic_identifier_file_conflicting_other.swift'
// CHECK-NEXT: // 'Foo/other_file_a.swift' => 'other_file_a.swift'
Expand Down
4 changes: 2 additions & 2 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2978,12 +2978,12 @@ run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitiz
shell_quote(sys.executable),
shell_quote(config.PathSanitizingFileCheck),
# LLVM Lit performs realpath with the config path, so all paths are relative
# to the real path. swift_obj_root and swift_src_root come from CMake, which
# to the real path. cmake_binary_dir and swift_src_root come from CMake, which
# might not do real path. Because we have to match what Lit uses against what
# we provide we use realpath here. Because PathSanitizingFileCheck only
# understands sanitize patterns with forward slashes, and realpath normalizes
# the slashes, we have to replace them back to forward slashes.
shell_quote(lit.util.abs_path_preserve_drive(swift_obj_root).replace("\\", "/")),
shell_quote(lit.util.abs_path_preserve_drive(config.cmake_binary_dir).replace("\\", "/")),
shell_quote(lit.util.abs_path_preserve_drive(config.swift_src_root).replace("\\", "/")),
shell_quote(config.filecheck),
'--color' if config.color_output else '',
Expand Down
1 change: 1 addition & 0 deletions test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import sys
import lit.util

config.cmake = "@CMAKE_COMMAND@"
config.cmake_binary_dir = "@CMAKE_BINARY_DIR@"
config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
Expand Down
1 change: 1 addition & 0 deletions validation-test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import sys
import platform

config.cmake = "@CMAKE_COMMAND@"
config.cmake_binary_dir = "@CMAKE_BINARY_DIR@"
config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
Expand Down