From 102c530d32b06e98b3536841b760fc16e9fac7eb Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Wed, 24 Apr 2024 10:11:02 +0200
Subject: [PATCH] Clarify that 'gcc.dg/initpri3.c' is a LTO variant of
'gcc.dg/initpri1.c': 'gcc.dg/initpri1-lto.c' [PR46083]
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.dg/{initpri3.c => initpri1-lto.c} | 61 +------------------
1 file changed, 1 insertion(+), 60 deletions(-)
rename gcc/testsuite/gcc.dg/{initpri3.c => initpri1-lto.c} (12%)
similarity index 12%
rename from gcc/testsuite/gcc.dg/initpri3.c
rename to gcc/testsuite/gcc.dg/initpri1-lto.c
@@ -2,63 +2,4 @@
/* { 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;
-}
+#include "initpri1.c"
--
2.34.1