diff options
Diffstat (limited to 'test/Modules/Inputs')
76 files changed, 474 insertions, 6 deletions
diff --git a/test/Modules/Inputs/AutolinkTBD.framework/AutolinkTBD.tbd b/test/Modules/Inputs/AutolinkTBD.framework/AutolinkTBD.tbd new file mode 100644 index 0000000..4aa0f85 --- /dev/null +++ b/test/Modules/Inputs/AutolinkTBD.framework/AutolinkTBD.tbd @@ -0,0 +1 @@ +empty file - clang only needs to check if it exists. diff --git a/test/Modules/Inputs/AutolinkTBD.framework/Headers/AutolinkTBD.h b/test/Modules/Inputs/AutolinkTBD.framework/Headers/AutolinkTBD.h new file mode 100644 index 0000000..cf790ac --- /dev/null +++ b/test/Modules/Inputs/AutolinkTBD.framework/Headers/AutolinkTBD.h @@ -0,0 +1 @@ +extern int foo(); diff --git a/test/Modules/Inputs/DebugCXX.h b/test/Modules/Inputs/DebugCXX.h new file mode 100644 index 0000000..6ef4445 --- /dev/null +++ b/test/Modules/Inputs/DebugCXX.h @@ -0,0 +1,52 @@ +/* -*- C++ -*- */ +namespace DebugCXX { + // Records. + struct Struct { + int i; + static int static_member; + }; + + // Enums. + enum Enum { + Enumerator + }; + enum { + e1 = '1' + }; + enum { + e2 = '2' + }; + + // Templates (instatiations). + template<typename T> struct traits {}; + template<typename T, + typename Traits = traits<T> + > class Template { + T member; + }; + extern template class Template<int>; + + extern template struct traits<float>; + typedef class Template<float> FloatInstatiation; + + inline void fn() { + Template<long> invisible; + } + + // Non-template inside a template. + template <class> struct Outer { + Outer(); + struct Inner { + Inner(Outer) {} + }; + }; + template <class T> Outer<T>::Outer() { + Inner a(*this); + }; + + // Partial template specialization. + template <typename...> class A; + template <typename T> class A<T> {}; + typedef A<void> B; + void foo(B) {} +} diff --git a/test/Modules/Inputs/DebugModule.h b/test/Modules/Inputs/DebugModule.h deleted file mode 100644 index 5612b73..0000000 --- a/test/Modules/Inputs/DebugModule.h +++ /dev/null @@ -1 +0,0 @@ -@class F; diff --git a/test/Modules/Inputs/DebugObjC.h b/test/Modules/Inputs/DebugObjC.h new file mode 100644 index 0000000..bde463a --- /dev/null +++ b/test/Modules/Inputs/DebugObjC.h @@ -0,0 +1,24 @@ +@class FwdDecl; + +@interface ObjCClass { + int ivar; +} ++ classMethod; +- instanceMethodWithInt:(int)i; +- (struct OpaqueData*) getSomethingOpaque; +@property int property; +@end + +@interface ObjCClass (Category) +- categoryMethod; +@end + +@protocol ObjCProtocol + +typedef enum { + e0 = 0 +} InnerEnum; + ++ (InnerEnum)protocolMethod; + +@end diff --git a/test/Modules/Inputs/DebugSubmoduleA.h b/test/Modules/Inputs/DebugSubmoduleA.h new file mode 100644 index 0000000..1403a7d --- /dev/null +++ b/test/Modules/Inputs/DebugSubmoduleA.h @@ -0,0 +1,3 @@ +struct A { + int a; +}; diff --git a/test/Modules/Inputs/DebugSubmoduleB.h b/test/Modules/Inputs/DebugSubmoduleB.h new file mode 100644 index 0000000..b06ae6a2 --- /dev/null +++ b/test/Modules/Inputs/DebugSubmoduleB.h @@ -0,0 +1,3 @@ +struct B { + int b; +}; diff --git a/test/Modules/Inputs/ExtensionTestA.h b/test/Modules/Inputs/ExtensionTestA.h new file mode 100644 index 0000000..fee0bb9 --- /dev/null +++ b/test/Modules/Inputs/ExtensionTestA.h @@ -0,0 +1 @@ +extern int ExtensionA; diff --git a/test/Modules/Inputs/System/usr/include/assert.h b/test/Modules/Inputs/System/usr/include/assert.h new file mode 100644 index 0000000..844e379 --- /dev/null +++ b/test/Modules/Inputs/System/usr/include/assert.h @@ -0,0 +1,2 @@ +// assert.h +#define DARWIN_C_EXCLUDED 1 diff --git a/test/Modules/Inputs/System/usr/include/module.map b/test/Modules/Inputs/System/usr/include/module.map index 9b2f3af..1d88ca3 100644 --- a/test/Modules/Inputs/System/usr/include/module.map +++ b/test/Modules/Inputs/System/usr/include/module.map @@ -30,3 +30,25 @@ module uses_other_constants { header "uses_other_constants.h" export * } + +module Darwin { + module C { + module excluded { + requires excluded + header "assert.h" + } + } +} + +module Tcl { + module Private { + requires excluded + umbrella "" + } +} + +module IOKit { + module avc { + requires cplusplus + } +} diff --git a/test/Modules/Inputs/System/usr/include/tcl-private/header.h b/test/Modules/Inputs/System/usr/include/tcl-private/header.h new file mode 100644 index 0000000..0e8fb64 --- /dev/null +++ b/test/Modules/Inputs/System/usr/include/tcl-private/header.h @@ -0,0 +1,2 @@ +// tcl-private/header.h +#define TCL_PRIVATE 1 diff --git a/test/Modules/Inputs/auto-import-unavailable/missing_header/not_missing.h b/test/Modules/Inputs/auto-import-unavailable/missing_header/not_missing.h new file mode 100644 index 0000000..5bab833 --- /dev/null +++ b/test/Modules/Inputs/auto-import-unavailable/missing_header/not_missing.h @@ -0,0 +1 @@ +// missing_header/not_missing.h diff --git a/test/Modules/Inputs/auto-import-unavailable/missing_requirement.h b/test/Modules/Inputs/auto-import-unavailable/missing_requirement.h new file mode 100644 index 0000000..7090978 --- /dev/null +++ b/test/Modules/Inputs/auto-import-unavailable/missing_requirement.h @@ -0,0 +1 @@ +// missing_requirement.h diff --git a/test/Modules/Inputs/auto-import-unavailable/module.modulemap b/test/Modules/Inputs/auto-import-unavailable/module.modulemap new file mode 100644 index 0000000..26196dc --- /dev/null +++ b/test/Modules/Inputs/auto-import-unavailable/module.modulemap @@ -0,0 +1,19 @@ +module missing_header { + module missing { header "missing_header/missing.h" } + module error_importing_this { header "missing_header/not_missing.h" } +} + +module nonrequired_missing_header { + module unsatisfied_requires { + requires nonexistent_feature + header "nonrequired_missing_header/missing.h" + } + module fine_to_import { + header "nonrequired_missing_header/not_missing.h" + } +} + +module missing_requirement { + requires nonexistent_feature + header "missing_requirement.h" +} diff --git a/test/Modules/Inputs/auto-import-unavailable/nonrequired_missing_header/not_missing.h b/test/Modules/Inputs/auto-import-unavailable/nonrequired_missing_header/not_missing.h new file mode 100644 index 0000000..3ccfcb1 --- /dev/null +++ b/test/Modules/Inputs/auto-import-unavailable/nonrequired_missing_header/not_missing.h @@ -0,0 +1 @@ +// nonrequired_missing_header/not_missing.h diff --git a/test/Modules/Inputs/auto-import-unavailable/nonrequired_missing_header/requires_feature_you_dont_have.h b/test/Modules/Inputs/auto-import-unavailable/nonrequired_missing_header/requires_feature_you_dont_have.h new file mode 100644 index 0000000..1bcb70d --- /dev/null +++ b/test/Modules/Inputs/auto-import-unavailable/nonrequired_missing_header/requires_feature_you_dont_have.h @@ -0,0 +1 @@ +// nonrequired_missing_header/requires_feature_you_dont_have.h diff --git a/test/Modules/Inputs/available-is-better/available-is-better.h b/test/Modules/Inputs/available-is-better/available-is-better.h new file mode 100644 index 0000000..8ed0320 --- /dev/null +++ b/test/Modules/Inputs/available-is-better/available-is-better.h @@ -0,0 +1,2 @@ +#pragma once +int available; diff --git a/test/Modules/Inputs/available-is-better/module.modulemap b/test/Modules/Inputs/available-is-better/module.modulemap new file mode 100644 index 0000000..19ffabd --- /dev/null +++ b/test/Modules/Inputs/available-is-better/module.modulemap @@ -0,0 +1,17 @@ +// There is some order-dependence to how clang chooses modules, so make +// sure that both the first and last modules here are ones that would +// cause a test failure if they were picked. + +module unavailable_before { + requires nonexistent_feature + header "available-is-better.h" +} + +module available { + header "available-is-better.h" +} + +module unavailable_after { + requires nonexistent_feature + header "available-is-better.h" +} diff --git a/test/Modules/Inputs/builtin_sub.h b/test/Modules/Inputs/builtin_sub.h index 79e3c03..5752ef9 100644 --- a/test/Modules/Inputs/builtin_sub.h +++ b/test/Modules/Inputs/builtin_sub.h @@ -2,3 +2,4 @@ int getBos1(void) { return __builtin_object_size(p, 0); } +#define IS_CONST(x) __builtin_constant_p(x) diff --git a/test/Modules/Inputs/declare-use/module.map b/test/Modules/Inputs/declare-use/module.map index 2dad0d0..14551fd 100644 --- a/test/Modules/Inputs/declare-use/module.map +++ b/test/Modules/Inputs/declare-use/module.map @@ -20,14 +20,12 @@ module XD { module XE { header "e.h" - header "unavailable.h" use XA use XB } module XF { header "f.h" - header "unavailable.h" use XA use XB } diff --git a/test/Modules/Inputs/elaborated-type-structs.h b/test/Modules/Inputs/elaborated-type-structs.h new file mode 100644 index 0000000..da39409 --- /dev/null +++ b/test/Modules/Inputs/elaborated-type-structs.h @@ -0,0 +1,3 @@ +struct S1; +struct S2 { int x; }; +struct S3 { int x; }; diff --git a/test/Modules/Inputs/explicit-build-overlap/a.h b/test/Modules/Inputs/explicit-build-overlap/a.h new file mode 100644 index 0000000..4c5cd94 --- /dev/null +++ b/test/Modules/Inputs/explicit-build-overlap/a.h @@ -0,0 +1 @@ +struct A {}; diff --git a/test/Modules/Inputs/explicit-build-overlap/b.h b/test/Modules/Inputs/explicit-build-overlap/b.h new file mode 100644 index 0000000..c51edab --- /dev/null +++ b/test/Modules/Inputs/explicit-build-overlap/b.h @@ -0,0 +1 @@ +struct B {}; diff --git a/test/Modules/Inputs/explicit-build-overlap/def.map b/test/Modules/Inputs/explicit-build-overlap/def.map new file mode 100644 index 0000000..444faf7 --- /dev/null +++ b/test/Modules/Inputs/explicit-build-overlap/def.map @@ -0,0 +1,2 @@ +module a { textual header "a.h" } +module b { header "a.h" header "b.h" } diff --git a/test/Modules/Inputs/explicit-build-overlap/use.map b/test/Modules/Inputs/explicit-build-overlap/use.map new file mode 100644 index 0000000..456fbd0 --- /dev/null +++ b/test/Modules/Inputs/explicit-build-overlap/use.map @@ -0,0 +1,3 @@ +module "use" { + use a +} diff --git a/test/Modules/Inputs/internal-constants/a.h b/test/Modules/Inputs/internal-constants/a.h new file mode 100644 index 0000000..d288138 --- /dev/null +++ b/test/Modules/Inputs/internal-constants/a.h @@ -0,0 +1,3 @@ +#pragma once +#include "const.h" +inline int f() { return N::k; } diff --git a/test/Modules/Inputs/internal-constants/b.h b/test/Modules/Inputs/internal-constants/b.h new file mode 100644 index 0000000..679603a --- /dev/null +++ b/test/Modules/Inputs/internal-constants/b.h @@ -0,0 +1,3 @@ +#pragma once +#include "const.h" +inline int g() { return N::k; } diff --git a/test/Modules/Inputs/internal-constants/c.h b/test/Modules/Inputs/internal-constants/c.h new file mode 100644 index 0000000..43a37f8 --- /dev/null +++ b/test/Modules/Inputs/internal-constants/c.h @@ -0,0 +1,3 @@ +#pragma once +#include "a.h" +inline int h() { return N::k; } diff --git a/test/Modules/Inputs/internal-constants/const.h b/test/Modules/Inputs/internal-constants/const.h new file mode 100644 index 0000000..e2dc8e1 --- /dev/null +++ b/test/Modules/Inputs/internal-constants/const.h @@ -0,0 +1,3 @@ +namespace N { + const int k = 5; +} diff --git a/test/Modules/Inputs/internal-constants/module.modulemap b/test/Modules/Inputs/internal-constants/module.modulemap new file mode 100644 index 0000000..6d471f5 --- /dev/null +++ b/test/Modules/Inputs/internal-constants/module.modulemap @@ -0,0 +1,6 @@ +module X { + textual header "const.h" + module A { header "a.h" export * } + module B { header "b.h" export * } + module C { header "c.h" export * } +} diff --git a/test/Modules/Inputs/libstdcxx-ambiguous-internal/a.h b/test/Modules/Inputs/libstdcxx-ambiguous-internal/a.h new file mode 100644 index 0000000..0971369 --- /dev/null +++ b/test/Modules/Inputs/libstdcxx-ambiguous-internal/a.h @@ -0,0 +1,5 @@ +#ifndef A_H +#define A_H +static inline void f() {} +constexpr int n = 0; +#endif diff --git a/test/Modules/Inputs/libstdcxx-ambiguous-internal/b.h b/test/Modules/Inputs/libstdcxx-ambiguous-internal/b.h new file mode 100644 index 0000000..c0a8278 --- /dev/null +++ b/test/Modules/Inputs/libstdcxx-ambiguous-internal/b.h @@ -0,0 +1,4 @@ +#ifndef B_H +#define B_H +#include "a.h" +#endif diff --git a/test/Modules/Inputs/libstdcxx-ambiguous-internal/c.h b/test/Modules/Inputs/libstdcxx-ambiguous-internal/c.h new file mode 100644 index 0000000..53122fa --- /dev/null +++ b/test/Modules/Inputs/libstdcxx-ambiguous-internal/c.h @@ -0,0 +1,4 @@ +#ifndef C_H +#define C_H +#include "a.h" +#endif diff --git a/test/Modules/Inputs/libstdcxx-ambiguous-internal/d.h b/test/Modules/Inputs/libstdcxx-ambiguous-internal/d.h new file mode 100644 index 0000000..efec99f --- /dev/null +++ b/test/Modules/Inputs/libstdcxx-ambiguous-internal/d.h @@ -0,0 +1,4 @@ +#include "b.h" +#include "c.h" +inline void g() { f(); } +inline int h() { return n; } diff --git a/test/Modules/Inputs/libstdcxx-ambiguous-internal/module.modulemap b/test/Modules/Inputs/libstdcxx-ambiguous-internal/module.modulemap new file mode 100644 index 0000000..12d0388 --- /dev/null +++ b/test/Modules/Inputs/libstdcxx-ambiguous-internal/module.modulemap @@ -0,0 +1,6 @@ +module std { + module A { textual header "a.h" } + module B { header "b.h" } + module C { header "c.h" } + module D { header "d.h" export * } +} diff --git a/test/Modules/Inputs/macro-reexport/module.modulemap b/test/Modules/Inputs/macro-reexport/module.modulemap index 896bda0..f861ff8 100644 --- a/test/Modules/Inputs/macro-reexport/module.modulemap +++ b/test/Modules/Inputs/macro-reexport/module.modulemap @@ -19,5 +19,4 @@ module e { } module f { module f1 { header "f1.h" export * } - module f2 { header "f2.h" export * } } diff --git a/test/Modules/Inputs/misplaced/misplaced-a.h b/test/Modules/Inputs/misplaced/misplaced-a.h new file mode 100644 index 0000000..f50e5ce --- /dev/null +++ b/test/Modules/Inputs/misplaced/misplaced-a.h @@ -0,0 +1,5 @@ +namespace A { + namespace B { // expected-note{{namespace 'A::B' begins here}} + #include "misplaced-b.h" // expected-error{{import of module 'Misplaced.Sub_B' appears within namespace 'A::B'}} + } +} diff --git a/test/Modules/Inputs/misplaced/misplaced-b.h b/test/Modules/Inputs/misplaced/misplaced-b.h new file mode 100644 index 0000000..68dd955 --- /dev/null +++ b/test/Modules/Inputs/misplaced/misplaced-b.h @@ -0,0 +1 @@ +int a;
\ No newline at end of file diff --git a/test/Modules/Inputs/misplaced/misplaced.modulemap b/test/Modules/Inputs/misplaced/misplaced.modulemap new file mode 100644 index 0000000..50aa7a4 --- /dev/null +++ b/test/Modules/Inputs/misplaced/misplaced.modulemap @@ -0,0 +1,8 @@ +module Misplaced { + module Sub_A { + header "misplaced-a.h" + } + module Sub_B { + header "misplaced-b.h" + } +} diff --git a/test/Modules/Inputs/module-map-path-hash/a.h b/test/Modules/Inputs/module-map-path-hash/a.h new file mode 100644 index 0000000..f137354 --- /dev/null +++ b/test/Modules/Inputs/module-map-path-hash/a.h @@ -0,0 +1,2 @@ +#pragma once +int a = 42; diff --git a/test/Modules/Inputs/module-map-path-hash/module.modulemap b/test/Modules/Inputs/module-map-path-hash/module.modulemap new file mode 100644 index 0000000..514d745 --- /dev/null +++ b/test/Modules/Inputs/module-map-path-hash/module.modulemap @@ -0,0 +1,3 @@ +module a { + header "a.h" +} diff --git a/test/Modules/Inputs/module.map b/test/Modules/Inputs/module.map index 904c65c..632517d 100644 --- a/test/Modules/Inputs/module.map +++ b/test/Modules/Inputs/module.map @@ -328,8 +328,12 @@ module crash { header "crash.h" } -module DebugModule { - header "DebugModule.h" +module DebugCXX { + header "DebugCXX.h" +} + +module DebugObjC { + header "DebugObjC.h" } module ImportNameInDir { @@ -347,3 +351,45 @@ module RequiresWithMissingHeader { header "RequiresWithMissingHeader-Missing2.h" } } + +module TargetFeatures { + module arm { + requires arm + module aarch32 { requires aarch32 } + module aarch64 { requires aarch64 } + } + module x86 { + requires x86 + module x86_32 { requires x86_32 } + module x86_64 { requires x86_64 } + } +} + +module DebugSubmodules { + module DebugSubmoduleA { + header "DebugSubmoduleA.h" + export * + } + module DebugSubmoduleB { + header "DebugSubmoduleB.h" + export * + } +} + +module ExtensionTestA { + header "ExtensionTestA.h" +} + +module TypedefTag { + header "typedef-tag.h" + explicit module Hidden { + header "typedef-tag-hidden.h" + } +} + +module ElaboratedTypeStructs { + module Empty {} + module Structs { + header "elaborated-type-structs.h" + } +} diff --git a/test/Modules/Inputs/no-linkage/decls.h b/test/Modules/Inputs/no-linkage/decls.h new file mode 100644 index 0000000..c8d6de5 --- /dev/null +++ b/test/Modules/Inputs/no-linkage/decls.h @@ -0,0 +1,11 @@ +namespace RealNS { int UsingDecl; } +namespace NS = RealNS; +typedef int Typedef; +using AliasDecl = int; +using RealNS::UsingDecl; +struct Struct {}; +extern int Variable; +namespace AnotherNS {} +enum X { Enumerator }; +void Overloads(); +void Overloads(int); diff --git a/test/Modules/Inputs/no-linkage/empty.h b/test/Modules/Inputs/no-linkage/empty.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Modules/Inputs/no-linkage/empty.h diff --git a/test/Modules/Inputs/no-linkage/module.modulemap b/test/Modules/Inputs/no-linkage/module.modulemap new file mode 100644 index 0000000..3931b0f --- /dev/null +++ b/test/Modules/Inputs/no-linkage/module.modulemap @@ -0,0 +1 @@ +module M { module E { header "empty.h" } module D { header "decls.h" } } diff --git a/test/Modules/Inputs/private3/private.h b/test/Modules/Inputs/private3/private.h new file mode 100644 index 0000000..cf34b14 --- /dev/null +++ b/test/Modules/Inputs/private3/private.h @@ -0,0 +1,7 @@ +#ifndef PRIVATE_H +#define PRIVATE_H + +void priv(); + +#endif + diff --git a/test/Modules/Inputs/private3/public.h b/test/Modules/Inputs/private3/public.h new file mode 100644 index 0000000..2cf9d21 --- /dev/null +++ b/test/Modules/Inputs/private3/public.h @@ -0,0 +1,11 @@ +#ifndef PUBLIC_H +#define PUBLIC_H + +#include "private.h" + +void pub() { + priv(); +} + +#endif + diff --git a/test/Modules/Inputs/stress1/merge00.h b/test/Modules/Inputs/stress1/merge00.h index 46d5e41..0aeb6ce 100644 --- a/test/Modules/Inputs/stress1/merge00.h +++ b/test/Modules/Inputs/stress1/merge00.h @@ -9,6 +9,10 @@ //#pragma weak pragma_weak01 // expected-warning {{weak identifier 'pragma_weak01' never declared}} //#pragma weak pragma_weak04 // expected-warning {{weak identifier 'pragma_waek04' never declared}} +#ifdef MERGE_NO_REEXPORT +#include "merge_no_reexport.h" +#endif + #include "common.h" #include "m00.h" #include "m01.h" diff --git a/test/Modules/Inputs/stress1/merge_no_reexport.h b/test/Modules/Inputs/stress1/merge_no_reexport.h new file mode 100644 index 0000000..7912c72 --- /dev/null +++ b/test/Modules/Inputs/stress1/merge_no_reexport.h @@ -0,0 +1,9 @@ +#ifndef STRESS1_MERGE_NO_REEXPORT_H +#define STRESS1_MERGE_NO_REEXPORT_H + +#include "m00.h" +#include "m01.h" +#include "m02.h" +#include "m03.h" + +#endif diff --git a/test/Modules/Inputs/stress1/module.modulemap b/test/Modules/Inputs/stress1/module.modulemap index 2b687b0..33eb23e 100644 --- a/test/Modules/Inputs/stress1/module.modulemap +++ b/test/Modules/Inputs/stress1/module.modulemap @@ -3,4 +3,5 @@ module m01 { header "Inputs/stress1/m01.h" export * } module m02 { header "Inputs/stress1/m02.h" export * } module m03 { header "Inputs/stress1/m03.h" export * } +module merge_no_reexport { header "Inputs/stress1/merge_no_reexport.h" } module merge00 { header "Inputs/stress1/merge00.h" export * } diff --git a/test/Modules/Inputs/submodules-merge-defs/defs.h b/test/Modules/Inputs/submodules-merge-defs/defs.h index 07dfac7..f6004f0 100644 --- a/test/Modules/Inputs/submodules-merge-defs/defs.h +++ b/test/Modules/Inputs/submodules-merge-defs/defs.h @@ -5,10 +5,17 @@ class B { struct Inner1 {}; public: struct Inner2; + struct Inner3; template<typename T> void f(); }; +struct BFriend { + friend class B::Inner3; +private: + struct Inner3Base {}; +}; // Check that lookup and access checks are performed in the right context. struct B::Inner2 : Inner1 {}; +struct B::Inner3 : BFriend::Inner3Base {}; template<typename T> void B::f() {} template<> inline void B::f<int>() {} @@ -97,3 +104,37 @@ namespace MergeFunctionTemplateSpecializations { enum ScopedEnum : int; enum ScopedEnum : int { a, b, c }; + +namespace RedeclDifferentDeclKind { + struct X {}; + typedef X X; + using RedeclDifferentDeclKind::X; +} + +namespace Anon { + struct X { + union { + int n; + }; + }; +} + +namespace ClassTemplatePartialSpec { + template<typename T> struct F; + template<template<int> class A, int B> struct F<A<B>> { + template<typename C> F(); + }; + template<template<int> class A, int B> template<typename C> F<A<B>>::F() {} + + template<typename A, int B> struct F<A[B]> { + template<typename C> F(); + }; + template<typename A, int B> template<typename C> F<A[B]>::F() {} +} + +struct MemberClassTemplate { + template<typename T> struct A; +}; +template<typename T> struct MemberClassTemplate::A {}; +template<typename T> struct MemberClassTemplate::A<T*> {}; +template<> struct MemberClassTemplate::A<int> {}; diff --git a/test/Modules/Inputs/template-default-args/a.h b/test/Modules/Inputs/template-default-args/a.h index be760fe..532cbc8 100644 --- a/test/Modules/Inputs/template-default-args/a.h +++ b/test/Modules/Inputs/template-default-args/a.h @@ -1,3 +1,4 @@ +BEGIN template<typename T = int> struct A {}; template<typename T> struct B {}; template<typename T> struct C; @@ -5,3 +6,11 @@ template<typename T> struct D; template<typename T> struct E; template<typename T = int> struct G; template<typename T = int> struct H; +template<typename T> struct J {}; +template<typename T = int> struct J; +struct K : J<> {}; +template<typename T = void> struct L; +struct FriendL { + template<typename T> friend struct L; +}; +END diff --git a/test/Modules/Inputs/template-default-args/c.h b/test/Modules/Inputs/template-default-args/c.h index 2946013..30cddb3 100644 --- a/test/Modules/Inputs/template-default-args/c.h +++ b/test/Modules/Inputs/template-default-args/c.h @@ -1,2 +1,4 @@ +BEGIN template<typename T = int> struct F; template<typename T, typename U> struct I; +END diff --git a/test/Modules/Inputs/template-default-args/d.h b/test/Modules/Inputs/template-default-args/d.h new file mode 100644 index 0000000..5961c91 --- /dev/null +++ b/test/Modules/Inputs/template-default-args/d.h @@ -0,0 +1,6 @@ +BEGIN +template<typename T = void> struct L; +struct FriendL { + template<typename T> friend struct L; +}; +END diff --git a/test/Modules/Inputs/template-default-args/module.modulemap b/test/Modules/Inputs/template-default-args/module.modulemap index d54dfc3..21bf40c 100644 --- a/test/Modules/Inputs/template-default-args/module.modulemap +++ b/test/Modules/Inputs/template-default-args/module.modulemap @@ -3,3 +3,6 @@ module X { module B { header "b.h" } module C { header "c.h" } } +module Y { + module D { header "d.h" } +} diff --git a/test/Modules/Inputs/templates-right.h b/test/Modules/Inputs/templates-right.h index daea97b..32487c6 100644 --- a/test/Modules/Inputs/templates-right.h +++ b/test/Modules/Inputs/templates-right.h @@ -38,6 +38,10 @@ int defineListDoubleRight() { return ld.size; } +inline void defineListLongRight() { + List<long> ll; +} + template<typename T> struct MergePatternDecl; void outOfLineInlineUseRightF(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::f); diff --git a/test/Modules/Inputs/templates-top.h b/test/Modules/Inputs/templates-top.h index 31f5e41..a082683 100644 --- a/test/Modules/Inputs/templates-top.h +++ b/test/Modules/Inputs/templates-top.h @@ -10,6 +10,7 @@ public: }; extern List<double> *instantiateListDoubleDeclaration; +extern List<long> *instantiateListLongDeclaration; namespace A { class Y { diff --git a/test/Modules/Inputs/thread-safety/a.h b/test/Modules/Inputs/thread-safety/a.h new file mode 100644 index 0000000..879c038 --- /dev/null +++ b/test/Modules/Inputs/thread-safety/a.h @@ -0,0 +1,4 @@ +struct __attribute__((lockable)) mutex { + void lock() __attribute__((exclusive_lock_function)); + void unlock() __attribute__((unlock_function)); +}; diff --git a/test/Modules/Inputs/thread-safety/b.h b/test/Modules/Inputs/thread-safety/b.h new file mode 100644 index 0000000..c8ed237 --- /dev/null +++ b/test/Modules/Inputs/thread-safety/b.h @@ -0,0 +1,8 @@ +#include "a.h" + +struct X { + mutex m; + int n __attribute__((guarded_by(m))); + + void f(); +}; diff --git a/test/Modules/Inputs/thread-safety/c.h b/test/Modules/Inputs/thread-safety/c.h new file mode 100644 index 0000000..ec849c2 --- /dev/null +++ b/test/Modules/Inputs/thread-safety/c.h @@ -0,0 +1,10 @@ +#include "a.h" + +struct X { + mutex m; + int n __attribute__((guarded_by(m))); + + void f(); +}; + +inline void unlock(X &x) __attribute__((unlock_function(x.m))) { x.m.unlock(); } diff --git a/test/Modules/Inputs/thread-safety/module.map b/test/Modules/Inputs/thread-safety/module.map new file mode 100644 index 0000000..bd6ea83 --- /dev/null +++ b/test/Modules/Inputs/thread-safety/module.map @@ -0,0 +1,3 @@ +module a { header "a.h" } +module b { header "b.h" export * } +module c { header "c.h" export * } diff --git a/test/Modules/Inputs/typedef-tag-hidden.h b/test/Modules/Inputs/typedef-tag-hidden.h new file mode 100644 index 0000000..eb59d69 --- /dev/null +++ b/test/Modules/Inputs/typedef-tag-hidden.h @@ -0,0 +1 @@ +typedef struct { int x; } TypedefStructHidden_t; diff --git a/test/Modules/Inputs/typedef-tag.h b/test/Modules/Inputs/typedef-tag.h new file mode 100644 index 0000000..77dff95 --- /dev/null +++ b/test/Modules/Inputs/typedef-tag.h @@ -0,0 +1 @@ +typedef struct { int x; } TypedefStructVisible_t; diff --git a/test/Modules/Inputs/use-builtin.h b/test/Modules/Inputs/use-builtin.h new file mode 100644 index 0000000..fd04741 --- /dev/null +++ b/test/Modules/Inputs/use-builtin.h @@ -0,0 +1,2 @@ +@import builtin; +@import builtin.sub; diff --git a/test/Modules/Inputs/using-decl-a.h b/test/Modules/Inputs/using-decl-a.h index 85a4788..1d1ffe9 100644 --- a/test/Modules/Inputs/using-decl-a.h +++ b/test/Modules/Inputs/using-decl-a.h @@ -1,5 +1,6 @@ typedef int using_decl_type; int using_decl_var; +int merged; namespace UsingDecl { using ::using_decl_type; diff --git a/test/Modules/Inputs/using-decl-b.h b/test/Modules/Inputs/using-decl-b.h index b82526f..7c03d09 100644 --- a/test/Modules/Inputs/using-decl-b.h +++ b/test/Modules/Inputs/using-decl-b.h @@ -8,4 +8,31 @@ namespace UsingDecl { namespace UsingDecl { using ::using_decl_type; using ::using_decl_var; + using ::merged; } + +namespace X { + int conflicting_hidden_using_decl; + int conflicting_hidden_using_decl_fn(); + int conflicting_hidden_using_decl_var; + struct conflicting_hidden_using_decl_struct; + + int conflicting_hidden_using_decl_mixed_1; + int conflicting_hidden_using_decl_mixed_2(); + struct conflicting_hidden_using_decl_mixed_3 {}; +} + +using X::conflicting_hidden_using_decl; +using X::conflicting_hidden_using_decl_fn; +using X::conflicting_hidden_using_decl_var; +using X::conflicting_hidden_using_decl_struct; +int conflicting_hidden_using_decl_fn_2(); +int conflicting_hidden_using_decl_var_2; +struct conflicting_hidden_using_decl_struct_2 {}; + +using X::conflicting_hidden_using_decl_mixed_1; +using X::conflicting_hidden_using_decl_mixed_2; +using X::conflicting_hidden_using_decl_mixed_3; +int conflicting_hidden_using_decl_mixed_4; +int conflicting_hidden_using_decl_mixed_5(); +struct conflicting_hidden_using_decl_mixed_6 {}; diff --git a/test/Modules/Inputs/using-decl-redecl/a.h b/test/Modules/Inputs/using-decl-redecl/a.h new file mode 100644 index 0000000..4775469 --- /dev/null +++ b/test/Modules/Inputs/using-decl-redecl/a.h @@ -0,0 +1,2 @@ +struct string {}; +namespace N { typedef ::string clstring; } diff --git a/test/Modules/Inputs/using-decl-redecl/b.h b/test/Modules/Inputs/using-decl-redecl/b.h new file mode 100644 index 0000000..0714bb9 --- /dev/null +++ b/test/Modules/Inputs/using-decl-redecl/b.h @@ -0,0 +1,3 @@ +#include "a.h" +namespace N { using ::N::clstring; } +extern N::clstring b; diff --git a/test/Modules/Inputs/using-decl-redecl/c.h b/test/Modules/Inputs/using-decl-redecl/c.h new file mode 100644 index 0000000..e44e1a0 --- /dev/null +++ b/test/Modules/Inputs/using-decl-redecl/c.h @@ -0,0 +1,2 @@ +#include "b.h" +namespace N { using ::N::clstring; } diff --git a/test/Modules/Inputs/using-decl-redecl/module.modulemap b/test/Modules/Inputs/using-decl-redecl/module.modulemap new file mode 100644 index 0000000..bd6ea83 --- /dev/null +++ b/test/Modules/Inputs/using-decl-redecl/module.modulemap @@ -0,0 +1,3 @@ +module a { header "a.h" } +module b { header "b.h" export * } +module c { header "c.h" export * } diff --git a/test/Modules/Inputs/va_list/left.h b/test/Modules/Inputs/va_list/left.h new file mode 100644 index 0000000..6842f9f --- /dev/null +++ b/test/Modules/Inputs/va_list/left.h @@ -0,0 +1,7 @@ +@import top; + +template<typename T> +void f(int k, ...) { + va_list va; + __builtin_va_start(va, k); +} diff --git a/test/Modules/Inputs/va_list/module.modulemap b/test/Modules/Inputs/va_list/module.modulemap index 870f38b..bd9c614 100644 --- a/test/Modules/Inputs/va_list/module.modulemap +++ b/test/Modules/Inputs/va_list/module.modulemap @@ -1,2 +1,5 @@ module va_list_a { header "va_list_a.h" } module va_list_b { header "va_list_b.h" } +module top { header "top.h" } +module left { header "left.h" } +module right { header "right.h" } diff --git a/test/Modules/Inputs/va_list/right.h b/test/Modules/Inputs/va_list/right.h new file mode 100644 index 0000000..6842f9f --- /dev/null +++ b/test/Modules/Inputs/va_list/right.h @@ -0,0 +1,7 @@ +@import top; + +template<typename T> +void f(int k, ...) { + va_list va; + __builtin_va_start(va, k); +} diff --git a/test/Modules/Inputs/va_list/top.h b/test/Modules/Inputs/va_list/top.h new file mode 100644 index 0000000..5660b87 --- /dev/null +++ b/test/Modules/Inputs/va_list/top.h @@ -0,0 +1 @@ +typedef __builtin_va_list va_list; diff --git a/test/Modules/Inputs/working-dir-test/Test.framework/Headers/Test.h b/test/Modules/Inputs/working-dir-test/Test.framework/Headers/Test.h new file mode 100644 index 0000000..ecc54bf --- /dev/null +++ b/test/Modules/Inputs/working-dir-test/Test.framework/Headers/Test.h @@ -0,0 +1 @@ +void test_me_call(void); diff --git a/test/Modules/Inputs/working-dir-test/Test.framework/Modules/module.modulemap b/test/Modules/Inputs/working-dir-test/Test.framework/Modules/module.modulemap new file mode 100644 index 0000000..3040ac7 --- /dev/null +++ b/test/Modules/Inputs/working-dir-test/Test.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module Test { + umbrella header "Test.h" + + export * + module * { export * } +} |