Skip to content

Commit 8e19f3f

Browse files
authored
[cxx-interop] Enable -verify-additional-file tests on Windows (#80694)
These previously failed because they used '/' as the path separator instead of '\'. While both are accepted on Windows, the latter is preferred and used to construct new paths, such as the path of imported header files. This inconsistency led to distinct buffer ID numbers being created (since paths are not canonicalized in BufferIdentIDMap), leading -verify to fail to associate the error emitted from the included file with the error expected in the -verify-additional-file file. This patch re-enables these tests but uses %{fs-sep} in place of '/', to ensure the appropriate path separator is used for the platform where the test is run. rdar://148928101
1 parent 82729df commit 8e19f3f

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

test/Interop/Cxx/class/access/private-fileid-diagnostics.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// RUN: split-file %s %t
2-
// RUN: %target-swift-frontend -typecheck -verify -suppress-remarks %t/some/subdir/file1.swift -verify-additional-file %t/Cxx/include/cxx-header.h -I %t/Cxx/include -cxx-interoperability-mode=default -module-name main
3-
4-
// This test uses -verify-additional-file, which do not work well on Windows:
5-
// UNSUPPORTED: OS=windows-msvc
2+
// RUN: %target-swift-frontend -typecheck -verify -suppress-remarks %t%{fs-sep}some%{fs-sep}subdir%{fs-sep}file1.swift -verify-additional-file %t%{fs-sep}Cxx%{fs-sep}include%{fs-sep}cxx-header.h -I %t%{fs-sep}Cxx%{fs-sep}include -cxx-interoperability-mode=default -module-name main
63

74
//--- Cxx/include/module.modulemap
85
module CxxModule {

test/Interop/Cxx/class/mutability-annotations-typechecker.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %S/Inputs %s -enable-experimental-cxx-interop -verify -verify-additional-file %S/Inputs/mutability-annotations.h
2-
3-
// REQUIRES: rdar100876534
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %S%{fs-sep}Inputs %s -enable-experimental-cxx-interop -verify -verify-additional-file %S%{fs-sep}Inputs%{fs-sep}mutability-annotations.h
42

53
import MutabilityAnnotations
64

test/Interop/Cxx/foreign-reference/inheritance-diagnostics.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// RUN: rm -rf %t
2-
// RUN: %target-swift-frontend -typecheck -verify -I %S/Inputs %s -cxx-interoperability-mode=upcoming-swift -verify-additional-file %S/Inputs/inheritance.h -Xcc -Wno-return-type -Xcc -Wno-inaccessible-base
3-
4-
// TODO: Fix this lit test failure on windows rdar://145218056
5-
// XFAIL: OS=windows-msvc
2+
// RUN: %target-swift-frontend -typecheck -verify -I %S%{fs-sep}Inputs %s -cxx-interoperability-mode=upcoming-swift -verify-additional-file %S%{fs-sep}Inputs%{fs-sep}inheritance.h -Xcc -Wno-return-type -Xcc -Wno-inaccessible-base
63

74
import Inheritance
85

0 commit comments

Comments
 (0)