Author: chandlerc Date: Thu Mar 26 03:49:55 2015 New Revision: 233263 URL: http://llvm.org/viewvc/llvm-project?rev=233263&view=rev Log: [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.
Modified: cfe/trunk/test/Modules/Inputs/stress1/common.h cfe/trunk/test/Modules/Inputs/stress1/merge00.h Modified: cfe/trunk/test/Modules/Inputs/stress1/common.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/stress1/common.h?rev=233263&r1=233262&r2=233263&view=diff ============================================================================== --- cfe/trunk/test/Modules/Inputs/stress1/common.h (original) +++ cfe/trunk/test/Modules/Inputs/stress1/common.h Thu Mar 26 03:49:55 2015 @@ -5,6 +5,8 @@ inline char function00(char x) { return 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 <typename T> struct S03 { + struct S00 : N00::S00 {}; +}; +template <int I, template <typename> class U> struct S03<U<int>[I]> + : U<int>::S00 { + S03(); + S03(int); + S03(short); + S03(char); + template <typename V = decltype(I)> S03(V); +}; +template <> struct S03<S03<int>[42]> : S00 {}; } namespace N01 { @@ -35,6 +49,14 @@ struct S01 {}; struct S02 {}; } +using namespace N00; + +template <int I, template <typename> class U> template <typename V> S03<U<int>[I]>::S03(V x) : S00(x) {} +template <int I, template <typename> class U> S03<U<int>[I]>::S03() : S00(I) {} +template <int I, template <typename> class U> S03<U<int>[I]>::S03(char x) : S00(x) {} +template <int I, template <typename> class U> S03<U<int>[I]>::S03(short x) : S00(x) {} +template <int I, template <typename> class U> S03<U<int>[I]>::S03(int x) : S00(x) {} + #pragma weak pragma_weak00 #pragma weak pragma_weak01 #pragma weak pragma_weak02 Modified: cfe/trunk/test/Modules/Inputs/stress1/merge00.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/stress1/merge00.h?rev=233263&r1=233262&r2=233263&view=diff ============================================================================== --- cfe/trunk/test/Modules/Inputs/stress1/merge00.h (original) +++ cfe/trunk/test/Modules/Inputs/stress1/merge00.h Thu Mar 26 03:49:55 2015 @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits