From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenCXX/variadic-templates.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 clang/test/CodeGenCXX/variadic-templates.cpp (limited to 'clang/test/CodeGenCXX/variadic-templates.cpp') diff --git a/clang/test/CodeGenCXX/variadic-templates.cpp b/clang/test/CodeGenCXX/variadic-templates.cpp new file mode 100644 index 0000000..c56bec3 --- /dev/null +++ b/clang/test/CodeGenCXX/variadic-templates.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s + +template +int get_num_types(Types...) { + return sizeof...(Types); +} + +// CHECK: define weak_odr i32 @_Z13get_num_typesIJifdEEiDpT_ +// CHECK: ret i32 3 +template int get_num_types(int, float, double); + +// PR10260 - argument packs that expand to nothing +namespace test1 { + template void foo() { + int values[sizeof...(T)+1] = { T::value... }; + // CHECK: define linkonce_odr void @_ZN5test13fooIJEEEvv() + // CHECK: alloca [1 x i32], align 4 + } + + void test() { + foo<>(); + } +} -- cgit v1.2.3