Skip to content

Commit 2e7066b

Browse files
committed
Merge branch 'add_template_tests' into class_templates
2 parents b4bdc00 + 5c18ef4 commit 2e7066b

10 files changed

+27
-43
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_NON_TYPE_PARAMETER_H
2+
#define TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_NON_TYPE_PARAMETER_H
3+
4+
template<class T, auto Size>
5+
struct MagicArray {
6+
T t[Size];
7+
};
8+
9+
typedef MagicArray<int, 2> MagicIntPair;
10+
11+
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_NON_TYPE_PARAMETER_H

test/Interop/Cxx/templates/Inputs/template-template-parameter.h renamed to test/Interop/Cxx/templates/Inputs/class-template-template-parameter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef TEST_INTEROP_CXX_TEMPLATES_INPUTS_TEMPLATE_TEMPLATE_PARAMETER_H
2-
#define TEST_INTEROP_CXX_TEMPLATES_INPUTS_TEMPLATE_TEMPLATE_PARAMETER_H
1+
#ifndef TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_TEMPLATE_PARAMETER_H
2+
#define TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_TEMPLATE_PARAMETER_H
33

44
struct IntWrapper {
55
int value;
@@ -20,4 +20,4 @@ struct TemplatedMagicWrapper {
2020

2121
typedef TemplatedMagicWrapper<MagicWrapper> TemplatedWrappedMagicInt;
2222
typedef MagicWrapper<IntWrapper> WrappedMagicInt;
23-
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_TEMPLATE_TEMPLATE_PARAMETER_H
23+
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_TEMPLATE_PARAMETER_H

test/Interop/Cxx/templates/Inputs/variadic-class-template.h renamed to test/Interop/Cxx/templates/Inputs/class-template-variadic.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef TEST_INTEROP_CXX_TEMPLATES_INPUTS_VARIADIC_CLASS_TEMPLATE_H
2-
#define TEST_INTEROP_CXX_TEMPLATES_INPUTS_VARIADIC_CLASS_TEMPLATE_H
1+
#ifndef TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_VARIADIC_H
2+
#define TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_VARIADIC_H
33

44
template <class... Ts> struct Tuple {};
55

@@ -27,4 +27,4 @@ struct IntWrapper {
2727

2828
typedef Tuple<IntWrapper, IntWrapper> Pair;
2929

30-
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_VARIADIC_CLASS_TEMPLATE_H
30+
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_VARIADIC_H

test/Interop/Cxx/templates/Inputs/module.modulemap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ module ClassTemplates {
4646
header "class-templates.h"
4747
}
4848

49-
module VariadicClassTemplate {
50-
header "variadic-class-template.h"
49+
module ClassTemplateVariadic {
50+
header "class-template-variadic.h"
5151
}
5252

53-
module NonTypeParameter {
54-
header "non-type-parameter.h"
53+
module ClassTemplateNonTypeParameter {
54+
header "class-template-non-type-parameter.h"
5555
}
5656

57-
module TemplateTemplateParameter {
58-
header "template-template-parameter.h"
57+
module ClassTemplateTemplateParameter {
58+
header "class-template-template-parameter.h"
5959
}

test/Interop/Cxx/templates/Inputs/non-type-parameter.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

test/Interop/Cxx/templates/non-type-parameter.swift renamed to test/Interop/Cxx/templates/class-template-non-type-parameter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// REQUIRES: executable_test
44

5-
import NonTypeParameter
5+
import ClassTemplateNonTypeParameter
66
import StdlibUnittest
77

88
var TemplatesTestSuite = TestSuite("TemplatesTestSuite")

test/Interop/Cxx/templates/template-template-parameter.swift renamed to test/Interop/Cxx/templates/class-template-template-parameter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// REQUIRES: executable_test
44

5-
import TemplateTemplateParameter
5+
import ClassTemplateTemplateParameter
66
import StdlibUnittest
77

88
var TemplatesTestSuite = TestSuite("TemplatesTestSuite")

test/Interop/Cxx/templates/variadic-class-template.swift renamed to test/Interop/Cxx/templates/class-template-variadic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// REQUIRES: executable_test
44

5-
import VariadicClassTemplate
5+
import ClassTemplateVariadic
66
import StdlibUnittest
77

88
var TemplatesTestSuite = TestSuite("TemplatesTestSuite")

test/Interop/Cxx/templates/demangling.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | grep 'define.*swiftcc.*$' | grep -o '\$[[:alnum:]]\+__CxxTemplateInst[[:alnum:]]\+' | xargs %swift-demangle | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | grep 'define.*swiftcc.*$' | grep -o '[[:alnum:]]*__CxxTemplateInst[[:alnum:]]*' | xargs %swift-demangle | %FileCheck %s
22

33
import Mangling
44

test/lit.cfg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ config.sourcekitd_test = inferSwiftBinary('sourcekitd-test')
282282
config.complete_test = inferSwiftBinary('complete-test')
283283
config.swift_api_digester = inferSwiftBinary('swift-api-digester')
284284
config.swift_refactor = inferSwiftBinary('swift-refactor')
285-
config.swift_demangle = inferSwiftBinary('swift-demangle')
286285
config.swift_demangle_yamldump = inferSwiftBinary('swift-demangle-yamldump')
287286
config.swift_demangle = inferSwiftBinary('swift-demangle')
288287
config.benchmark_o = inferSwiftBinary('Benchmark_O')
@@ -442,7 +441,6 @@ config.substitutions.append( ('%llvm-dwarfdump', config.llvm_dwarfdump) )
442441
config.substitutions.append( ('%llvm-readelf', config.llvm_readelf) )
443442
config.substitutions.append( ('%llvm-dis', config.llvm_dis) )
444443
config.substitutions.append( ('%llvm-nm', config.llvm_nm) )
445-
config.substitutions.append( ('%swift-demangle', config.swift_demangle) )
446444
config.substitutions.append( ('%swift-demangle-yamldump', config.swift_demangle_yamldump) )
447445
config.substitutions.append( ('%swift-demangle', config.swift_demangle) )
448446
config.substitutions.append( ('%Benchmark_O', config.benchmark_o) )

0 commit comments

Comments
 (0)