From: Chandler Carruth Date: Thu, 26 Mar 2015 08:49:55 +0000 (+0000) Subject: [Modules] Add some more fun code to my modules stress test, this time X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=010ade63adaab8b8d383c4d1f66da2a75b061758;p=clang [Modules] Add some more fun code to my modules stress test, this time templates. Turns out all of this works correctly (so far). But it should cover more code paths and will let me test some things that don't actually work next. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233263 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Modules/Inputs/stress1/common.h b/test/Modules/Inputs/stress1/common.h index b158a8e6c1..b52520ee8f 100644 --- a/test/Modules/Inputs/stress1/common.h +++ b/test/Modules/Inputs/stress1/common.h @@ -5,6 +5,8 @@ inline char function00(char x) { return x + x; } inline short function00(short x) { return x + x; } inline int function00(int x) { return x + x; } +namespace N01 { struct S00; } + namespace N00 { struct S00 { char c; @@ -24,7 +26,19 @@ struct S00 { operator int() { return i; } }; struct S01 {}; -struct S03 {}; +struct S02 {}; +template struct S03 { + struct S00 : N00::S00 {}; +}; +template class U> struct S03[I]> + : U::S00 { + S03(); + S03(int); + S03(short); + S03(char); + template S03(V); +}; +template <> struct S03[42]> : S00 {}; } namespace N01 { @@ -35,6 +49,14 @@ struct S01 {}; struct S02 {}; } +using namespace N00; + +template class U> template S03[I]>::S03(V x) : S00(x) {} +template class U> S03[I]>::S03() : S00(I) {} +template class U> S03[I]>::S03(char x) : S00(x) {} +template class U> S03[I]>::S03(short x) : S00(x) {} +template class U> S03[I]>::S03(int x) : S00(x) {} + #pragma weak pragma_weak00 #pragma weak pragma_weak01 #pragma weak pragma_weak02 diff --git a/test/Modules/Inputs/stress1/merge00.h b/test/Modules/Inputs/stress1/merge00.h index b769b0877d..fc1b4f8118 100644 --- a/test/Modules/Inputs/stress1/merge00.h +++ b/test/Modules/Inputs/stress1/merge00.h @@ -14,7 +14,7 @@ #include "m02.h" #include "m03.h" -inline int g() { return N00::S00('a').method00('b') + (int)N00::S00(42) + function00(42); } +inline int g() { return N00::S00('a').method00('b') + (int)S00(42) + function00(42); } #pragma weak pragma_weak02 #pragma weak pragma_weak05