Skip to content

Commit 1617e53

Browse files
authored
Merge pull request #37379 from compnerd/cxx-interop-5.4
Backport some fixes for C++ interop tests on 5.4
2 parents b19c4d0 + 255eac0 commit 1617e53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+125
-45
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -520,21 +520,44 @@ importer::getNormalInvocationArguments(
520520
invocationArgStrs.push_back(
521521
"-Werror=non-modular-include-in-framework-module");
522522

523+
bool EnableCXXInterop = LangOpts.EnableCXXInterop;
524+
523525
if (LangOpts.EnableObjCInterop) {
524-
bool EnableCXXInterop = LangOpts.EnableCXXInterop;
525-
invocationArgStrs.insert(
526-
invocationArgStrs.end(),
527-
{"-x", EnableCXXInterop ? "objective-c++" : "objective-c",
528-
EnableCXXInterop ? "-std=gnu++17" : "-std=gnu11", "-fobjc-arc"});
526+
invocationArgStrs.insert(invocationArgStrs.end(), {"-fobjc-arc"});
529527
// TODO: Investigate whether 7.0 is a suitable default version.
530528
if (!triple.isOSDarwin())
531529
invocationArgStrs.insert(invocationArgStrs.end(),
532530
{"-fobjc-runtime=ios-7.0"});
531+
invocationArgStrs.insert(invocationArgStrs.end(), {
532+
"-x", EnableCXXInterop ? "objective-c++" : "objective-c"
533+
});
533534
} else {
534-
bool EnableCXXInterop = LangOpts.EnableCXXInterop;
535-
invocationArgStrs.insert(invocationArgStrs.end(),
536-
{"-x", EnableCXXInterop ? "c++" : "c",
537-
EnableCXXInterop ? "-std=gnu++17" : "-std=gnu11"});
535+
invocationArgStrs.insert(invocationArgStrs.end(), {
536+
"-x", EnableCXXInterop ? "c++" : "c"
537+
});
538+
}
539+
540+
{
541+
const clang::LangStandard &stdcxx =
542+
#if defined(CLANG_DEFAULT_STD_CXX)
543+
*clang::LangStandard::getLangStandardForName(CLANG_DEFAULT_STD_CXX);
544+
#else
545+
clang::LangStandard::getLangStandardForKind(
546+
clang::LangStandard::lang_gnucxx14);
547+
#endif
548+
549+
const clang::LangStandard &stdc =
550+
#if defined(CLANG_DEFAULT_STD_C)
551+
*clang::LangStandard::getLangStandardForName(CLANG_DEFAULT_STD_C);
552+
#else
553+
clang::LangStandard::getLangStandardForKind(
554+
clang::LangStandard::lang_gnu11);
555+
#endif
556+
557+
invocationArgStrs.insert(invocationArgStrs.end(), {
558+
(Twine("-std=") + StringRef(EnableCXXInterop ? stdcxx.getName()
559+
: stdc.getName())).str()
560+
});
538561
}
539562

540563
// Set C language options.

test/ClangImporter/cxx_interop.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-swift-frontend -typecheck %s -I %S/Inputs/custom-modules -module-cache-path %t -enable-cxx-interop
2+
// RUN: %target-swiftxx-frontend -typecheck %s -I %S/Inputs/custom-modules
33

44
import CXXInterop
55

test/ClangImporter/cxx_interop_ir.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -module-name cxx_ir -I %S/Inputs/custom-modules -module-cache-path %t -enable-cxx-interop -emit-ir -o - -primary-file %s | %FileCheck %s
1+
// RUN: %target-swiftxx-frontend -module-name cxx_ir -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s | %FileCheck %s
22

33
import CXXInterop
44

test/ClangImporter/enum-cxx.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-ir -primary-file %s -I %S/Inputs/custom-modules -module-cache-path %t -enable-cxx-interop -o - | %FileCheck %s
1+
// RUN: %target-swiftxx-frontend -emit-ir -primary-file %s -I %S/Inputs/custom-modules -o - | %FileCheck %s
22

33
import CXXInterop
44

test/Interop/C/function/emit-called-inline-function-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// RUN: %empty-directory(%t)
88
// RUN: %target-swift-frontend %s -I %S/Inputs -Xcc -std=c99 -emit-ir -o - | %FileCheck %s -check-prefix C99 --implicit-check-not notCalled
9-
// RUN: %target-swift-frontend %s -I %S/Inputs -enable-cxx-interop -emit-ir -o - | %FileCheck %s -check-prefix CXX --implicit-check-not notCalled
9+
// RUN: %target-swiftxx-frontend %s -I %S/Inputs -emit-ir -o - | %FileCheck %s -check-prefix CXX --implicit-check-not notCalled
1010

1111
import EmitCalledInlineFunction
1212

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,59 @@
11
module AccessSpecifiers {
22
header "access-specifiers.h"
3+
requires cplusplus
34
}
45

56
module TypeClassification {
67
header "type-classification.h"
8+
requires cplusplus
79
}
810

911
module Constructors {
1012
header "constructors.h"
13+
requires cplusplus
1114
}
1215

1316
module ConstructorsObjC {
1417
header "constructors-objc.h"
18+
requires cplusplus
1519
}
1620

1721
module LoadableTypes {
1822
header "loadable-types.h"
23+
requires cplusplus
1924
}
2025

2126
module MemberwiseInitializer {
2227
header "memberwise-initializer.h"
28+
requires cplusplus
2329
}
2430

2531
module MemoryLayout {
2632
header "memory-layout.h"
33+
requires cplusplus
2734
}
2835

2936
module MemberVariables {
3037
header "member-variables.h"
38+
requires cplusplus
3139
}
3240

3341
module ProtocolConformance {
3442
header "protocol-conformance.h"
43+
requires cplusplus
3544
}
3645

3746
module SynthesizedInitializers {
3847
header "synthesized-initializers.h"
48+
requires cplusplus
3949
}
4050

4151
module DebugInfo {
4252
header "debug-info.h"
53+
requires cplusplus
4354
}
4455

4556
module NestedRecords {
4657
header "nested-records.h"
58+
requires cplusplus
4759
}

test/Interop/Cxx/class/constructors-silgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -I %S/Inputs -enable-cxx-interop -emit-silgen %s | %FileCheck %s
1+
// RUN: %target-swiftxx-frontend -I %S/Inputs -emit-silgen %s | %FileCheck %s
22

33
import Constructors
44

test/Interop/Cxx/class/debug-info-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -enable-cxx-interop -I %S/Inputs %s -emit-ir -g | %FileCheck %s
1+
// RUN: %target-swiftxx-frontend -I %S/Inputs %s -emit-ir -g | %FileCheck %s
22

33
// Validate that we don't crash when trying to deserialize C++ type debug info.
44
// Note, however, that the actual debug info is not generated, see SR-13223.

test/Interop/Cxx/class/memory-layout-silgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -I %S/Inputs -enable-cxx-interop -emit-ir -o - %s | %FileCheck %s
1+
// RUN: %target-swiftxx-frontend -I %S/Inputs -emit-ir -o - %s | %FileCheck %s
22

33
import MemoryLayout
44

test/Interop/Cxx/class/type-classification-non-trivial-irgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -enable-cxx-interop -I %S/Inputs %s -emit-ir | %FileCheck %s
1+
// RUN: %target-swiftxx-frontend -I %S/Inputs %s -emit-ir | %FileCheck %s
22

33
// Verify that non-trival/address-only C++ classes are constructed and accessed
44
// correctly. Make sure that we correctly IRGen functions that construct

test/Interop/Cxx/class/type-classification-non-trivial-silgen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -I %S/Inputs -enable-cxx-interop -emit-silgen %s | %FileCheck %s
1+
// RUN: %target-swiftxx-frontend -I %S/Inputs -emit-silgen %s | %FileCheck %s
22

33
import TypeClassification
44

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module BoolEnums {
22
header "bool-enums.h"
3+
requires cplusplus
34
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module ExternVar {
22
header "extern-var.h"
3+
requires cplusplus
34
}

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
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
module UserA {
22
header "user-a.h"
33
export *
4+
requires cplusplus
45
}
56

67
module UserB {
78
header "user-b.h"
89
export *
10+
requires cplusplus
911
}
1012

1113
module UserC {
1214
header "user-c.h"
1315
export *
16+
requires cplusplus
1417
}
1518

1619
module DeclA {
1720
header "decl-a.h"
1821
export *
22+
requires cplusplus
1923
}
2024

2125
module DeclB {
2226
header "decl-b.h"
2327
export *
28+
requires cplusplus
2429
}

test/Interop/Cxx/implementation-only-imports/check-constructor-visibility-inversed.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-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s -enable-cxx-interop
2+
// RUN: %target-swiftxx-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s
33

44
// Swift should consider all sources for a decl and recognize that the
55
// decl is not hidden behind @_implementationOnly in all modules.

test/Interop/Cxx/implementation-only-imports/check-constructor-visibility.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-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s -enable-cxx-interop
2+
// RUN: %target-swiftxx-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s
33

44
// Swift should consider all sources for a decl and recognize that the
55
// decl is not hidden behind @_implementationOnly in all modules.

test/Interop/Cxx/implementation-only-imports/check-decls-are-identical.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: not %target-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs -enable-cxx-interop %s 2>&1 | %FileCheck %s
2+
// RUN: not %target-swiftxx-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s 2>&1 | %FileCheck %s
33

44
// This test checks that Swift recognizes that the DeclA and DeclB provide
55
// different implementations for `getFortySomething()`

test/Interop/Cxx/implementation-only-imports/check-function-transitive-visibility-inversed.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %empty-directory(%t)
22
// RUN: mkdir %t/use_module_a %t/use_module_b
3-
// RUN: %target-swift-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_a/UseModuleA.swiftmodule %S/Inputs/use-module-a.swift -I %S/Inputs -enable-cxx-interop
4-
// RUN: %target-swift-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_b/UseModuleB.swiftmodule %S/Inputs/use-module-b.swift -I %S/Inputs -enable-cxx-interop
3+
// RUN: %target-swiftxx-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_a/UseModuleA.swiftmodule %S/Inputs/use-module-a.swift -I %S/Inputs
4+
// RUN: %target-swiftxx-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_b/UseModuleB.swiftmodule %S/Inputs/use-module-b.swift -I %S/Inputs
55

6-
// RUN: %target-swift-frontend -typecheck -swift-version 5 -I %t/use_module_a -I %t/use_module_b -I %S/Inputs -enable-cxx-interop %s
6+
// RUN: %target-swiftxx-frontend -typecheck -swift-version 5 -I %t/use_module_a -I %t/use_module_b -I %S/Inputs %s
77

88
// Swift should consider all sources for a decl and recognize that the
99
// decl is not hidden behind @_implementationOnly in all modules.

test/Interop/Cxx/implementation-only-imports/check-function-transitive-visibility.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %empty-directory(%t)
22
// RUN: mkdir %t/use_module_a %t/use_module_b
3-
// RUN: %target-swift-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_a/UseModuleA.swiftmodule %S/Inputs/use-module-a.swift -I %S/Inputs -enable-cxx-interop
4-
// RUN: %target-swift-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_b/UseModuleB.swiftmodule %S/Inputs/use-module-b.swift -I %S/Inputs -enable-cxx-interop
3+
// RUN: %target-swiftxx-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_a/UseModuleA.swiftmodule %S/Inputs/use-module-a.swift -I %S/Inputs
4+
// RUN: %target-swiftxx-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_b/UseModuleB.swiftmodule %S/Inputs/use-module-b.swift -I %S/Inputs
55

6-
// RUN: %target-swift-frontend -typecheck -swift-version 5 -I %t/use_module_a -I %t/use_module_b -I %S/Inputs -enable-cxx-interop %s
6+
// RUN: %target-swiftxx-frontend -typecheck -swift-version 5 -I %t/use_module_a -I %t/use_module_b -I %S/Inputs %s
77

88

99
// Swift should consider all sources for a decl and recognize that the

test/Interop/Cxx/implementation-only-imports/check-function-visibility-inversed.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-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs -enable-cxx-interop %s
2+
// RUN: %target-swiftxx-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s
33

44
// Swift should consider all sources for a decl and recognize that the
55
// decl is not hidden behind @_implementationOnly in all modules.

test/Interop/Cxx/implementation-only-imports/check-function-visibility.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-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs -enable-cxx-interop %s
2+
// RUN: %target-swiftxx-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s
33

44
// Swift should consider all sources for a decl and recognize that the
55
// decl is not hidden behind @_implementationOnly in all modules.

test/Interop/Cxx/implementation-only-imports/check-operator-visibility-inversed.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-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s -enable-cxx-interop
2+
// RUN: %target-swiftxx-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s
33

44
// Swift should consider all sources for a decl and recognize that the
55
// decl is not hidden behind @_implementationOnly in all modules.

test/Interop/Cxx/implementation-only-imports/check-operator-visibility.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-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s -enable-cxx-interop
2+
// RUN: %target-swiftxx-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s
33

44
// Swift should consider all sources for a decl and recognize that the
55
// decl is not hidden behind @_implementationOnly in all modules.

test/Interop/Cxx/implementation-only-imports/skip-forward-declarations.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: not %target-swift-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs -enable-cxx-interop %s 2>&1 | %FileCheck %s
2+
// RUN: not %target-swiftxx-frontend -emit-module -o %t/FortyTwo.swiftmodule -I %S/Inputs %s 2>&1 | %FileCheck %s
33

44
// This test checks that forward declarations are not considered
55
// when determining the visibility of the decl.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
module MemberInline {
22
header "member-inline.h"
3+
requires cplusplus
34
}
45

56
module MemberOutOfLine {
67
header "member-out-of-line.h"
8+
requires cplusplus
79
}
810

911
module NonMemberInline {
1012
header "non-member-inline.h"
13+
requires cplusplus
1114
}
1215

1316
module NonMemberOutOfLine {
1417
header "non-member-out-of-line.h"
18+
requires cplusplus
1519
}

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 -c %S/Inputs/member-out-of-line.cpp -I %S/Inputs -o %t/member-out-of-line.o -std=c++17
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 -c %S/Inputs/non-member-out-of-line.cpp -I %S/Inputs -o %t/non-member-out-of-line.o -std=c++17
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
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module Reference {
22
header "reference.h"
3+
requires cplusplus
34
}

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 -c %S/Inputs/reference.cpp -I %S/Inputs -o %t/reference.o -std=c++17
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
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
module StaticVar {
22
header "static-var.h"
3+
requires cplusplus
34
}
45

56
module StaticLocalVar {
67
header "static-local-var.h"
8+
requires cplusplus
79
}
810

911
module StaticMemberVar {
1012
header "static-member-var.h"
13+
requires cplusplus
1114
}
1215

1316
module InlineStaticMemberVar {
1417
header "inline-static-member-var.h"
18+
requires cplusplus
1519
}
1620

1721
module StaticMemberFunc {
1822
header "static-member-func.h"
23+
requires cplusplus
1924
}

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

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

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 -std=c++17
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

0 commit comments

Comments
 (0)