[gcc r15-1028] Add 'c-c++-common/initpri1{, -lto, -split}-static.c' as internal linkage variants

Thomas Schwinge tschwinge@gcc.gnu.org
Wed Jun 5 07:04:15 GMT 2024


https://gcc.gnu.org/g:d5ccc21f17b5c7ff20cca81c96a11a68f61f287b

commit r15-1028-gd5ccc21f17b5c7ff20cca81c96a11a68f61f287b
Author: Thomas Schwinge <tschwinge@baylibre.com>
Date:   Wed Apr 24 11:51:54 2024 +0200

    Add 'c-c++-common/initpri1{,-lto,-split}-static.c' as internal linkage variants
    
            gcc/testsuite/
            * c-c++-common/initpri1_part_c1.c: Consider 'CDTOR_LINKAGE'.
            * c-c++-common/initpri1_part_c2.c: Likewise.
            * c-c++-common/initpri1_part_c3.c: Likewise.
            * c-c++-common/initpri1_part_cd4.c: Likewise.
            * c-c++-common/initpri1_part_d1.c: Likewise.
            * c-c++-common/initpri1_part_d2.c: Likewise.
            * c-c++-common/initpri1_part_d3.c: Likewise.
            * c-c++-common/initpri1.c: Specify it.
            * c-c++-common/initpri1-lto.c: Likewise.
            * c-c++-common/initpri1-split.c: Likewise.
            * c-c++-common/initpri1-static.c: New.
            * c-c++-common/initpri1-lto-static.c: Likewise.
            * c-c++-common/initpri1-split-static.c: Likewise.

Diff:
---
 gcc/testsuite/c-c++-common/initpri1-lto-static.c   | 7 +++++++
 gcc/testsuite/c-c++-common/initpri1-lto.c          | 1 +
 gcc/testsuite/c-c++-common/initpri1-split-static.c | 4 ++++
 gcc/testsuite/c-c++-common/initpri1-split.c        | 1 +
 gcc/testsuite/c-c++-common/initpri1-static.c       | 5 +++++
 gcc/testsuite/c-c++-common/initpri1.c              | 1 +
 gcc/testsuite/c-c++-common/initpri1_part_c1.c      | 2 ++
 gcc/testsuite/c-c++-common/initpri1_part_c2.c      | 2 ++
 gcc/testsuite/c-c++-common/initpri1_part_c3.c      | 2 ++
 gcc/testsuite/c-c++-common/initpri1_part_cd4.c     | 2 ++
 gcc/testsuite/c-c++-common/initpri1_part_d1.c      | 2 ++
 gcc/testsuite/c-c++-common/initpri1_part_d2.c      | 2 ++
 gcc/testsuite/c-c++-common/initpri1_part_d3.c      | 2 ++
 13 files changed, 33 insertions(+)

diff --git a/gcc/testsuite/c-c++-common/initpri1-lto-static.c b/gcc/testsuite/c-c++-common/initpri1-lto-static.c
new file mode 100644
index 00000000000..6393f7ec99b
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1-lto-static.c
@@ -0,0 +1,7 @@
+/* { dg-do run { target init_priority } } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -O3" } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient.  */
+/* { dg-additional-options -DCDTOR_LINKAGE=static } */
+
+#include "initpri1.c"
diff --git a/gcc/testsuite/c-c++-common/initpri1-lto.c b/gcc/testsuite/c-c++-common/initpri1-lto.c
index 433ef356c7e..7fb4bf1aa82 100644
--- a/gcc/testsuite/c-c++-common/initpri1-lto.c
+++ b/gcc/testsuite/c-c++-common/initpri1-lto.c
@@ -2,5 +2,6 @@
 /* { dg-require-effective-target lto } */
 /* { dg-options "-flto -O3" } */
 /* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient.  */
+/* { dg-additional-options -DCDTOR_LINKAGE= } */
 
 #include "initpri1.c"
diff --git a/gcc/testsuite/c-c++-common/initpri1-split-static.c b/gcc/testsuite/c-c++-common/initpri1-split-static.c
new file mode 100644
index 00000000000..02d8b162e19
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1-split-static.c
@@ -0,0 +1,4 @@
+/* { dg-do run { target init_priority } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient.  */
+/* { dg-additional-sources {initpri1_part_c1.c initpri1_part_c2.c initpri1_part_c3.c initpri1_part_d1.c initpri1_part_d2.c initpri1_part_d3.c initpri1_part_cd4.c initpri1_part_main.c} } */
+/* { dg-additional-options -DCDTOR_LINKAGE=static } */
diff --git a/gcc/testsuite/c-c++-common/initpri1-split.c b/gcc/testsuite/c-c++-common/initpri1-split.c
index 11755ee9f6a..f1482c7e0c1 100644
--- a/gcc/testsuite/c-c++-common/initpri1-split.c
+++ b/gcc/testsuite/c-c++-common/initpri1-split.c
@@ -1,3 +1,4 @@
 /* { dg-do run { target init_priority } } */
 /* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient.  */
 /* { dg-additional-sources {initpri1_part_c1.c initpri1_part_c2.c initpri1_part_c3.c initpri1_part_d1.c initpri1_part_d2.c initpri1_part_d3.c initpri1_part_cd4.c initpri1_part_main.c} } */
