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/instantiate-temporaries.cpp | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 clang/test/CodeGenCXX/instantiate-temporaries.cpp (limited to 'clang/test/CodeGenCXX/instantiate-temporaries.cpp') diff --git a/clang/test/CodeGenCXX/instantiate-temporaries.cpp b/clang/test/CodeGenCXX/instantiate-temporaries.cpp new file mode 100644 index 0000000..29cfc07 --- /dev/null +++ b/clang/test/CodeGenCXX/instantiate-temporaries.cpp @@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s | FileCheck %s + +struct X { + X(); + ~X(); +}; + +struct Y { + X get(); +}; + +struct X2 { + X x; +}; + +template +void call() { + Y().get(); +} + +// CHECK: define weak_odr void @_Z4callIiEvv +// CHECK: call void @_ZN1Y3getEv +// CHECK-NEXT: call void @_ZN1XD1Ev +// CHECK-NEXT: ret void +template void call(); + +template +void compound_literal() { + (X2){}; +} + +// CHECK: define weak_odr void @_Z16compound_literalIiEvv +// CHECK: call void @_ZN1XC1Ev +// CHECK-NEXT: call void @_ZN2X2D1Ev +// CHECK-NEXT: ret void +template void compound_literal(); + -- cgit v1.2.3