]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Clarify that 'gcc.dg/initpri3.c' is a LTO variant of 'gcc.dg/initpri1.c': 'gcc.dg...
authorThomas Schwinge <tschwinge@baylibre.com>
Wed, 24 Apr 2024 08:11:02 +0000 (10:11 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Wed, 5 Jun 2024 07:01:21 +0000 (09:01 +0200)
Added in commit 06c9eb5136fe0e778cc3a643131eba2a3dfb77a8 (Subversion r168642)
"re PR lto/46083 (gcc.dg/initpri1.c FAILs with -flto/-fwhopr (attribute constructor/destructor doesn't work))".

PR lto/46083
gcc/testsuite/
* gcc.dg/initpri3.c: Remove.
* gcc.dg/initpri1-lto.c: New.

gcc/testsuite/gcc.dg/initpri1-lto.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/initpri3.c [deleted file]

diff --git a/gcc/testsuite/gcc.dg/initpri1-lto.c b/gcc/testsuite/gcc.dg/initpri1-lto.c
new file mode 100644 (file)
index 0000000..98a43c3
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run { target init_priority } } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -O3" } */
+
+#include "initpri1.c"
diff --git a/gcc/testsuite/gcc.dg/initpri3.c b/gcc/testsuite/gcc.dg/initpri3.c
deleted file mode 100644 (file)
index 1633da0..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/* { dg-do run { target init_priority } } */
-/* { dg-require-effective-target lto } */
-/* { dg-options "-flto -O3" } */
-
-extern void abort ();
-
-int i;
-int j;
-
-void c1() __attribute__((constructor (500)));
-void c2() __attribute__((constructor (700)));
-void c3() __attribute__((constructor (600)));
-
-void c1() {
-  if (i++ != 0)
-    abort ();
-}
-
-void c2() {
-  if (i++ != 2)
-    abort ();
-}
-
-void c3() {
-  if (i++ != 1)
-    abort ();
-}
-
-void d1() __attribute__((destructor (500)));
-void d2() __attribute__((destructor (700)));
-void d3() __attribute__((destructor (600)));
-
-void d1() {
-  if (--i != 0)
-    abort ();
-}
-
-void d2() {
-  if (--i != 2)
-    abort ();
-}
-
-void d3() {
-  if (j != 2)
-    abort ();
-  if (--i != 1)
-    abort ();
-}
-
-void cd4() __attribute__((constructor (800), destructor (800)));
-
-void cd4() {
-  if (i != 3)
-    abort ();
-  ++j;
-}
-
-int main () {
-  if (i != 3)
-    return 1;
-  if (j != 1)
-    abort ();
-  return 0;
-}