+/* { dg-additional-options -DCDTOR_LINKAGE= } */
diff --git a/gcc/testsuite/c-c++-common/initpri1-static.c b/gcc/testsuite/c-c++-common/initpri1-static.c
new file mode 100644
index 00000000000..ac101ff63cb
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1-static.c
@@ -0,0 +1,5 @@
+/* { dg-do run { target init_priority } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient.  */
+/* { dg-additional-options -DCDTOR_LINKAGE=static } */
+
+#include "initpri1.c"
diff --git a/gcc/testsuite/c-c++-common/initpri1.c b/gcc/testsuite/c-c++-common/initpri1.c
index f50137a489b..73579cdd06b 100644
--- a/gcc/testsuite/c-c++-common/initpri1.c
+++ b/gcc/testsuite/c-c++-common/initpri1.c
@@ -1,5 +1,6 @@
 /* { dg-do run { target init_priority } } */
 /* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient.  */
+/* { dg-additional-options -DCDTOR_LINKAGE= } */
 
 #include "initpri1_part_c1.c"
 
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_c1.c b/gcc/testsuite/c-c++-common/initpri1_part_c1.c
index 0f85a2e6cb1..da2f4e6c0bc 100644
--- a/gcc/testsuite/c-c++-common/initpri1_part_c1.c
+++ b/gcc/testsuite/c-c++-common/initpri1_part_c1.c
@@ -3,8 +3,10 @@
 
 extern int i;
 
+CDTOR_LINKAGE
 void c1() __attribute__((constructor (500)));
 
+CDTOR_LINKAGE
 void c1() {
   if (i++ != 0)
     __builtin_abort ();
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_c2.c b/gcc/testsuite/c-c++-common/initpri1_part_c2.c
index e8c556aab17..926608dc0d9 100644
--- a/gcc/testsuite/c-c++-common/initpri1_part_c2.c
+++ b/gcc/testsuite/c-c++-common/initpri1_part_c2.c
@@ -3,8 +3,10 @@
 
 extern int i;
 
+CDTOR_LINKAGE
 void c2() __attribute__((constructor (700)));
 
+CDTOR_LINKAGE
 void c2() {
   if (i++ != 2)
     __builtin_abort ();
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_c3.c b/gcc/testsuite/c-c++-common/initpri1_part_c3.c
index 70880882ce3..59941ce7428 100644
--- a/gcc/testsuite/c-c++-common/initpri1_part_c3.c
+++ b/gcc/testsuite/c-c++-common/initpri1_part_c3.c
@@ -3,8 +3,10 @@
 
 extern int i;
 
+CDTOR_LINKAGE
 void c3() __attribute__((constructor (600)));
 
+CDTOR_LINKAGE
 void c3() {
   if (i++ != 1)
     __builtin_abort ();
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_cd4.c b/gcc/testsuite/c-c++-common/initpri1_part_cd4.c
index b67ff90d9fe..c209db3718e 100644
--- a/gcc/testsuite/c-c++-common/initpri1_part_cd4.c
+++ b/gcc/testsuite/c-c++-common/initpri1_part_cd4.c
@@ -4,8 +4,10 @@
 extern int i;
 extern int j;
 
+CDTOR_LINKAGE
 void cd4() __attribute__((constructor (800), destructor (800)));
 
+CDTOR_LINKAGE
 void cd4() {
   if (i != 3)
     __builtin_abort ();
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_d1.c b/gcc/testsuite/c-c++-common/initpri1_part_d1.c
index 099df37e97c..817603e275b 100644
--- a/gcc/testsuite/c-c++-common/initpri1_part_d1.c
+++ b/gcc/testsuite/c-c++-common/initpri1_part_d1.c
@@ -3,8 +3,10 @@
 
 extern int i;
 
+CDTOR_LINKAGE
 void d1() __attribute__((destructor (500)));
 
+CDTOR_LINKAGE
 void d1() {
   if (--i != 0)
     __builtin_abort ();
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_d2.c b/gcc/testsuite/c-c++-common/initpri1_part_d2.c
index 258cbbc495f..1dcb7367726 100644
--- a/gcc/testsuite/c-c++-common/initpri1_part_d2.c
+++ b/gcc/testsuite/c-c++-common/initpri1_part_d2.c
@@ -3,8 +3,10 @@
 
 extern int i;
 
+CDTOR_LINKAGE
 void d2() __attribute__((destructor (700)));
 
+CDTOR_LINKAGE
 void d2() {
   if (--i != 2)
     __builtin_abort ();
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_d3.c b/gcc/testsuite/c-c++-common/initpri1_part_d3.c
index 1242d411b07..ae290fa4594 100644
--- a/gcc/testsuite/c-c++-common/initpri1_part_d3.c
+++ b/gcc/testsuite/c-c++-common/initpri1_part_d3.c
@@ -4,8 +4,10 @@
 extern int i;
 extern int j;
 
+CDTOR_LINKAGE
 void d3() __attribute__((destructor (600)));
 
+CDTOR_LINKAGE
 void d3() {
   if (j != 2)
     __builtin_abort ();


More information about the Gcc-cvs mailing list