From 6e40af1ab06b897d05a0f980156406ac5635b1e7 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 12 Aug 2004 02:51:31 +0000 Subject: [PATCH] re PR c++/16717 ([unit-at-a-time] __attribute__((constructor)) broken in C++) PR c++/16717 * g++.dg/ext/construct1.C: New test. From-SVN: r85844 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/ext/construct1.C | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 gcc/testsuite/g++.dg/ext/construct1.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a721a75a093..dd98c39fc03 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-08-11 Mark Mitchell + + PR c++/16717 + * g++.dg/ext/construct1.C: New test. + 2004-08-11 Mark Mitchell 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 index 00000000000..6a7d8cee403 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/construct1.C @@ -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; +} -- 2.30.2