re PR c++/16717 ([unit-at-a-time] __attribute__((constructor)) broken in C++)
authorMark Mitchell <mark@codesourcery.com>
Thu, 12 Aug 2004 02:51:31 +0000 (02:51 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 12 Aug 2004 02:51:31 +0000 (02:51 +0000)
PR c++/16717
* g++.dg/ext/construct1.C: New test.

From-SVN: r85844

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/construct1.C [new file with mode: 0644]

index a721a75a09372eb0191f3c2fd107b06d8fa45fd5..dd98c39fc03917702deb3196f9a8d75c0933058a 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-11  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/16717
+       * g++.dg/ext/construct1.C: New test.
+
 2004-08-11  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/16853
diff --git a/gcc/testsuite/g++.dg/ext/construct1.C b/gcc/testsuite/g++.dg/ext/construct1.C
new file mode 100644 (file)
index 0000000..6a7d8ce
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/16717
+// { dg-options "-O2" }
+
+int i;
+
+void hello (void) __attribute__ ((constructor));
+void hello (void) { i = 1; }
+
+int main (void) {
+  if (i != 1)
+    return 1;
+}