aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-04-24 11:24:39 +0200
committerThomas Schwinge <tschwinge@baylibre.com>2024-06-05 09:02:46 +0200
commit02e43e5596ee6a4d03eecaa48197280c4eb6a78f (patch)
tree0d0683a169a5dc62817d3d396585adfc6589c07e
parent08c7e87f0da24b701042110c3927ecdb3367c0b4 (diff)
downloadgcc-02e43e5596ee6a4d03eecaa48197280c4eb6a78f.zip
gcc-02e43e5596ee6a4d03eecaa48197280c4eb6a78f.tar.gz
gcc-02e43e5596ee6a4d03eecaa48197280c4eb6a78f.tar.bz2
Add 'c-c++-common/initpri1-split.c': 'c-c++-common/initpri1.c' split into separate translation units
gcc/testsuite/ * c-c++-common/initpri1.c: Split into... * c-c++-common/initpri1_part_c1.c: ... this, and... * c-c++-common/initpri1_part_c2.c: ... this, and... * c-c++-common/initpri1_part_c3.c: ... this, and... * c-c++-common/initpri1_part_cd4.c: ... this, and... * c-c++-common/initpri1_part_d1.c: ... this, and... * c-c++-common/initpri1_part_d2.c: ... this, and... * c-c++-common/initpri1_part_d3.c: ... this, and... * c-c++-common/initpri1_part_main.c: ... this part. * c-c++-common/initpri1-split.c: New.
-rw-r--r--gcc/testsuite/c-c++-common/initpri1-split.c3
-rw-r--r--gcc/testsuite/c-c++-common/initpri1.c73
-rw-r--r--gcc/testsuite/c-c++-common/initpri1_part_c1.c11
-rw-r--r--gcc/testsuite/c-c++-common/initpri1_part_c2.c11
-rw-r--r--gcc/testsuite/c-c++-common/initpri1_part_c3.c11
-rw-r--r--gcc/testsuite/c-c++-common/initpri1_part_cd4.c13
-rw-r--r--gcc/testsuite/c-c++-common/initpri1_part_d1.c11
-rw-r--r--gcc/testsuite/c-c++-common/initpri1_part_d2.c11
-rw-r--r--gcc/testsuite/c-c++-common/initpri1_part_d3.c14
-rw-r--r--gcc/testsuite/c-c++-common/initpri1_part_main.c13
10 files changed, 113 insertions, 58 deletions
diff --git a/gcc/testsuite/c-c++-common/initpri1-split.c b/gcc/testsuite/c-c++-common/initpri1-split.c
new file mode 100644
index 0000000..11755ee
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1-split.c
@@ -0,0 +1,3 @@
+/* { 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} } */
diff --git a/gcc/testsuite/c-c++-common/initpri1.c b/gcc/testsuite/c-c++-common/initpri1.c
index 387f2a3..f50137a 100644
--- a/gcc/testsuite/c-c++-common/initpri1.c
+++ b/gcc/testsuite/c-c++-common/initpri1.c
@@ -1,61 +1,18 @@
/* { dg-do run { target init_priority } } */
/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
-int i;
-int j;
-
-void c1() __attribute__((constructor (500)));
-void c2() __attribute__((constructor (700)));
-void c3() __attribute__((constructor (600)));
-
-void c1() {
- if (i++ != 0)
- __builtin_abort ();
-}
-
-void c2() {
- if (i++ != 2)
- __builtin_abort ();
-}
-
-void c3() {
- if (i++ != 1)
- __builtin_abort ();
-}
-
-void d1() __attribute__((destructor (500)));
-void d2() __attribute__((destructor (700)));
-void d3() __attribute__((destructor (600)));
-
-void d1() {
- if (--i != 0)
- __builtin_abort ();
-}
-
-void d2() {
- if (--i != 2)
- __builtin_abort ();
-}
-
-void d3() {
- if (j != 2)
- __builtin_abort ();
- if (--i != 1)
- __builtin_abort ();
-}
-
-void cd4() __attribute__((constructor (800), destructor (800)));
-
-void cd4() {
- if (i != 3)
- __builtin_abort ();
- ++j;
-}
-
-int main () {
- if (i != 3)
- return 1;
- if (j != 1)
- __builtin_abort ();
- return 0;
-}
+#include "initpri1_part_c1.c"
+
+#include "initpri1_part_c2.c"
+
+#include "initpri1_part_c3.c"
+
+#include "initpri1_part_d1.c"
+
+#include "initpri1_part_d2.c"
+
+#include "initpri1_part_d3.c"
+
+#include "initpri1_part_cd4.c"
+
+#include "initpri1_part_main.c"
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_c1.c b/gcc/testsuite/c-c++-common/initpri1_part_c1.c
new file mode 100644
index 0000000..0f85a2e
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1_part_c1.c
@@ -0,0 +1,11 @@
+/* { dg-skip-if part { *-*-* } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+extern int i;
+
+void c1() __attribute__((constructor (500)));
+
+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
new file mode 100644
index 0000000..e8c556a
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1_part_c2.c
@@ -0,0 +1,11 @@
+/* { dg-skip-if part { *-*-* } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+extern int i;
+
+void c2() __attribute__((constructor (700)));
+
+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
new file mode 100644
index 0000000..7088088
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1_part_c3.c
@@ -0,0 +1,11 @@
+/* { dg-skip-if part { *-*-* } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+extern int i;
+
+void c3() __attribute__((constructor (600)));
+
+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
new file mode 100644
index 0000000..b67ff90
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1_part_cd4.c
@@ -0,0 +1,13 @@
+/* { dg-skip-if part { *-*-* } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+extern int i;
+extern int j;
+
+void cd4() __attribute__((constructor (800), destructor (800)));
+
+void cd4() {
+ if (i != 3)
+ __builtin_abort ();
+ ++j;
+}
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_d1.c b/gcc/testsuite/c-c++-common/initpri1_part_d1.c
new file mode 100644
index 0000000..099df37
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1_part_d1.c
@@ -0,0 +1,11 @@
+/* { dg-skip-if part { *-*-* } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+extern int i;
+
+void d1() __attribute__((destructor (500)));
+
+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
new file mode 100644
index 0000000..258cbbc
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1_part_d2.c
@@ -0,0 +1,11 @@
+/* { dg-skip-if part { *-*-* } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+extern int i;
+
+void d2() __attribute__((destructor (700)));
+
+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
new file mode 100644
index 0000000..1242d41
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1_part_d3.c
@@ -0,0 +1,14 @@
+/* { dg-skip-if part { *-*-* } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+extern int i;
+extern int j;
+
+void d3() __attribute__((destructor (600)));
+
+void d3() {
+ if (j != 2)
+ __builtin_abort ();
+ if (--i != 1)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/c-c++-common/initpri1_part_main.c b/gcc/testsuite/c-c++-common/initpri1_part_main.c
new file mode 100644
index 0000000..bff58d7
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/initpri1_part_main.c
@@ -0,0 +1,13 @@
+/* { dg-skip-if part { *-*-* } } */
+/* Via the magic string "-std=*++" indicate that testing one (the default) C++ standard is sufficient. */
+
+int i;
+int j;
+
+int main () {
+ if (i != 3)
+ return 1;
+ if (j != 1)
+ __builtin_abort ();
+ return 0;
+}