aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/global-array-destruction.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-11-18 14:59:57 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-11-18 14:59:57 +0000
commitb3d5a323a5ca92ea73443499cee2f15db1ff0fb3 (patch)
tree60a1694bec5a44d15456acc880cb2f91619f66aa /test/CodeGenCXX/global-array-destruction.cpp
parent8f57cb0305232cb53fff00ef151ca716766f3437 (diff)
Notes
Diffstat (limited to 'test/CodeGenCXX/global-array-destruction.cpp')
-rw-r--r--test/CodeGenCXX/global-array-destruction.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/CodeGenCXX/global-array-destruction.cpp b/test/CodeGenCXX/global-array-destruction.cpp
new file mode 100644
index 000000000000..ebea9c156e27
--- /dev/null
+++ b/test/CodeGenCXX/global-array-destruction.cpp
@@ -0,0 +1,33 @@
+// RUN: clang-cc -triple x86_64-apple-darwin -std=c++0x -S %s -o %t-64.s
+// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
+
+extern "C" int printf(...);
+
+int count;
+
+struct S {
+ S() : iS(++count) { printf("S::S(%d)\n", iS); }
+ ~S() { printf("S::~S(%d)\n", iS); }
+ int iS;
+};
+
+
+S arr[2][1];
+S s1;
+S arr1[3];
+static S sarr[4];
+
+int main () {}
+S arr2[2];
+static S sarr1[4];
+S s2;
+S arr3[3];
+
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit
+// CHECK-LP64: call ___cxa_atexit