Skip to content

Commit 798f0e6

Browse files
authored
Merge pull request #77330 from drodriguez/swift-obj-root-strikes-back
[test] Fix incorrect usage of swift_obj_root in unified builds
2 parents e089c58 + 1e59037 commit 798f0e6

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

test/SILGen/magic_identifier_file_conflicting.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def fixit_loc(start_col, orig_suffix):
9292
//
9393

9494
// CHECK-LABEL: // Mappings from '#fileID' to '#filePath':
95-
// 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'
96-
// 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)
95+
// 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'
96+
// 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)
9797
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting.swift' => 'magic_identifier_file_conflicting.swift' (alternate)
9898
// CHECK-NEXT: // 'Foo/magic_identifier_file_conflicting_other.swift' => 'SOURCE_DIR{{[/\\]}}test{{[/\\]}}SILGen{{[/\\]}}Inputs{{[/\\]}}magic_identifier_file_conflicting_other.swift'
9999
// CHECK-NEXT: // 'Foo/other_file_a.swift' => 'other_file_a.swift'

test/lit.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,12 +2978,12 @@ run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitiz
29782978
shell_quote(sys.executable),
29792979
shell_quote(config.PathSanitizingFileCheck),
29802980
# LLVM Lit performs realpath with the config path, so all paths are relative
2981-
# to the real path. swift_obj_root and swift_src_root come from CMake, which
2981+
# to the real path. cmake_binary_dir and swift_src_root come from CMake, which
29822982
# might not do real path. Because we have to match what Lit uses against what
29832983
# we provide we use realpath here. Because PathSanitizingFileCheck only
29842984
# understands sanitize patterns with forward slashes, and realpath normalizes
29852985
# the slashes, we have to replace them back to forward slashes.
2986-
shell_quote(lit.util.abs_path_preserve_drive(swift_obj_root).replace("\\", "/")),
2986+
shell_quote(lit.util.abs_path_preserve_drive(config.cmake_binary_dir).replace("\\", "/")),
29872987
shell_quote(lit.util.abs_path_preserve_drive(config.swift_src_root).replace("\\", "/")),
29882988
shell_quote(config.filecheck),
29892989
'--color' if config.color_output else '',

test/lit.site.cfg.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import sys
1616
import lit.util
1717

1818
config.cmake = "@CMAKE_COMMAND@"
19+
config.cmake_binary_dir = "@CMAKE_BINARY_DIR@"
1920
config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@"
2021
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
2122
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"

validation-test/lit.site.cfg.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import sys
1414
import platform
1515

1616
config.cmake = "@CMAKE_COMMAND@"
17+
config.cmake_binary_dir = "@CMAKE_BINARY_DIR@"
1718
config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@"
1819
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
1920
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"

0 commit comments

Comments
 (0)