1762bb9d0ad20320b9f97a841dce57ba5e8e48b07Richard Smith// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s 29370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregor 39370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregortemplate<typename ...Types> 49370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregorint get_num_types(Types...) { 59370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregor return sizeof...(Types); 69370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregor} 79370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregor 8dce73976163207916d5e6eb9529090ea7f70219eDouglas Gregor// CHECK: define weak_odr i32 @_Z13get_num_typesIJifdEEiDpT_ 99370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregor// CHECK: ret i32 3 109370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregortemplate int get_num_types(int, float, double); 119370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregor 12c8fc90a854b4ccba21c85884676a80334159dd94John McCall// PR10260 - argument packs that expand to nothing 13c8fc90a854b4ccba21c85884676a80334159dd94John McCallnamespace test1 { 14c8fc90a854b4ccba21c85884676a80334159dd94John McCall template <class... T> void foo() { 15c8fc90a854b4ccba21c85884676a80334159dd94John McCall int values[sizeof...(T)+1] = { T::value... }; 16c8fc90a854b4ccba21c85884676a80334159dd94John McCall // CHECK: define linkonce_odr void @_ZN5test13fooIJEEEvv() 17c8fc90a854b4ccba21c85884676a80334159dd94John McCall // CHECK: alloca [1 x i32], align 4 18c8fc90a854b4ccba21c85884676a80334159dd94John McCall } 199370c8f4af43a98a6f16e65f5d88d58db846e374Douglas Gregor 20c8fc90a854b4ccba21c85884676a80334159dd94John McCall void test() { 21c8fc90a854b4ccba21c85884676a80334159dd94John McCall foo<>(); 22c8fc90a854b4ccba21c85884676a80334159dd94John McCall } 23c8fc90a854b4ccba21c85884676a80334159dd94John McCall} 24