Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s |
Douglas Gregor | 9370c8f | 2011-01-12 22:11:34 +0000 | [diff] [blame] | 2 | |
| 3 | template<typename ...Types> |
| 4 | int get_num_types(Types...) { |
| 5 | return sizeof...(Types); |
| 6 | } |
| 7 | |
Douglas Gregor | dce7397 | 2011-01-13 18:03:24 +0000 | [diff] [blame] | 8 | // CHECK: define weak_odr i32 @_Z13get_num_typesIJifdEEiDpT_ |
Douglas Gregor | 9370c8f | 2011-01-12 22:11:34 +0000 | [diff] [blame] | 9 | // CHECK: ret i32 3 |
| 10 | template int get_num_types(int, float, double); |
| 11 | |
John McCall | c8fc90a | 2011-07-06 07:30:07 +0000 | [diff] [blame] | 12 | // PR10260 - argument packs that expand to nothing |
| 13 | namespace test1 { |
| 14 | template <class... T> void foo() { |
| 15 | int values[sizeof...(T)+1] = { T::value... }; |
| 16 | // CHECK: define linkonce_odr void @_ZN5test13fooIJEEEvv() |
| 17 | // CHECK: alloca [1 x i32], align 4 |
| 18 | } |
Douglas Gregor | 9370c8f | 2011-01-12 22:11:34 +0000 | [diff] [blame] | 19 | |
John McCall | c8fc90a | 2011-07-06 07:30:07 +0000 | [diff] [blame] | 20 | void test() { |
| 21 | foo<>(); |
| 22 | } |
| 23 | } |