From 009b1c42aa6266385f2c37e227516b24077e6dd7 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 2 Jun 2009 17:52:33 +0000 Subject: Import LLVM, at r72732. --- test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp (limited to 'test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp') diff --git a/test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp b/test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp new file mode 100644 index 0000000000000..706d541bee678 --- /dev/null +++ b/test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp @@ -0,0 +1,23 @@ +// RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep callDefaultCtor | \ +// RUN: not grep declare + +// This is a testcase for LLVM PR445, which was a problem where the +// instantiation of callDefaultCtor was not being emitted correctly. + +struct Pass {}; + +template +Pass *callDefaultCtor() { return new Pass(); } + +void foo(Pass *(*C)()); + +struct basic_string { + bool empty() const { return true; } +}; + + +bool foo2(basic_string &X) { + return X.empty(); +} +void baz() { foo(callDefaultCtor); } + -- cgit v1.2.3