summaryrefslogtreecommitdiff
path: root/test/C++Frontend
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-13 19:40:31 +0000
committerChris Lattner <sabre@nondot.org>2003-05-13 19:40:31 +0000
commit5bd1acc0d6c9b5bbb33625bfda6ae4e0acbf9190 (patch)
tree7ba275c48fd47f56b159b18ad788b9ae01b0b8aa /test/C++Frontend
parent36bd5b04fa29f062a862a731de7d20a3f0f3fe80 (diff)
downloadllvm-5bd1acc0d6c9b5bbb33625bfda6ae4e0acbf9190.tar.gz
llvm-5bd1acc0d6c9b5bbb33625bfda6ae4e0acbf9190.tar.bz2
llvm-5bd1acc0d6c9b5bbb33625bfda6ae4e0acbf9190.tar.xz
Make testcase executable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/C++Frontend')
-rw-r--r--test/C++Frontend/global_ctor.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/test/C++Frontend/global_ctor.cpp b/test/C++Frontend/global_ctor.cpp
index ebca6b59a5..e8b595d8f2 100644
--- a/test/C++Frontend/global_ctor.cpp
+++ b/test/C++Frontend/global_ctor.cpp
@@ -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;
+}