diff options
Diffstat (limited to 'test/CodeGenCXX/mangle.cpp')
-rw-r--r-- | test/CodeGenCXX/mangle.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index 03e405e..62d8c6c 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -208,8 +208,9 @@ void extern_f(void); void extern_f(void) { } struct S7 { - struct S { S(); }; + S7(); + struct S { S(); }; struct { S s; } a; @@ -227,3 +228,31 @@ template<typename T> typename __enable_if<(__is_scalar<T>::__value), void>::__ty template void ft8<int>(); // CHECK: @_Z3ft8IPvEN11__enable_ifIXsr11__is_scalarIT_E7__valueEvE6__typeEv template void ft8<void*>(); + +namespace Expressions { +// Unary operators. + +// CHECK: define void @_ZN11Expressions2f1ILi1EEEvPAplngT_Li2E_i +template <int i> void f1(int (*)[(-i) + 2]) { }; +template void f1<1>(int (*)[1]); + +// CHECK: define void @_ZN11Expressions2f2ILi1EEEvPApsT__i +template <int i> void f2(int (*)[+i]) { }; +template void f2<1>(int (*)[1]); + +// Binary operators. + +// CHECK: define void @_ZN11Expressions2f3ILi1EEEvPAplT_T__i +template <int i> void f3(int (*)[i+i]) { }; +template void f3<1>(int (*)[2]); + +// CHECK: define void @_ZN11Expressions2f4ILi1EEEvPAplplLi2ET_T__i +template <int i> void f4(int (*)[2 + i+i]) { }; +template void f4<1>(int (*)[4]); + +// The ternary operator. +// CHECK: define void @_ZN11Expressions2f4ILb1EEEvPAquT_Li1ELi2E_i +template <bool b> void f4(int (*)[b ? 1 : 2]) { }; +template void f4<true>(int (*)[1]); + +} |