[llvm-commits] CVS: llvm/test/Regression/CFrontend/2004-09-27-DidntEmitTemplate.cpp.tr

Chris Lattner lattner at cs.uiuc.edu
Mon Sep 27 20:36:50 PDT 2004



Changes in directory llvm/test/Regression/CFrontend:

2004-09-27-DidntEmitTemplate.cpp.tr added (r1.1)
---
Log message:

Testcase for LLVM PR445: http://llvm.cs.uiuc.edu/PR445 


---
Diffs of the changes:  (+22 -0)

Index: llvm/test/Regression/CFrontend/2004-09-27-DidntEmitTemplate.cpp.tr
diff -c /dev/null llvm/test/Regression/CFrontend/2004-09-27-DidntEmitTemplate.cpp.tr:1.1
*** /dev/null	Mon Sep 27 22:36:49 2004
--- llvm/test/Regression/CFrontend/2004-09-27-DidntEmitTemplate.cpp.tr	Mon Sep 27 22:36:39 2004
***************
*** 0 ****
--- 1,22 ----
+ // RUN: llvmgcc -xc++ %s -c -o - | llvm-dis | grep callDefaultCtor | 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<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>); }
+ 






More information about the llvm-commits mailing list