summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vxworks/initpri2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/vxworks/initpri2.c')
-rw-r--r--gcc/testsuite/gcc.dg/vxworks/initpri2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vxworks/initpri2.c b/gcc/testsuite/gcc.dg/vxworks/initpri2.c
new file mode 100644
index 000000000..7f483efad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vxworks/initpri2.c
@@ -0,0 +1,15 @@
+/* On VxWorks, in kernel mode, there is no support for .ctors/.dtors.
+ Instead, initialization is handled by munch. */
+
+/* { dg-do compile { target vxworks_kernel } } */
+/* { dg-final { scan-assembler-not "\.ctors" } } */
+/* { dg-final { scan-assembler-not "\.dtors" } } */
+
+volatile int i;
+
+void c1 () __attribute__((constructor));
+void c1 () { ++i; }
+
+void d1 () __attribute__((destructor));
+void d1 () { --i; }
+