Skip to content

Commit d1c3e7b

Browse files
committed
Interop: use new target-clangxx for building C++ code
This enables control over the C++ flags used during testing for the C++ interop from a single location rather than having to alter all the tests.
1 parent 99ac668 commit d1c3e7b

11 files changed

+11
-10
lines changed

test/Interop/Cxx/extern-var/extern-var.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -c %S/Inputs/extern-var.cpp -I %S/Inputs -o %t/extern-var.o
2+
// RUN: %target-clangxx -c %S/Inputs/extern-var.cpp -I %S/Inputs -o %t/extern-var.o
33
// RUN: %target-build-swift %s -I %S/Inputs -o %t/extern-var %t/extern-var.o -Xfrontend -enable-cxx-interop
44
// RUN: %target-codesign %t/extern-var
55
// RUN: %target-run %t/extern-var

test/Interop/Cxx/operators/member-out-of-line.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -std=c++11 -c %S/Inputs/member-out-of-line.cpp -I %S/Inputs -o %t/member-out-of-line.o
2+
// RUN: %target-clangxx -c %S/Inputs/member-out-of-line.cpp -I %S/Inputs -o %t/member-out-of-line.o
33
// RUN: %target-build-swift %s -I %S/Inputs -o %t/member-out-of-line %t/member-out-of-line.o -Xfrontend -enable-cxx-interop
44
// RUN: %target-codesign %t/member-out-of-line
55
// RUN: %target-run %t/member-out-of-line

test/Interop/Cxx/operators/non-member-out-of-line.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -std=c++11 -c %S/Inputs/non-member-out-of-line.cpp -I %S/Inputs -o %t/non-member-out-of-line.o
2+
// RUN: %target-clangxx -c %S/Inputs/non-member-out-of-line.cpp -I %S/Inputs -o %t/non-member-out-of-line.o
33
// RUN: %target-build-swift %s -I %S/Inputs -o %t/non-member-out-of-line %t/non-member-out-of-line.o -Xfrontend -enable-cxx-interop
44
// RUN: %target-codesign %t/non-member-out-of-line
55
// RUN: %target-run %t/non-member-out-of-line

test/Interop/Cxx/reference/reference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -std=c++11 -c %S/Inputs/reference.cpp -I %S/Inputs -o %t/reference.o
2+
// RUN: %target-clangxx -c %S/Inputs/reference.cpp -I %S/Inputs -o %t/reference.o
33
// RUN: %target-build-swift %s -I %S/Inputs -o %t/reference %t/reference.o -Xfrontend -enable-cxx-interop
44
// RUN: %target-codesign %t/reference
55
// RUN: %target-run %t/reference

test/Interop/Cxx/static/constexpr-static-member-var.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -std=c++11 -c %S/Inputs/static-member-var.cpp -I %S/Inputs -o %t/static-member-var.o
2+
// RUN: %target-clangxx -c %S/Inputs/static-member-var.cpp -I %S/Inputs -o %t/static-member-var.o
33
// NOTE: we must use `-O` here to ensure that the constexpr value is inlined and no undefined reference remains.
44
// RUN: %target-build-swift -O %s -I %S/Inputs -o %t/statics %t/static-member-var.o -Xfrontend -enable-cxx-interop
55
// RUN: %target-codesign %t/statics

test/Interop/Cxx/static/inline-static-member-var.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -c %S/Inputs/inline-static-member-var.cpp -I %S/Inputs -o %t/inline-static-member-var.o
2+
// RUN: %target-clangxx -c %S/Inputs/inline-static-member-var.cpp -I %S/Inputs -o %t/inline-static-member-var.o
33
// RUN: %target-build-swift %s -I %S/Inputs -o %t/statics %t/inline-static-member-var.o -Xfrontend -enable-cxx-interop
44
// RUN: %target-codesign %t/statics
55
// RUN: %target-run %t/statics 2&>1

test/Interop/Cxx/static/static-local-var.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -c %S/Inputs/static-local-var.cpp -I %S/Inputs -o %t/static-local-var.o
2+
// RUN: %target-clangxx -c %S/Inputs/static-local-var.cpp -I %S/Inputs -o %t/static-local-var.o
33
// RUN: %target-build-swift %s -I %S/Inputs -o %t/statics %t/static-local-var.o -Xfrontend -enable-cxx-interop
44
// RUN: %target-codesign %t/statics
55
// RUN: %target-run %t/statics

test/Interop/Cxx/static/static-member-func.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -c %S/Inputs/static-member-func.cpp -I %S/Inputs -o %t/static-member-func.o
2+
// RUN: %target-clangxx -c %S/Inputs/static-member-func.cpp -I %S/Inputs -o %t/static-member-func.o
33
// RUN: %target-build-swift %s -I %S/Inputs -o %t/statics %t/static-member-func.o -Xfrontend -enable-cxx-interop
44
// RUN: %target-codesign %t/statics
55
// RUN: %target-run %t/statics

test/Interop/Cxx/static/static-member-var.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -std=c++11 -c %S/Inputs/static-member-var.cpp -I %S/Inputs -o %t/static-member-var.o
2+
// RUN: %target-clangxx -c %S/Inputs/static-member-var.cpp -I %S/Inputs -o %t/static-member-var.o
33
// RUN: %target-build-swift %s -I %S/Inputs -o %t/statics %t/static-member-var.o -Xfrontend -enable-cxx-interop
44
// RUN: %target-codesign %t/statics
55
// RUN: %target-run %t/statics

test/Interop/Cxx/static/static-var.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-clang -c %S/Inputs/static-var.cpp -I %S/Inputs -o %t/static-var.o
2+
// RUN: %target-clangxx -c %S/Inputs/static-var.cpp -I %S/Inputs -o %t/static-var.o
33
// RUN: %target-build-swift %s -I %S/Inputs -o %t/statics %t/static-var.o -Xfrontend -enable-cxx-interop
44
// RUN: %target-codesign %t/statics
55
// RUN: %target-run %t/statics

test/lit.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,6 +1942,7 @@ config.substitutions.append(('%target-jit-run', subst_target_jit_run))
19421942
config.substitutions.append(('%target-build-swift-dylib\(([^)]+)\)', config.target_build_swift_dylib))
19431943
config.substitutions.append(('%target-codesign', config.target_codesign))
19441944
config.substitutions.append(('%target-build-swift', config.target_build_swift))
1945+
config.substitutions.append(('%target-clangxx', '%s -std=c++11' % config.target_clang))
19451946
config.substitutions.append(('%target-clang', config.target_clang))
19461947
config.substitutions.append(('%target-ld', config.target_ld))
19471948
if hasattr(config, 'target_cc_options'):

0 commit comments

Comments
 (0)