diff options
Diffstat (limited to 'test/Modules')
-rw-r--r-- | test/Modules/Inputs/objc-desig-init/A.h | 1 | ||||
-rw-r--r-- | test/Modules/Inputs/objc-desig-init/A2.h | 4 | ||||
-rw-r--r-- | test/Modules/Inputs/objc-desig-init/Base.h | 4 | ||||
-rw-r--r-- | test/Modules/Inputs/objc-desig-init/X.h | 4 | ||||
-rw-r--r-- | test/Modules/Inputs/objc-desig-init/module.modulemap | 9 | ||||
-rw-r--r-- | test/Modules/Inputs/template-default-args/a.h | 13 | ||||
-rw-r--r-- | test/Modules/Inputs/template-default-args/d.h | 7 | ||||
-rw-r--r-- | test/Modules/localsubmodulevis.m | 2 | ||||
-rw-r--r-- | test/Modules/objc-designated-init-mod.m | 17 | ||||
-rw-r--r-- | test/Modules/template-default-args.cpp | 17 |
10 files changed, 77 insertions, 1 deletions
diff --git a/test/Modules/Inputs/objc-desig-init/A.h b/test/Modules/Inputs/objc-desig-init/A.h new file mode 100644 index 0000000000000..02e0105f3addf --- /dev/null +++ b/test/Modules/Inputs/objc-desig-init/A.h @@ -0,0 +1 @@ +#import "A2.h" diff --git a/test/Modules/Inputs/objc-desig-init/A2.h b/test/Modules/Inputs/objc-desig-init/A2.h new file mode 100644 index 0000000000000..5a4ceb495b322 --- /dev/null +++ b/test/Modules/Inputs/objc-desig-init/A2.h @@ -0,0 +1,4 @@ +#import "Base.h" + +@interface A2 : Base +@end diff --git a/test/Modules/Inputs/objc-desig-init/Base.h b/test/Modules/Inputs/objc-desig-init/Base.h new file mode 100644 index 0000000000000..47184256b139f --- /dev/null +++ b/test/Modules/Inputs/objc-desig-init/Base.h @@ -0,0 +1,4 @@ +@class NSString; +@interface Base +- (id)initWithNibName:(NSString *)nibNameOrNil __attribute__((objc_designated_initializer)); +@end diff --git a/test/Modules/Inputs/objc-desig-init/X.h b/test/Modules/Inputs/objc-desig-init/X.h new file mode 100644 index 0000000000000..cb46ba70a3746 --- /dev/null +++ b/test/Modules/Inputs/objc-desig-init/X.h @@ -0,0 +1,4 @@ +#import "A2.h" + +@interface X : A2 +@end diff --git a/test/Modules/Inputs/objc-desig-init/module.modulemap b/test/Modules/Inputs/objc-desig-init/module.modulemap new file mode 100644 index 0000000000000..0150efb8eb181 --- /dev/null +++ b/test/Modules/Inputs/objc-desig-init/module.modulemap @@ -0,0 +1,9 @@ +module Base { + header "Base.h" + export * +} + +module A { + header "A.h" + export * +} diff --git a/test/Modules/Inputs/template-default-args/a.h b/test/Modules/Inputs/template-default-args/a.h index 532cbc8be0353..1541d5f6a1b51 100644 --- a/test/Modules/Inputs/template-default-args/a.h +++ b/test/Modules/Inputs/template-default-args/a.h @@ -14,3 +14,16 @@ struct FriendL { template<typename T> friend struct L; }; END + +namespace DeferredLookup { + template<typename T, typename U = T> using X = U; + template<typename T> void f() { (void) X<T>(); } + template<typename T> int n = X<T>(); + template<typename T> struct S { X<T> xt; enum E : int; }; + template<typename T> enum S<T>::E : int { a = X<T>() }; + + namespace Indirect { + template<typename, bool = true> struct A {}; + template<typename> struct B { template<typename T> using C = A<T>; }; + } +} diff --git a/test/Modules/Inputs/template-default-args/d.h b/test/Modules/Inputs/template-default-args/d.h index 5961c91a82ec9..07ececc1f41d4 100644 --- a/test/Modules/Inputs/template-default-args/d.h +++ b/test/Modules/Inputs/template-default-args/d.h @@ -4,3 +4,10 @@ struct FriendL { template<typename T> friend struct L; }; END + +namespace DeferredLookup { + namespace Indirect { + template<typename, bool = true> struct A {}; + template<typename> struct B { template<typename T> using C = A<T>; }; + } +} diff --git a/test/Modules/localsubmodulevis.m b/test/Modules/localsubmodulevis.m index f8c4b3c755eb3..bf317651df968 100644 --- a/test/Modules/localsubmodulevis.m +++ b/test/Modules/localsubmodulevis.m @@ -1,4 +1,4 @@ -// RUN: rm -rf %t +// RUN: rm -rf %t.a %t.b // RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -fimplicit-module-maps -fmodules-cache-path=%t.a -I %S/Inputs/preprocess -verify %s // RUN: %clang_cc1 -fmodules -fmodules-local-submodule-visibility -fimplicit-module-maps -fmodules-cache-path=%t.b -I %S/Inputs/preprocess -x c -verify -x c %s diff --git a/test/Modules/objc-designated-init-mod.m b/test/Modules/objc-designated-init-mod.m new file mode 100644 index 0000000000000..15c25a3ec2ef0 --- /dev/null +++ b/test/Modules/objc-designated-init-mod.m @@ -0,0 +1,17 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/objc-desig-init %s -verify +// expected-no-diagnostics + +#import "X.h" +#import "Base.h" +#import "A.h" + +@implementation X + +- (instancetype)initWithNibName:(NSString *)nibName { + if ((self = [super initWithNibName:nibName])) { + return self; + } + return self; +} +@end diff --git a/test/Modules/template-default-args.cpp b/test/Modules/template-default-args.cpp index 9d16cbf43420c..c51cb28408844 100644 --- a/test/Modules/template-default-args.cpp +++ b/test/Modules/template-default-args.cpp @@ -44,3 +44,20 @@ H<> h; // expected-error {{default argument of 'H' must be imported from module I<> i; L<> *l; END + +namespace DeferredLookup { + template<typename T, typename U = T> using X = U; + template<typename T> void f() { (void) X<T>(); } + template<typename T> int n = X<T>(); // expected-warning {{extension}} + template<typename T> struct S { X<T> xt; enum E : int; }; + template<typename T> enum S<T>::E : int { a = X<T>() }; + + void test() { + f<int>(); + n<int> = 1; + S<int> s; + S<int>::E e = S<int>::E::a; + + Indirect::B<int>::C<int> indirect; + } +} |