blob: 4974b6517b89fd45e192d29b095e6947112db474 [file] [log] [blame]
Richard Smith9ca5c422011-10-13 22:29:44 +00001// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
Douglas Gregorbe7b5482011-01-12 22:11:34 +00002
3template<typename ...Types>
4int get_num_types(Types...) {
5 return sizeof...(Types);
6}
7
Stephen Lin43622612013-08-15 06:47:53 +00008// CHECK-LABEL: define weak_odr i32 @_Z13get_num_typesIJifdEEiDpT_
Douglas Gregorbe7b5482011-01-12 22:11:34 +00009// CHECK: ret i32 3
10template int get_num_types(int, float, double);
11
John McCall542e7c62011-07-06 07:30:07 +000012// PR10260 - argument packs that expand to nothing
13namespace test1 {
14 template <class... T> void foo() {
15 int values[sizeof...(T)+1] = { T::value... };
Stephen Lin43622612013-08-15 06:47:53 +000016 // CHECK-LABEL: define linkonce_odr void @_ZN5test13fooIJEEEvv()
John McCall542e7c62011-07-06 07:30:07 +000017 // CHECK: alloca [1 x i32], align 4
18 }
Douglas Gregorbe7b5482011-01-12 22:11:34 +000019
John McCall542e7c62011-07-06 07:30:07 +000020 void test() {
21 foo<>();
22 }
23}