diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-4.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-4.c
index a6c1386c06edbdb58e76fa5e612c918010c507f6..2911da3a72d2a2ab7512476d9e369db8a8fb09b2 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-4.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-4.c
@@ -1,46 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char a;
-  unsigned int b:5;
-  unsigned int c:11, :0, d:8;
-  struct { unsigned int ee:2; } e;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-extern void foo (test_st st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-  r.values.v3 = 0xFFFFFFFF;
-  r.values.v4 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-4.x"
 
 /* { dg-final { scan-assembler "mov\tip, r4" } } */
 /* { dg-final { scan-assembler "movw\tr4, #65535" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-5.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-5.c
index d51ce2d42c051aeda8b06ad97086f2563a5fc47d..376e92b23fa66e4db2043e220648eaca3bc63d9d 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-5.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-5.c
@@ -1,42 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a;
-  unsigned short  b :5;
-  unsigned char	  c;
-  unsigned short  d :11;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-5.x"
 
 /* { dg-final { scan-assembler "mov\tip, r4" } } */
 /* { dg-final { scan-assembler "movw\tr4, #8191" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-6.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-6.c
index 77e9104b546a7693fcb2399622e828b1197eac1b..9845b6054c1bfc4208b7064b7364749e78b19102 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-6.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-6.c
@@ -1,51 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char a;
-  unsigned int	b : 3;
-  unsigned int	c : 14;
-  unsigned int	d : 1;
-  struct {
-      unsigned int    ee  : 2;
-      unsigned short  ff  : 15;
-  } e;
-  unsigned char	g : 1;
-  unsigned char	  : 4;
-  unsigned char	h : 3;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-  r.values.v3 = 0xFFFFFFFF;
-  r.values.v4 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-6.x"
 
 /* { dg-final { scan-assembler "mov\tip, r4" } } */
 /* { dg-final { scan-assembler "movw\tr4, #65535" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-7.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-7.c
index 3d8941bbfeebd59744c43f10c842816b36ec9915..2ea52dfe6552c7e649f0b29c1bc74955c221ee40 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-7.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-7.c
@@ -1,43 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a;
-  unsigned short  b :5;
-  unsigned char	  c;
-  unsigned short  d :11;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
-
+#include "../bitfield-7.x"
 
 /* { dg-final { scan-assembler "mov\tip, r4" } } */
 /* { dg-final { scan-assembler "movw\tr4, #8191" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-8.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-8.c
index 9ffbb718d34d5bb8f10e1f3c0505c7dc393c670c..9bc32b83d7477c7d600aea5c92102b4126f89c3d 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-8.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-8.c
@@ -1,45 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a;
-  unsigned int	    :0;
-  unsigned int	  b :1;
-  unsigned short    :0;
-  unsigned short  c;
-  unsigned int	    :0;
-  unsigned int	  d :21;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-  r.values.v3 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-8.x"
 
 /* { dg-final { scan-assembler "mov\tip, r4" } } */
 /* { dg-final { scan-assembler "movs\tr4, #255" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-9.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-9.c
index 8a6141829237823b8734de045a590a1917fa60b8..f6c15338d00b515c3c97825ae663792b12e5df51 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-9.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-9.c
@@ -1,48 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  char a:3;
-} test_st3;
-
-typedef struct
-{
-  char a:3;
-} test_st2;
-
-typedef struct
-{
-  test_st2 st2;
-  test_st3 st3;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-9.x"
 
 /* { dg-final { scan-assembler "mov\tip, r4" } } */
 /* { dg-final { scan-assembler "movw\tr4, #1799" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-and-union-1.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-and-union-1.c
deleted file mode 100644
index 642f4e0346b5186c78645780b45fe9c838848d45..0000000000000000000000000000000000000000
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-and-union-1.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-mcmse" } */
-
-typedef struct
-{
-  unsigned short a :11;
-} test_st_4;
-
-typedef union
-{
-  char	      a;
-  test_st_4 st4;
-}test_un_2;
-
-typedef struct
-{
-  unsigned char	  a;
-  unsigned int	    :0;
-  unsigned int	  b :1;
-  unsigned short    :0;
-  unsigned short  c;
-  unsigned int	    :0;
-  unsigned int	  d :21;
-} test_st_3;
-
-typedef struct
-{
-  unsigned char	  a :3;
-  unsigned int	  b :13;
-  test_un_2	  un2;
-} test_st_2;
-
-typedef union
-{
-  test_st_2 st2;
-  test_st_3 st3;
-}test_un_1;
-
-typedef struct
-{
-  unsigned char	  a :2;
-  unsigned char	    :0;
-  unsigned short  b :5;
-  unsigned char	    :0;
-  unsigned char	  c :4;
-  test_un_1	  un1;
-} test_st_1;
-
-typedef union
-{
-  test_st_1 st1;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st_1;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st_1);
-
-int
-main (void)
-{
-  read_st_1 r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-  r.values.v3 = 0xFFFFFFFF;
-  r.values.v4 = 0xFFFFFFFF;
-
-  f (r.st1);
-  return 0;
-}
-
-/* { dg-final { scan-assembler "mov\tip, r4" } } */
-/* { dg-final { scan-assembler "movw\tr4, #7939" } } */
-/* { dg-final { scan-assembler "movt\tr4, 15" } } */
-/* { dg-final { scan-assembler "ands\tr0, r4" } } */
-/* { dg-final { scan-assembler "movw\tr4, #65535" } } */
-/* { dg-final { scan-assembler "movt\tr4, 2047" } } */
-/* { dg-final { scan-assembler "ands\tr1, r4" } } */
-/* { dg-final { scan-assembler "movs\tr4, #1" } } */
-/* { dg-final { scan-assembler "movt\tr4, 65535" } } */
-/* { dg-final { scan-assembler "ands\tr2, r4" } } */
-/* { dg-final { scan-assembler "movw\tr4, #65535" } } */
-/* { dg-final { scan-assembler "movt\tr4, 31" } } */
-/* { dg-final { scan-assembler "ands\tr3, r4" } } */
-/* { dg-final { scan-assembler "mov\tr4, ip" } } */
-/* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
-/* { dg-final { scan-assembler "lsls\tr4, r4, #1" } } */
-/* { dg-final { scan-assembler "bl\t__gnu_cmse_nonsecure_call" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-and-union.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-and-union.c
new file mode 100644
index 0000000000000000000000000000000000000000..31249489e891ee16f8fa6f588096d48ce33f7b0b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-and-union.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-mcmse" } */
+
+#include "../bitfield-and-union.x"
+
+/* { dg-final { scan-assembler "mov\tip, r4" } } */
+/* { dg-final { scan-assembler "movw\tr4, #7939" } } */
+/* { dg-final { scan-assembler "movt\tr4, 15" } } */
+/* { dg-final { scan-assembler "ands\tr0, r4" } } */
+/* { dg-final { scan-assembler "movw\tr4, #65535" } } */
+/* { dg-final { scan-assembler "movt\tr4, 2047" } } */
+/* { dg-final { scan-assembler "ands\tr1, r4" } } */
+/* { dg-final { scan-assembler "movs\tr4, #1" } } */
+/* { dg-final { scan-assembler "movt\tr4, 65535" } } */
+/* { dg-final { scan-assembler "ands\tr2, r4" } } */
+/* { dg-final { scan-assembler "movw\tr4, #65535" } } */
+/* { dg-final { scan-assembler "movt\tr4, 31" } } */
+/* { dg-final { scan-assembler "ands\tr3, r4" } } */
+/* { dg-final { scan-assembler "mov\tr4, ip" } } */
+/* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
+/* { dg-final { scan-assembler "lsls\tr4, r4, #1" } } */
+/* { dg-final { scan-assembler "bl\t__gnu_cmse_nonsecure_call" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/cmse-13.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/cmse-13.c
index f2b931be5912b421f8427535ded3298883bec639..e27343d141f440a8865ae60352163887a0fcd646 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/cmse-13.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/cmse-13.c
@@ -3,13 +3,7 @@
 /* { dg-add-options arm_arch_v8m_base } */
 /* { dg-options "-mcmse" } */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (float, double);
-
-int
-foo (int a)
-{
-  return bar (1.0f, 2.0) + a + 1;
-}
+#include "../cmse-13.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/union-1.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/union-1.c
index ff18e839b02c19c2c77769b18ef5ee1cfacf0c71..afd5b98509c6c425b21ba174e5bef68a4b171c9a 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/union-1.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/union-1.c
@@ -1,60 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a :2;
-  unsigned char	    :0;
-  unsigned short  b :5;
-  unsigned char	    :0;
-  unsigned short  c :3;
-  unsigned char	    :0;
-  unsigned int	  d :9;
-} test_st_1;
-
-typedef struct
-{
-  unsigned short  a :7;
-  unsigned char	    :0;
-  unsigned char	  b :1;
-  unsigned char	    :0;
-  unsigned short  c :6;
-} test_st_2;
-
-typedef union
-{
-  test_st_1 st_1;
-  test_st_2 st_2;
-}test_un;
-
-typedef union
-{
-  test_un un;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_un;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_un);
-
-int
-main (void)
-{
-  read_un r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-
-  f (r.un);
-  return 0;
-}
+#include "../union-1.x"
 
 /* { dg-final { scan-assembler "mov\tip, r4" } } */
 /* { dg-final { scan-assembler "movw\tr4, #8063" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/baseline/union-2.c b/gcc/testsuite/gcc.target/arm/cmse/baseline/union-2.c
index b2e024b7f0776381f511077af91bd1ee5632ff12..6e60f2a762823dadfa670d5a2283aa6f25409f7e 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/baseline/union-2.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/baseline/union-2.c
@@ -1,73 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a :2;
-  unsigned char	    :0;
-  unsigned short  b :5;
-  unsigned char	    :0;
-  unsigned short  c :3;
-  unsigned char	    :0;
-  unsigned int	  d :9;
-} test_st_1;
-
-typedef struct
-{
-  unsigned short  a :7;
-  unsigned char	    :0;
-  unsigned char	  b :1;
-  unsigned char	    :0;
-  unsigned short  c :6;
-} test_st_2;
-
-typedef struct
-{
-  unsigned char	  a;
-  unsigned int	    :0;
-  unsigned int	  b :1;
-  unsigned short    :0;
-  unsigned short  c;
-  unsigned int	    :0;
-  unsigned int	  d :21;
-} test_st_3;
-
-typedef union
-{
-  test_st_1 st_1;
-  test_st_2 st_2;
-  test_st_3 st_3;
-}test_un;
-
-typedef union
-{
-  test_un un;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_un;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_un);
-
-int
-main (void)
-{
-  read_un r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-  r.values.v3 = 0xFFFFFFFF;
-
-  f (r.un);
-  return 0;
-}
+#include "../union-2.x"
 
 /* { dg-final { scan-assembler "mov\tip, r4" } } */
 /* { dg-final { scan-assembler "movw\tr4, #8191" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-4.x b/gcc/testsuite/gcc.target/arm/cmse/bitfield-4.x
new file mode 100644
index 0000000000000000000000000000000000000000..62e35cc3cb8ed9c0fd15ce07da49d5e7f6dd7955
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-4.x
@@ -0,0 +1,40 @@
+typedef struct
+{
+  unsigned char a;
+  unsigned int b:5;
+  unsigned int c:11, :0, d:8;
+  struct { unsigned int ee:2; } e;
+} test_st;
+
+typedef union
+{
+  test_st st;
+  struct
+    {
+      unsigned int v1;
+      unsigned int v2;
+      unsigned int v3;
+      unsigned int v4;
+    }values;
+} read_st;
+
+
+typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
+
+extern void foo (test_st st);
+
+int
+main (void)
+{
+  read_st r;
+  foo_ns f;
+
+  f = (foo_ns) 0x200000;
+  r.values.v1 = 0xFFFFFFFF;
+  r.values.v2 = 0xFFFFFFFF;
+  r.values.v3 = 0xFFFFFFFF;
+  r.values.v4 = 0xFFFFFFFF;
+
+  f (r.st);
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-5.x b/gcc/testsuite/gcc.target/arm/cmse/bitfield-5.x
new file mode 100644
index 0000000000000000000000000000000000000000..de5649dda6e815fc25475c7034a0638c4c29adf2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-5.x
@@ -0,0 +1,36 @@
+typedef struct
+{
+  unsigned char	  a;
+  unsigned short  b :5;
+  unsigned char	  c;
+  unsigned short  d :11;
+} test_st;
+
+typedef union
+{
+  test_st st;
+  struct
+    {
+      unsigned int v1;
+      unsigned int v2;
+      unsigned int v3;
+      unsigned int v4;
+    }values;
+} read_st;
+
+
+typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
+
+int
+main (void)
+{
+  read_st r;
+  foo_ns f;
+
+  f = (foo_ns) 0x200000;
+  r.values.v1 = 0xFFFFFFFF;
+  r.values.v2 = 0xFFFFFFFF;
+
+  f (r.st);
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-6.x b/gcc/testsuite/gcc.target/arm/cmse/bitfield-6.x
new file mode 100644
index 0000000000000000000000000000000000000000..693a8ae0abbbb6bdcb9692728a7067603e1665ed
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-6.x
@@ -0,0 +1,45 @@
+typedef struct
+{
+  unsigned char a;
+  unsigned int	b : 3;
+  unsigned int	c : 14;
+  unsigned int	d : 1;
+  struct {
+      unsigned int    ee  : 2;
+      unsigned short  ff  : 15;
+  } e;
+  unsigned char	g : 1;
+  unsigned char	  : 4;
+  unsigned char	h : 3;
+} test_st;
+
+typedef union
+{
+  test_st st;
+  struct
+    {
+      unsigned int v1;
+      unsigned int v2;
+      unsigned int v3;
+      unsigned int v4;
+    }values;
+} read_st;
+
+
+typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
+
+int
+main (void)
+{
+  read_st r;
+  foo_ns f;
+
+  f = (foo_ns) 0x200000;
+  r.values.v1 = 0xFFFFFFFF;
+  r.values.v2 = 0xFFFFFFFF;
+  r.values.v3 = 0xFFFFFFFF;
+  r.values.v4 = 0xFFFFFFFF;
+
+  f (r.st);
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-7.x b/gcc/testsuite/gcc.target/arm/cmse/bitfield-7.x
new file mode 100644
index 0000000000000000000000000000000000000000..de5649dda6e815fc25475c7034a0638c4c29adf2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-7.x
@@ -0,0 +1,36 @@
+typedef struct
+{
+  unsigned char	  a;
+  unsigned short  b :5;
+  unsigned char	  c;
+  unsigned short  d :11;
+} test_st;
+
+typedef union
+{
+  test_st st;
+  struct
+    {
+      unsigned int v1;
+      unsigned int v2;
+      unsigned int v3;
+      unsigned int v4;
+    }values;
+} read_st;
+
+
+typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
+
+int
+main (void)
+{
+  read_st r;
+  foo_ns f;
+
+  f = (foo_ns) 0x200000;
+  r.values.v1 = 0xFFFFFFFF;
+  r.values.v2 = 0xFFFFFFFF;
+
+  f (r.st);
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-8.x b/gcc/testsuite/gcc.target/arm/cmse/bitfield-8.x
new file mode 100644
index 0000000000000000000000000000000000000000..654b21e94b5ab142897bc20765ae18e3a25e0fde
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-8.x
@@ -0,0 +1,39 @@
+typedef struct
+{
+  unsigned char	  a;
+  unsigned int	    :0;
+  unsigned int	  b :1;
+  unsigned short    :0;
+  unsigned short  c;
+  unsigned int	    :0;
+  unsigned int	  d :21;
+} test_st;
+
+typedef union
+{
+  test_st st;
+  struct
+    {
+      unsigned int v1;
+      unsigned int v2;
+      unsigned int v3;
+      unsigned int v4;
+    }values;
+} read_st;
+
+typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
+
+int
+main (void)
+{
+  read_st r;
+  foo_ns f;
+
+  f = (foo_ns) 0x200000;
+  r.values.v1 = 0xFFFFFFFF;
+  r.values.v2 = 0xFFFFFFFF;
+  r.values.v3 = 0xFFFFFFFF;
+
+  f (r.st);
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/bitfield-9.x b/gcc/testsuite/gcc.target/arm/cmse/bitfield-9.x
new file mode 100644
index 0000000000000000000000000000000000000000..7543ac52696d82f8e95110b881783a81e5cf30c8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-9.x
@@ -0,0 +1,42 @@
+typedef struct
+{
+  char a:3;
+} test_st3;
+
+typedef struct
+{
+  char a:3;
+} test_st2;
+
+typedef struct
+{
+  test_st2 st2;
+  test_st3 st3;
+} test_st;
+
+typedef union
+{
+  test_st st;
+  struct
+    {
+      unsigned int v1;
+      unsigned int v2;
+      unsigned int v3;
+      unsigned int v4;
+    }values;
+} read_st;
+
+typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
+
+int
+main (void)
+{
+  read_st r;
+  foo_ns f;
+
+  f = (foo_ns) 0x200000;
+  r.values.v1 = 0xFFFFFFFF;
+
+  f (r.st);
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-13.x b/gcc/testsuite/gcc.target/arm/cmse/cmse-13.x
new file mode 100644
index 0000000000000000000000000000000000000000..cdcd5ba6cf64ce40afdb2dc568db4da28486fbc5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-13.x
@@ -0,0 +1,7 @@
+int __attribute__ ((cmse_nonsecure_call)) (*bar) (float, double);
+
+int
+foo (int a)
+{
+  return bar (3.0f, 2.0) + a + 1;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-5.x b/gcc/testsuite/gcc.target/arm/cmse/cmse-5.x
new file mode 100644
index 0000000000000000000000000000000000000000..7b03819d6b765356a52f242290facc00d6242f03
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-5.x
@@ -0,0 +1,7 @@
+extern float bar (void);
+
+float __attribute__ ((cmse_nonsecure_entry))
+foo (void)
+{
+  return bar ();
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-7.x b/gcc/testsuite/gcc.target/arm/cmse/cmse-7.x
new file mode 100644
index 0000000000000000000000000000000000000000..3fa372af2374732308a0bc2f1011de6d657b8125
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-7.x
@@ -0,0 +1,7 @@
+int __attribute__ ((cmse_nonsecure_call)) (*bar) (void);
+
+int
+foo (int a)
+{
+  return bar () + a + 1;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/cmse-8.x b/gcc/testsuite/gcc.target/arm/cmse/cmse-8.x
new file mode 100644
index 0000000000000000000000000000000000000000..7e1479542edce2cf1bb3e3153d90a27521fd42c5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/cmse-8.x
@@ -0,0 +1,7 @@
+int __attribute__ ((cmse_nonsecure_call)) (*bar) (double);
+
+int
+foo (int a)
+{
+  return bar (2.0) + a + 1;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-4.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-4.c
index c3b1396d52e742a1710ed5ad33fbeb559d866f6f..55da2a0c62237f3072ea155fde1e4a38f849dd6f 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-4.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-4.c
@@ -1,46 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char a;
-  unsigned int b:5;
-  unsigned int c:11, :0, d:8;
-  struct { unsigned int ee:2; } e;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-extern void foo (test_st st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-  r.values.v3 = 0xFFFFFFFF;
-  r.values.v4 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-4.x"
 
 /* { dg-final { scan-assembler "movw\tip, #65535" } } */
 /* { dg-final { scan-assembler "movt\tip, 255" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-5.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-5.c
index 0d029044aa9aa1d412c28ee5d18a8e3d0be36546..383363233e632189058559f4f569cd2f23fd3638 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-5.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-5.c
@@ -1,42 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a;
-  unsigned short  b :5;
-  unsigned char	  c;
-  unsigned short  d :11;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-5.x"
 
 /* { dg-final { scan-assembler "movw\tip, #8191" } } */
 /* { dg-final { scan-assembler "movt\tip, 255" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-6.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-6.c
index 005515ab9cb85c201a2a8b2f6417d73ceeacbc60..03c294ea323a7da7fa365b806db8b15e57ed7695 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-6.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-6.c
@@ -1,51 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char a;
-  unsigned int	b : 3;
-  unsigned int	c : 14;
-  unsigned int	d : 1;
-  struct {
-      unsigned int    ee  : 2;
-      unsigned short  ff  : 15;
-  } e;
-  unsigned char	g : 1;
-  unsigned char	  : 4;
-  unsigned char	h : 3;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-  r.values.v3 = 0xFFFFFFFF;
-  r.values.v4 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-6.x"
 
 /* { dg-final { scan-assembler "movw\tip, #65535" } } */
 /* { dg-final { scan-assembler "movt\tip, 1023" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-7.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-7.c
index 6dd218e62fdee2a6af819079ba1ea1909185d076..7692a69b1598857eba0c7c72c16596eb34e672da 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-7.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-7.c
@@ -1,43 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a;
-  unsigned short  b :5;
-  unsigned char	  c;
-  unsigned short  d :11;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
-
+#include "../bitfield-7.x"
 
 /* { dg-final { scan-assembler "movw\tip, #8191" } } */
 /* { dg-final { scan-assembler "movt\tip, 255" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-8.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-8.c
index c833bcb0ae978572fad46780bc180f61ccb14345..a0a488775fe39ec282f9162714ba78d0217a08e1 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-8.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-8.c
@@ -1,45 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a;
-  unsigned int	    :0;
-  unsigned int	  b :1;
-  unsigned short    :0;
-  unsigned short  c;
-  unsigned int	    :0;
-  unsigned int	  d :21;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-  r.values.v3 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-8.x"
 
 /* { dg-final { scan-assembler "mov\tip, #255" } } */
 /* { dg-final { scan-assembler "and\tr0, r0, ip" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-9.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-9.c
index d6e4cdb8c44b19c811f3a7b4fbce102a6c768f2b..8bfeeb0bbf61591783b60ec3858bed44efbaca89 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-9.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-9.c
@@ -1,48 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  char a:3;
-} test_st3;
-
-typedef struct
-{
-  char a:3;
-} test_st2;
-
-typedef struct
-{
-  test_st2 st2;
-  test_st3 st3;
-} test_st;
-
-typedef union
-{
-  test_st st;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_st;
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_st);
-
-int
-main (void)
-{
-  read_st r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-
-  f (r.st);
-  return 0;
-}
+#include "../bitfield-9.x"
 
 /* { dg-final { scan-assembler "movw\tip, #1799" } } */
 /* { dg-final { scan-assembler "and\tr0, r0, ip" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-and-union-1.c b/gcc/testsuite/gcc.target/arm/cmse/bitfield-and-union.x
similarity index 54%
rename from gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-and-union-1.c
rename to gcc/testsuite/gcc.target/arm/cmse/bitfield-and-union.x
index e139ba61af57f06cff5a9d121c97bbf41e170bb9..0a6eb3dd81612e83b2178fa18d7fadec77375e9f 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-and-union-1.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/bitfield-and-union.x
@@ -1,6 +1,3 @@
-/* { dg-do compile } */
-/* { dg-options "-mcmse" } */
-
 typedef struct
 {
   unsigned short a :11;
@@ -76,19 +73,3 @@ main (void)
   f (r.st1);
   return 0;
 }
