• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s -Xcc -DSEQ | FileCheck --check-prefix=CHECK-SEQ %s
2 // RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s -Xcc -DPACK | FileCheck --check-prefix=CHECK-PACK %s
3 // RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s -Xcc -DPACK -Xcc -DSEQ | FileCheck --check-prefixes=CHECK-SEQ,CHECK-PACK %s
4 
5 // CHECK-SEQ: BuiltinTemplateDecl
6 // CHECK-SEQ-SAME: <invalid sloc>
7 // CHECK-SEQ-SAME: implicit
8 // CHECK-SEQ-SAME: __make_integer_seq
9 
10 // CHECK-PACK: BuiltinTemplateDecl
11 // CHECK-PACK-SAME: <invalid sloc>
12 // CHECK-PACK-SAME: implicit
13 // CHECK-PACK-SAME: __type_pack_element
14 
expr()15 void expr() {
16 #ifdef SEQ
17   typedef MakeSeq<int, 3> M1;
18   M1 m1;
19   typedef MakeSeq<long, 4> M2;
20   M2 m2;
21   static_assert(M1::PackSize == 3, "");
22   static_assert(M2::PackSize == 4, "");
23 #endif
24 
25 #ifdef PACK
26   static_assert(__is_same(TypePackElement<0, X<0>>, X<0>), "");
27   static_assert(__is_same(TypePackElement<0, X<0>, X<1>>, X<0>), "");
28   static_assert(__is_same(TypePackElement<1, X<0>, X<1>>, X<1>), "");
29 #endif
30 }
31