Skip to content

[cxx-interop] Rename tests in Cxx/templates to show they are class templates. #34086

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
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ inline int forceInstantiation() {
// because function above forced the instantiation. Its members are fully
// instantiated, so nothing needs to be explicitly instantiated by the Swift
// compiler.
typedef MagicWrapper<IntWrapper> FullyDefinedMagicallyWrappedInt;
typedef MagicWrapper<IntWrapper> FullyPreDefinedMagicallyWrappedInt;

#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_DECL_WITH_DEFINITION_INCLUDING_MEMBERS_H
24 changes: 12 additions & 12 deletions test/Interop/Cxx/templates/Inputs/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
module DeclWithPrimitiveArgument {
header "decl-with-primitive-argument.h"
module ClassTemplateWithPrimitiveArgument {
header "class-template-with-primitive-argument.h"
}

module DeclWithoutDefinition {
header "decl-without-definition.h"
module NotPreDefinedClassTemplate {
header "not-pre-defined-class-template.h"
}

module DeclWithDefinition {
header "decl-with-definition.h"
module PartiallyPreDefinedClassTemplate {
header "partially-pre-defined-class-template.h"
}

module DeclWithDefinitionIncludingMembers {
header "decl-with-definition-including-members.h"
module FullyPreDefinedClassTemplate {
header "fully-pre-defined-class-template.h"
}

module CanonicalTypes {
header "canonical-types.h"
}

module ExplicitSpecialization {
header "explicit-specialization.h"
module ExplicitClassSpecialization {
header "explicit-class-specialization.h"
}

module UsingDirective {
header "using-directive.h"
}

module EagerInstantiationProblems {
header "eager-instantiation-problems.h"
module ClassTemplateEagerInstantiationProblems {
header "class-template-eager-instantiation-problems.h"
}

module Mangling {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ inline MagicWrapper<IntWrapper> forceInstantiation() {
// The ClassTemplateSpecializationDecl node for MagicWrapper<IntWrapper> already has a definition
// because function above forced the instantiation. Its members are not
// instantiated though, the Swift compiler needs to instantiate them.
typedef MagicWrapper<IntWrapper> PartiallyDefinedMagicallyWrappedInt;
typedef MagicWrapper<IntWrapper> PartiallyPreDefinedMagicallyWrappedInt;

#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_DECL_WITH_DEFINITION_H
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// REQUIRES: executable_test

import EagerInstantiationProblems
import ClassTemplateEagerInstantiationProblems
import StdlibUnittest

var TemplatesTestSuite = TestSuite("TemplatesTestSuite")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// REQUIRES: executable_test

import DeclWithPrimitiveArgument
import ClassTemplateWithPrimitiveArgument
import StdlibUnittest

var TemplatesTestSuite = TestSuite("TemplatesTestSuite")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// REQUIRES: executable_test

import ExplicitSpecialization
import ExplicitClassSpecialization
import StdlibUnittest

var TemplatesTestSuite = TestSuite("TemplatesTestSuite")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
//
// REQUIRES: executable_test

import DeclWithDefinitionIncludingMembers
import FullyPreDefinedClassTemplate
import StdlibUnittest

var TemplatesTestSuite = TestSuite("TemplatesTestSuite")

TemplatesTestSuite.test("fully-defined") {
let myInt = IntWrapper(value: 10)
var magicInt = FullyDefinedMagicallyWrappedInt(t: myInt)
var magicInt = FullyPreDefinedMagicallyWrappedInt(t: myInt)
expectEqual(magicInt.getValuePlusArg(5), 15)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-ide-test -print-module -module-to-print=DeclWithoutDefinition -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s
// RUN: %target-swift-ide-test -print-module -module-to-print=NotPreDefinedClassTemplate -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s

// CHECK: struct __CxxTemplateInst12MagicWrapperI10IntWrapperE {
// CHECK: var t: IntWrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// REQUIRES: executable_test

import DeclWithoutDefinition
import NotPreDefinedClassTemplate
import StdlibUnittest

var TemplatesTestSuite = TestSuite("TemplatesTestSuite")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
// REQUIRES: rdar67257133
import DeclWithDefinition
import PartiallyPreDefinedClassTemplate

public func getWrappedMagicInt() -> CInt {
let myInt = IntWrapper(value: 7)
var magicInt = PartiallyDefinedMagicallyWrappedInt(t: myInt)
var magicInt = PartiallyPreDefinedMagicallyWrappedInt(t: myInt)
return magicInt.getValuePlusArg(13)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// RUN: %target-swift-emit-sil %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s

import DeclWithDefinition
import PartiallyPreDefinedClassTemplate

public func getWrappedMagicInt() -> CInt {
let myInt = IntWrapper(value: 21)
var magicInt = PartiallyDefinedMagicallyWrappedInt(t: myInt)
var magicInt = PartiallyPreDefinedMagicallyWrappedInt(t: myInt)
return magicInt.getValuePlusArg(32)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
//
// REQUIRES: executable_test

import DeclWithDefinition
import PartiallyPreDefinedClassTemplate
import StdlibUnittest

var TemplatesTestSuite = TestSuite("TemplatesTestSuite")

TemplatesTestSuite.test("has-partial-definition") {
let myInt = IntWrapper(value: 32)
var magicInt = PartiallyDefinedMagicallyWrappedInt(t: myInt)
var magicInt = PartiallyPreDefinedMagicallyWrappedInt(t: myInt)
expectEqual(magicInt.getValuePlusArg(5), 37)
}

Expand Down