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

Chris Lattner lattner at cs.uiuc.edu
Tue Nov 30 10:25:24 PST 2004



Changes in directory llvm/test/Regression/C++Frontend:

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

Move this from the C test suite



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

Index: llvm/test/Regression/C++Frontend/2004-09-27-DidntEmitTemplate.cpp.tr
diff -c /dev/null llvm/test/Regression/C++Frontend/2004-09-27-DidntEmitTemplate.cpp.tr:1.1
*** /dev/null	Tue Nov 30 12:25:22 2004
--- llvm/test/Regression/C++Frontend/2004-09-27-DidntEmitTemplate.cpp.tr	Tue Nov 30 12:25:12 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