-
-/* { dg-final { scan-assembler "movw\tip, #7939" } } */
-/* { dg-final { scan-assembler "movt\tip, 15" } } */
-/* { dg-final { scan-assembler "and\tr0, r0, ip" } } */
-/* { dg-final { scan-assembler "movw\tip, #65535" } } */
-/* { dg-final { scan-assembler "movt\tip, 2047" } } */
-/* { dg-final { scan-assembler "and\tr1, r1, ip" } } */
-/* { dg-final { scan-assembler "mov\tip, #1" } } */
-/* { dg-final { scan-assembler "movt\tip, 65535" } } */
-/* { dg-final { scan-assembler "and\tr2, r2, ip" } } */
-/* { dg-final { scan-assembler "movw\tip, #65535" } } */
-/* { dg-final { scan-assembler "movt\tip, 31" } } */
-/* { dg-final { scan-assembler "and\tr3, r3, ip" } } */
-/* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
-/* { dg-final { scan-assembler "lsls\tr4, r4, #1" } } */
-/* { dg-final { scan-assembler "bl\t__gnu_cmse_nonsecure_call" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-and-union.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-and-union.c
new file mode 100644
index 0000000000000000000000000000000000000000..aac5ae1a052deb90d9f9b40e2054e8831bea4a7e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-and-union.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-mcmse" } */
+
+#include "../bitfield-and-union.x"
+
+/* { dg-final { scan-assembler "movw\tip, #7939" } } */
+/* { dg-final { scan-assembler "movt\tip, 15" } } */
+/* { dg-final { scan-assembler "and\tr0, r0, ip" } } */
+/* { dg-final { scan-assembler "movw\tip, #65535" } } */
+/* { dg-final { scan-assembler "movt\tip, 2047" } } */
+/* { dg-final { scan-assembler "and\tr1, r1, ip" } } */
+/* { dg-final { scan-assembler "mov\tip, #1" } } */
+/* { dg-final { scan-assembler "movt\tip, 65535" } } */
+/* { dg-final { scan-assembler "and\tr2, r2, ip" } } */
+/* { dg-final { scan-assembler "movw\tip, #65535" } } */
+/* { dg-final { scan-assembler "movt\tip, 31" } } */
+/* { dg-final { scan-assembler "and\tr3, r3, ip" } } */
+/* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
+/* { dg-final { scan-assembler "lsls\tr4, r4, #1" } } */
+/* { dg-final { scan-assembler "bl\t__gnu_cmse_nonsecure_call" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-13.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-13.c
index d90ad811fc13c9b5cde1c9bf394e490255429ff2..221985dc66e0942daa8e80cce5e5069b47d4bdf6 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-13.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-13.c
@@ -5,14 +5,7 @@
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16" }  */
 
-
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (float, double);
-
-int
-foo (int a)
-{
-  return bar (3.0f, 2.0) + a + 1;
-}
+#include "../../cmse-13.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-5.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-5.c
index 88dec2762812614ee986ee1a023c0acce8f94c91..cea4ad2993dfb22a55aec0329050e82906fbd785 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-5.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-5.c
@@ -5,13 +5,8 @@
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16" }  */
 
-extern float bar (void);
+#include "../../cmse-5.x"
 
-float __attribute__ ((cmse_nonsecure_entry))
-foo (void)
-{
-  return bar ();
-}
 /* { dg-final { scan-assembler "mov\tr0, lr" } } */
 /* { dg-final { scan-assembler "mov\tr1, lr" } } */
 /* { dg-final { scan-assembler "mov\tr2, lr" } } */
@@ -32,8 +27,8 @@ foo (void)
 /* { dg-final { scan-assembler "vmov\.f32\ts13, #1\.0" } } */
 /* { dg-final { scan-assembler "vmov\.f32\ts14, #1\.0" } } */
 /* { dg-final { scan-assembler "vmov\.f32\ts15, #1\.0" } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { arm_arch_v8m_main_ok && { ! arm_dsp } } } } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target { arm_arch_v8m_main_ok && arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { ! arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target arm_dsp } } } */
 /* { dg-final { scan-assembler "push\t{r4}" } } */
 /* { dg-final { scan-assembler "vmrs\tip, fpscr" } } */
 /* { dg-final { scan-assembler "movw\tr4, #65376" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-7.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-7.c
index c047cd51c9480fc30e411bf7814769d32ccfe79e..64d51698c763d154f266620bc608093ff76c7b4b 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-7.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-7.c
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (void);
-
-int
-foo (int a)
-{
-  return bar () + a + 1;
-}
+#include "../../cmse-7.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-8.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-8.c
index 20d2d4a8fb13f89103a5d97b9b533caa37520b76..322a6c9542af60ac93aa4f6cac5ab8f9bbfbadfb 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-8.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-8.c
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (double);
-
-int
-foo (int a)
-{
-  return bar (2.0) + a + 1;
-}
+#include "../../cmse-8.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-13.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-13.c
index 0af586a7fd18de879301c5bba9eccbe1ab0c4e33..2140e61aec503bfbdb84ece34861a280b518bf1d 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-13.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-13.c
@@ -5,14 +5,7 @@
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-d16" }  */
 
-
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (float, double);
-
-int
-foo (int a)
-{
-  return bar (3.0f, 2.0) + a + 1;
-}
+#include "../../cmse-13.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-5.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-5.c
index 29f60baf5212f9fa2e4436fe40c6abe4ac671254..71715474c042355e454dffc2e19342dcf3d3669b 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-5.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-5.c
@@ -5,13 +5,8 @@
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-d16" }  */
 
-extern float bar (void);
+#include "../../cmse-5.x"
 
-float __attribute__ ((cmse_nonsecure_entry))
-foo (void)
-{
-  return bar ();
-}
 /* { dg-final { scan-assembler "mov\tr0, lr" } } */
 /* { dg-final { scan-assembler "mov\tr1, lr" } } */
 /* { dg-final { scan-assembler "mov\tr2, lr" } } */
@@ -25,8 +20,8 @@ foo (void)
 /* { dg-final { scan-assembler "vmov\.f64\td5, #1\.0" } } */
 /* { dg-final { scan-assembler "vmov\.f64\td6, #1\.0" } } */
 /* { dg-final { scan-assembler "vmov\.f64\td7, #1\.0" } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { arm_arch_v8m_main_ok && { ! arm_dsp } } } } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target { arm_arch_v8m_main_ok && arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { ! arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target arm_dsp } } } */
 /* { dg-final { scan-assembler "push\t{r4}" } } */
 /* { dg-final { scan-assembler "vmrs\tip, fpscr" } } */
 /* { dg-final { scan-assembler "movw\tr4, #65376" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-7.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-7.c
index a5c64fb06edd6927e0eb3b1f4e6d314274668a7a..95a885dc5702b5db76afc62c87bcfb997894e7f7 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-7.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-7.c
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-d16" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (void);
-
-int
-foo (int a)
-{
-  return bar () + a + 1;
-}
+#include "../../cmse-7.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-8.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-8.c
index 5e041b17b0e4bad779b147c204cf8178c8798b80..88fcf54d7b104097a7794c3c82b014b9c93410b4 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-8.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-8.c
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=hard -mfpu=fpv5-d16" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (double);
-
-int
-foo (int a)
-{
-  return bar (2.0) + a + 1;
-}
+#include "../../cmse-8.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-13.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-13.c
index dbbd262c89085eb0dc8737ad7955c3a12531492b..79823831e3d1ef57845915256e342114fb456ade 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-13.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-13.c
@@ -4,13 +4,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
 /* { dg-options "-mcmse -mfloat-abi=soft" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (float, double);
-
-int
-foo (int a)
-{
-  return bar (1.0f, 2.0) + a + 1;
-}
+#include "../../cmse-13.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-5.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-5.c
index a7229ea8eb2da1da264f58f8518daf303d1bdeda..b715dd1f44144e8ca321fc13a8811415fd666c3b 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-5.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-5.c
@@ -4,13 +4,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
 /* { dg-options "-mcmse -mfloat-abi=soft" }  */
 
-extern float bar (void);
-
-float __attribute__ ((cmse_nonsecure_entry))
-foo (void)
-{
-  return bar ();
-}
+#include "../../cmse-5.x"
 
 /* { dg-final { scan-assembler "mov\tr1, lr" } } */
 /* { dg-final { scan-assembler "mov\tr2, lr" } } */
@@ -18,7 +12,7 @@ foo (void)
 /* { dg-final { scan-assembler "mov\tip, lr" } } */
 /* { dg-final { scan-assembler-not "vmov" } } */
 /* { dg-final { scan-assembler-not "vmsr" } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { arm_arch_v8m_main_ok && { ! arm_dsp } } } } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target { arm_arch_v8m_main_ok && arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { ! arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target arm_dsp } } } */
 /* { dg-final { scan-assembler "bxns" } } */
 
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-7.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-7.c
index e33568400ef830abaa019b5c2727a9f3b5d5704b..16a1a203bd3ae358b7c109a6522bdd530387885c 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-7.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-7.c
@@ -4,13 +4,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
 /* { dg-options "-mcmse -mfloat-abi=soft" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (void);
-
-int
-foo (int a)
-{
-  return bar () + a + 1;
-}
+#include "../../cmse-7.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-8.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-8.c
index 024a12e0a414730eb1cbebfca8574d548238ab28..91b019ee2de9b0323a38af3ef1da98462bf73e7c 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-8.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-8.c
@@ -4,13 +4,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
 /* { dg-options "-mcmse -mfloat-abi=soft" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (double);
-
-int
-foo (int a)
-{
-  return bar (2.0) + a + 1;
-}
+#include "../../cmse-8.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-5.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-5.c
index 7734d77dc3812e6a158ea1f6b067930846fffccb..a102312874b3a69e8934f868631669d6b7cf4ce5 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-5.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-5.c
@@ -5,13 +5,8 @@
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-sp-d16" }  */
 
-extern float bar (void);
+#include "../../cmse-5.x"
 
-float __attribute__ ((cmse_nonsecure_entry))
-foo (void)
-{
-  return bar ();
-}
 /* { dg-final { scan-assembler "__acle_se_foo:" } } */
 /* { dg-final { scan-assembler-not "mov\tr0, lr" } } */
 /* { dg-final { scan-assembler "mov\tr1, lr" } } */
@@ -33,8 +28,8 @@ foo (void)
 /* { dg-final { scan-assembler "vmov\.f32\ts13, #1\.0" } } */
 /* { dg-final { scan-assembler "vmov\.f32\ts14, #1\.0" } } */
 /* { dg-final { scan-assembler "vmov\.f32\ts15, #1\.0" } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { arm_arch_v8m_main_ok && { ! arm_dsp } } } } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target { arm_arch_v8m_main_ok && arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { ! arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target arm_dsp } } } */
 /* { dg-final { scan-assembler "push\t{r4}" } } */
 /* { dg-final { scan-assembler "vmrs\tip, fpscr" } } */
 /* { dg-final { scan-assembler "movw\tr4, #65376" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-7.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-7.c
index fb195eb58d59fe9ea5ed74af79646199c61bcdae..0a6d0ed17bf1f027ea5b139c478fbb5b9270893d 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-7.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-7.c
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-sp-d16" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (void);
-
-int
-foo (int a)
-{
-  return bar () + a + 1;
-}
+#include "../../cmse-7.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-8.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-8.c
index 22ed3f8af882f96da49919c60fc6f4cd74dfc54b..28c0bd836590d8b11c58e7231921ec3eeddb645e 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-8.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-8.c
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-d16"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-sp-d16" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (double);
-
-int
-foo (int a)
-{
-  return bar (2.0) + a + 1;
-}
+#include "../../cmse-8.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-13.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-13.c
index 9634065e7cb64a5069cbb3c9be4b8cf9177f5e29..d51be53a2afb887e337503c56a96163abc3eace5 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-13.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-13.c
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-d16" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (float, double);
-
-int
-foo (int a)
-{
-  return bar (1.0f, 2.0) + a + 1;
-}
+#include "../../cmse-13.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-5.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-5.c
index 6addaa1a4eda8e2930d5fe72c94697bcf6e604e4..ec1ba54e833550443324b925ecf8192928a28df2 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-5.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-5.c
@@ -5,13 +5,8 @@
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-d16" }  */
 
-extern float bar (void);
+#include "../../cmse-5.x"
 
-float __attribute__ ((cmse_nonsecure_entry))
-foo (void)
-{
-  return bar ();
-}
 /* { dg-final { scan-assembler "__acle_se_foo:" } } */
 /* { dg-final { scan-assembler-not "mov\tr0, lr" } } */
 /* { dg-final { scan-assembler "mov\tr1, lr" } } */
@@ -25,8 +20,8 @@ foo (void)
 /* { dg-final { scan-assembler "vmov\.f64\td5, #1\.0" } } */
 /* { dg-final { scan-assembler "vmov\.f64\td6, #1\.0" } } */
 /* { dg-final { scan-assembler "vmov\.f64\td7, #1\.0" } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { arm_arch_v8m_main_ok && { ! arm_dsp } } } } } */
-/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target { arm_arch_v8m_main_ok && arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvq, lr" { target { ! arm_dsp } } } } */
+/* { dg-final { scan-assembler "msr\tAPSR_nzcvqg, lr" { target arm_dsp } } } */
 /* { dg-final { scan-assembler "push\t{r4}" } } */
 /* { dg-final { scan-assembler "vmrs\tip, fpscr" } } */
 /* { dg-final { scan-assembler "movw\tr4, #65376" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-7.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-7.c
index 04f8466cc112c03ee5a05e6e5223d2c66a033bbe..b73b1194aae61b70dcc74571f47512d7aa1e3f50 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-7.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-7.c
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-d16" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (void);
-
-int
-foo (int a)
-{
-  return bar () + a + 1;
-}
+#include "../../cmse-7.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-8.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-8.c
index ffe94de85417b81f9dcb366eb1b40dc1661c91b7..fcbc35148166f52964367c4ad6ebafeaeaee7ba1 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-8.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-8.c
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 /* { dg-options "-mcmse -mfloat-abi=softfp -mfpu=fpv5-d16" }  */
 
-int __attribute__ ((cmse_nonsecure_call)) (*bar) (double);
-
-int
-foo (int a)
-{
-  return bar (2.0) + a + 1;
-}
+#include "../../cmse-8.x"
 
 /* Checks for saving and clearing prior to function call.  */
 /* { dg-final { scan-assembler "lsrs\tr4, r4, #1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/union-1.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/union-1.c
index 1fc846cd7a51303ec00f8f512a54cd697fbd0682..071955f206c04c13ec04bbe7034edb4754c47563 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/union-1.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/union-1.c
@@ -1,60 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a :2;
-  unsigned char	    :0;
-  unsigned short  b :5;
-  unsigned char	    :0;
-  unsigned short  c :3;
-  unsigned char	    :0;
-  unsigned int	  d :9;
-} test_st_1;
-
-typedef struct
-{
-  unsigned short  a :7;
-  unsigned char	    :0;
-  unsigned char	  b :1;
-  unsigned char	    :0;
-  unsigned short  c :6;
-} test_st_2;
-
-typedef union
-{
-  test_st_1 st_1;
-  test_st_2 st_2;
-}test_un;
-
-typedef union
-{
-  test_un un;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_un;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_un);
-
-int
-main (void)
-{
-  read_un r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-
-  f (r.un);
-  return 0;
-}
+#include "../union-1.x"
 
 /* { dg-final { scan-assembler "movw\tip, #8063" } } */
 /* { dg-final { scan-assembler "movt\tip, 63" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/mainline/union-2.c b/gcc/testsuite/gcc.target/arm/cmse/mainline/union-2.c
index 420d0f136ef171111c1cca6cd24c4f46b9fcb7fc..c7431930ff95215361feea6b28e981ed6d5cb824 100644
--- a/gcc/testsuite/gcc.target/arm/cmse/mainline/union-2.c
+++ b/gcc/testsuite/gcc.target/arm/cmse/mainline/union-2.c
@@ -1,73 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mcmse" } */
 
-typedef struct
-{
-  unsigned char	  a :2;
-  unsigned char	    :0;
-  unsigned short  b :5;
-  unsigned char	    :0;
-  unsigned short  c :3;
-  unsigned char	    :0;
-  unsigned int	  d :9;
-} test_st_1;
-
-typedef struct
-{
-  unsigned short  a :7;
-  unsigned char	    :0;
-  unsigned char	  b :1;
-  unsigned char	    :0;
-  unsigned short  c :6;
-} test_st_2;
-
-typedef struct
-{
-  unsigned char	  a;
-  unsigned int	    :0;
-  unsigned int	  b :1;
-  unsigned short    :0;
-  unsigned short  c;
-  unsigned int	    :0;
-  unsigned int	  d :21;
-} test_st_3;
-
-typedef union
-{
-  test_st_1 st_1;
-  test_st_2 st_2;
-  test_st_3 st_3;
-}test_un;
-
-typedef union
-{
-  test_un un;
-  struct
-    {
-      unsigned int v1;
-      unsigned int v2;
-      unsigned int v3;
-      unsigned int v4;
-    }values;
-} read_un;
-
-
-typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_un);
-
-int
-main (void)
-{
-  read_un r;
-  foo_ns f;
-
-  f = (foo_ns) 0x200000;
-  r.values.v1 = 0xFFFFFFFF;
-  r.values.v2 = 0xFFFFFFFF;
-  r.values.v3 = 0xFFFFFFFF;
-
-  f (r.un);
-  return 0;
-}
+#include "../union-2.x"
 
 /* { dg-final { scan-assembler "movw\tip, #8191" } } */
 /* { dg-final { scan-assembler "movt\tip, 63" } } */
diff --git a/gcc/testsuite/gcc.target/arm/cmse/union-1.x b/gcc/testsuite/gcc.target/arm/cmse/union-1.x
new file mode 100644
index 0000000000000000000000000000000000000000..8fe953514952199df822cf1dd89ae24661ca8223
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/union-1.x
@@ -0,0 +1,54 @@
+typedef struct
+{
+  unsigned char	  a :2;
+  unsigned char	    :0;
+  unsigned short  b :5;
+  unsigned char	    :0;
+  unsigned short  c :3;
+  unsigned char	    :0;
+  unsigned int	  d :9;
+} test_st_1;
+
+typedef struct
+{
+  unsigned short  a :7;
+  unsigned char	    :0;
+  unsigned char	  b :1;
+  unsigned char	    :0;
+  unsigned short  c :6;
+} test_st_2;
+
+typedef union
+{
+  test_st_1 st_1;
+  test_st_2 st_2;
+}test_un;
+
+typedef union
+{
+  test_un un;
+  struct
+    {
+      unsigned int v1;
+      unsigned int v2;
+      unsigned int v3;
+      unsigned int v4;
+    }values;
+} read_un;
+
+
+typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_un);
+
+int
+main (void)
+{
+  read_un r;
+  foo_ns f;
+
+  f = (foo_ns) 0x200000;
+  r.values.v1 = 0xFFFFFFFF;
+  r.values.v2 = 0xFFFFFFFF;
+
+  f (r.un);
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/cmse/union-2.x b/gcc/testsuite/gcc.target/arm/cmse/union-2.x
new file mode 100644
index 0000000000000000000000000000000000000000..8a880e7cb5f2754092ecfa61714e6683fe4013a5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/cmse/union-2.x
@@ -0,0 +1,67 @@
+typedef struct
+{
+  unsigned char	  a :2;
+  unsigned char	    :0;
+  unsigned short  b :5;
+  unsigned char	    :0;
+  unsigned short  c :3;
+  unsigned char	    :0;
+  unsigned int	  d :9;
+} test_st_1;
+
+typedef struct
+{
+  unsigned short  a :7;
+  unsigned char	    :0;
+  unsigned char	  b :1;
+  unsigned char	    :0;
+  unsigned short  c :6;
+} test_st_2;
+
+typedef struct
+{
+  unsigned char	  a;
+  unsigned int	    :0;
+  unsigned int	  b :1;
+  unsigned short    :0;
+  unsigned short  c;
+  unsigned int	    :0;
+  unsigned int	  d :21;
+} test_st_3;
+
+typedef union
+{
+  test_st_1 st_1;
+  test_st_2 st_2;
+  test_st_3 st_3;
+}test_un;
+
+typedef union
+{
+  test_un un;
+  struct
+    {
+      unsigned int v1;
+      unsigned int v2;
+      unsigned int v3;
+      unsigned int v4;
+    }values;
+} read_un;
+
+
+typedef void __attribute__ ((cmse_nonsecure_call)) (*foo_ns) (test_un);
+
+int
+main (void)
+{
+  read_un r;
+  foo_ns f;
+
+  f = (foo_ns) 0x200000;
+  r.values.v1 = 0xFFFFFFFF;
+  r.values.v2 = 0xFFFFFFFF;
+  r.values.v3 = 0xFFFFFFFF;
+
+  f (r.un);
+  return 0;
+}
