[llvm-commits] CVS: llvm/test/Regression/C++Frontend/global_ctor.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue May 13 14:41:02 PDT 2003
Changes in directory llvm/test/Regression/C++Frontend:
global_ctor.cpp updated: 1.1 -> 1.2
---
Log message:
Make testcase executable
---
Diffs of the changes:
Index: llvm/test/Regression/C++Frontend/global_ctor.cpp
diff -u llvm/test/Regression/C++Frontend/global_ctor.cpp:1.1 llvm/test/Regression/C++Frontend/global_ctor.cpp:1.2
--- llvm/test/Regression/C++Frontend/global_ctor.cpp:1.1 Tue May 13 13:09:44 2003
+++ llvm/test/Regression/C++Frontend/global_ctor.cpp Tue May 13 14:40:31 2003
@@ -1,11 +1,27 @@
-int array[] = { 1, 2, 3, 4 };
+#include <stdio.h>
+//extern int printf(const char *, ...);
-struct foo {
- foo() throw();
-} Constructor1; // Global with ctor to be called before main
+int CN = 0;
+int DN = 0;
-foo Constructor2;
+struct foo {
+ int Num;
+ foo(int num) : Num(num) {
+ printf("Foo ctor %d %d\n", Num, CN++);
+ }
+ ~foo() {
+ printf("Foo dtor %d %d\n", Num, DN++);
+ }
+} Constructor1(7); // Global with ctor to be called before main
+foo Constructor2(12);
struct bar {
- ~bar() throw();
+ ~bar() {
+ printf("bar dtor\n");
+ }
} Destructor1; // Global with dtor
+
+int main() {
+ printf("main\n");
+ return 0;
+}
More information about the llvm-commits
mailing list