summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-08-20 00:09:39 +0000
committerEric Christopher <echristo@apple.com>2011-08-20 00:09:39 +0000
commit6672b33511792e0dc9bf5654513a423b4fe3fa54 (patch)
treecdf39e453331b00fa56ec8e1b43d3ac97fe4b67d /clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp
parent74cfab0fbef4215fe349d43b733ce3bd8ce5755f (diff)
downloadbcm5719-llvm-6672b33511792e0dc9bf5654513a423b4fe3fa54.tar.gz
bcm5719-llvm-6672b33511792e0dc9bf5654513a423b4fe3fa54.zip
Migrate, FileCheckize and update:
2004-03-08-ReinterpretCastCopy.cpp 2004-03-09-UnmangledBuiltinMethods.cpp 2004-03-15-CleanupsAndGotos.cpp 2004-06-08-LateTemplateInstantiation.cpp 2004-09-27-CompilerCrash.cpp 2004-09-27-DidntEmitTemplate.cpp 2004-11-27-ExceptionCleanupAssertion.cpp 2004-11-27-FriendDefaultArgCrash.cpp 2005-01-03-StaticInitializers.cpp from llvm/test/FrontendC++. llvm-svn: 138157
Diffstat (limited to 'clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp')
-rw-r--r--clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp b/clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp
new file mode 100644
index 00000000000..618894fd724
--- /dev/null
+++ b/clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+
+// This is a testcase for LLVM PR445, which was a problem where the
+// instantiation of callDefaultCtor was not being emitted correctly.
+
+// CHECK-NOT: declare{{.*}}callDefaultCtor
+struct Pass {};
+
+template<typename PassName>
+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<Pass>); }
OpenPOWER on IntegriCloud