[testsuite/ARM] Consolidate sources for cmse tests
authorThomas Preud'homme <thomas.preudhomme@arm.com>
Fri, 10 Nov 2017 18:20:33 +0000 (18:20 +0000)
committerThomas Preud'homme <thopre01@gcc.gnu.org>
Fri, 10 Nov 2017 18:20:33 +0000 (18:20 +0000)
For the most part, testcases under gcc.target/arm/cmse/baseline and
gcc.target/arm/cmse/mainline are duplicate copies with only different
dejagnu directives. Although there is no requirement for them to be
similar, having them both identical allow to compare the code generated
and make it easier in case of change in code generation to both
architecture to update the testcases (if one needs updating so does the
other).

Similarly all the tests in gcc.target/arm/cmse/mainline/<floatabi> have
the same source but are duplicate copies.

This patch moves all the code in the tests to a parent directory:
gcc.target/arm/cmse for tests shared by Armv8-M Baseline and Mainline
and gcc.target/arm/cmse/mainline for tests *only* shared by the various
float ABI of Armv8-M Mainline. C includes are then used where the code
used to sit.

Note that the cmse-13.c test used to differ slightly between
architectures and float ABI tested in the first floating-point constant
passed to bar: sometimes 1.0 and sometimes 3.0. This patch settles on
3.0 to not confuse with the 1.0 constant used to clear VFP registers in
some of the configurations.

2017-11-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/testsuite/
    * gcc.target/arm/cmse/bitfield-4.x: New file.
    * gcc.target/arm/cmse/baseline/bitfield-4.c: Remove code and include
    above file.
    * gcc.target/arm/cmse/mainline/bitfield-4.c: Likewise.
    * gcc.target/arm/cmse/bitfield-5.x: New file.
    * gcc.target/arm/cmse/baseline/bitfield-5.c: Remove code and include
    above file.
    * gcc.target/arm/cmse/mainline/bitfield-5.c: Likewise.
    * gcc.target/arm/cmse/bitfield-6.x: New file.
    * gcc.target/arm/cmse/baseline/bitfield-6.c: Remove code and include
    above file.
    * gcc.target/arm/cmse/mainline/bitfield-6.c: Likewise.
    * gcc.target/arm/cmse/bitfield-7.x: New file.
    * gcc.target/arm/cmse/baseline/bitfield-7.c: Remove code and include
    above file.
    * gcc.target/arm/cmse/mainline/bitfield-7.c: Likewise.
    * gcc.target/arm/cmse/bitfield-8.x: New file.
    * gcc.target/arm/cmse/baseline/bitfield-8.c: Remove code and include
    above file.
    * gcc.target/arm/cmse/mainline/bitfield-8.c: Likewise.
    * gcc.target/arm/cmse/bitfield-9.x: New file.
    * gcc.target/arm/cmse/baseline/bitfield-9.c: Remove code and include
    above file.
    * gcc.target/arm/cmse/mainline/bitfield-9.c: Likewise.
    * gcc.target/arm/cmse/bitfield-and-union.x: New file.
    * gcc.target/arm/cmse/baseline/bitfield-and-union-1.c: Rename into ...
    * gcc.target/arm/cmse/baseline/bitfield-and-union.c: This.  Remove code
    and include above bitfield-and-union.x file.
    * gcc.target/arm/cmse/mainline/bitfield-and-union-1.c: Rename into ...
    * gcc.target/arm/cmse/mainline/bitfield-and-union.c: this.  Remove code
    and include above bitfield-and-union.x file.
    * gcc.target/arm/cmse/cmse-13.x: New file.
    * gcc.target/arm/cmse/baseline/cmse-13.c: Remove code and include above
    file.
    * gcc.target/arm/cmse/mainline/hard-sp/cmse-13.c: Likewise.
    * gcc.target/arm/cmse/mainline/hard/cmse-13.c: Likewise.
    * gcc.target/arm/cmse/mainline/soft/cmse-13.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp/cmse-13.c: Likewise.
    * gcc.target/arm/cmse/cmse-5.x: New file.
    * gcc.target/arm/cmse/mainline/hard-sp/cmse-5.c: Remove code and
    include above file.
    * gcc.target/arm/cmse/mainline/hard/cmse-5.c: Likewise.
    * gcc.target/arm/cmse/mainline/soft/cmse-5.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp-sp/cmse-5.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp/cmse-5.c: Likewise.
    * gcc.target/arm/cmse/cmse-7.x: New file.
    * gcc.target/arm/cmse/mainline/hard-sp/cmse-7.c: Remove code and
    include above file.
    * gcc.target/arm/cmse/mainline/hard/cmse-7.c: Likewise.
    * gcc.target/arm/cmse/mainline/soft/cmse-7.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp-sp/cmse-7.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp/cmse-7.c: Likewise.
    * gcc.target/arm/cmse/cmse-8.x: New file.
    * gcc.target/arm/cmse/mainline/hard-sp/cmse-8.c: Remove code and
    include above file.
    * gcc.target/arm/cmse/mainline/hard/cmse-8.c: Likewise.
    * gcc.target/arm/cmse/mainline/soft/cmse-8.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp-sp/cmse-8.c: Likewise.
    * gcc.target/arm/cmse/mainline/softfp/cmse-8.c: Likewise.
    * gcc.target/arm/cmse/union-1.x: New file.
    * gcc.target/arm/cmse/baseline/union-1.c: Remove code and include above
    file.
    * gcc.target/arm/cmse/mainline/union-1.c: Likewise.
    * gcc.target/arm/cmse/union-2.x: New file.
    * gcc.target/arm/cmse/baseline/union-2.c: Remove code and include above
    file.
    * gcc.target/arm/cmse/mainline/union-2.c: Likewise.

From-SVN: r254633

54 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-4.c
gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-5.c
gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-6.c
gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-7.c
gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-8.c
gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-9.c
gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-and-union-1.c [deleted file]
gcc/testsuite/gcc.target/arm/cmse/baseline/bitfield-and-union.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/baseline/cmse-13.c
gcc/testsuite/gcc.target/arm/cmse/baseline/union-1.c
gcc/testsuite/gcc.target/arm/cmse/baseline/union-2.c
gcc/testsuite/gcc.target/arm/cmse/bitfield-4.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/bitfield-5.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/bitfield-6.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/bitfield-7.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/bitfield-8.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/bitfield-9.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/bitfield-and-union.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/cmse-13.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/cmse-5.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/cmse-7.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/cmse-8.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-4.c
gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-5.c
gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-6.c
gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-7.c
gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-8.c
gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-9.c
gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-and-union-1.c [deleted file]
gcc/testsuite/gcc.target/arm/cmse/mainline/bitfield-and-union.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-13.c
gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-5.c
gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-7.c
gcc/testsuite/gcc.target/arm/cmse/mainline/hard-sp/cmse-8.c
gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-13.c
gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-5.c
gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-7.c
gcc/testsuite/gcc.target/arm/cmse/mainline/hard/cmse-8.c
gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-13.c
gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-5.c
gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-7.c
gcc/testsuite/gcc.target/arm/cmse/mainline/soft/cmse-8.c
gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-5.c
gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-7.c
gcc/testsuite/gcc.target/arm/cmse/mainline/softfp-sp/cmse-8.c
gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-13.c
gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-5.c
gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-7.c
gcc/testsuite/gcc.target/arm/cmse/mainline/softfp/cmse-8.c
gcc/testsuite/gcc.target/arm/cmse/mainline/union-1.c
gcc/testsuite/gcc.target/arm/cmse/mainline/union-2.c
gcc/testsuite/gcc.target/arm/cmse/union-1.x [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/cmse/union-2.x [new file with mode: 0644]

index 948c8b148a4620d3a2fd9c2ece4fd410292fcb4b..a6a4eacdbdee424e85a0980496cf630734737981 100644 (file)
@@ -1,3 +1,73 @@
+2017-11-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+       * gcc.target/arm/cmse/bitfield-4.x: New file.
+       * gcc.target/arm/cmse/baseline/bitfield-4.c: Remove code and include
+       above file.
+       * gcc.target/arm/cmse/mainline/bitfield-4.c: Likewise.
+       * gcc.target/arm/cmse/bitfield-5.x: New file.
+       * gcc.target/arm/cmse/baseline/bitfield-5.c: Remove code and include
+       above file.
+       * gcc.target/arm/cmse/mainline/bitfield-5.c: Likewise.
+       * gcc.target/arm/cmse/bitfield-6.x: New file.
+       * gcc.target/arm/cmse/baseline/bitfield-6.c: Remove code and include
+       above file.
+       * gcc.target/arm/cmse/mainline/bitfield-6.c: Likewise.
+       * gcc.target/arm/cmse/bitfield-7.x: New file.
+       * gcc.target/arm/cmse/baseline/bitfield-7.c: Remove code and include
+       above file.
+       * gcc.target/arm/cmse/mainline/bitfield-7.c: Likewise.
+       * gcc.target/arm/cmse/bitfield-8.x: New file.
+       * gcc.target/arm/cmse/baseline/bitfield-8.c: Remove code and include
+       above file.
+       * gcc.target/arm/cmse/mainline/bitfield-8.c: Likewise.
+       * gcc.target/arm/cmse/bitfield-9.x: New file.
+       * gcc.target/arm/cmse/baseline/bitfield-9.c: Remove code and include
+       above file.
+       * gcc.target/arm/cmse/mainline/bitfield-9.c: Likewise.
+       * gcc.target/arm/cmse/bitfield-and-union.x: New file.
+       * gcc.target/arm/cmse/baseline/bitfield-and-union-1.c: Rename into ...
+       * gcc.target/arm/cmse/baseline/bitfield-and-union.c: This.  Remove code
+       and include above bitfield-and-union.x file.
+       * gcc.target/arm/cmse/mainline/bitfield-and-union-1.c: Rename into ...
+       * gcc.target/arm/cmse/mainline/bitfield-and-union.c: this.  Remove code
+       and include above bitfield-and-union.x file.
+       * gcc.target/arm/cmse/cmse-13.x: New file.
+       * gcc.target/arm/cmse/baseline/cmse-13.c: Remove code and include above
+       file.
+       * gcc.target/arm/cmse/mainline/hard-sp/cmse-13.c: Likewise.
+       * gcc.target/arm/cmse/mainline/hard/cmse-13.c: Likewise.
+       * gcc.target/arm/cmse/mainline/soft/cmse-13.c: Likewise.
+       * gcc.target/arm/cmse/mainline/softfp/cmse-13.c: Likewise.
+       * gcc.target/arm/cmse/cmse-5.x: New file.
+       * gcc.target/arm/cmse/mainline/hard-sp/cmse-5.c: Remove code and
+       include above file.
+       * gcc.target/arm/cmse/mainline/hard/cmse-5.c: Likewise.
+       * gcc.target/arm/cmse/mainline/soft/cmse-5.c: Likewise.
+       * gcc.target/arm/cmse/mainline/softfp-sp/cmse-5.c: Likewise.
+       * gcc.target/arm/cmse/mainline/softfp/cmse-5.c: Likewise.
+       * gcc.target/arm/cmse/cmse-7.x: New file.
+       * gcc.target/arm/cmse/mainline/hard-sp/cmse-7.c: Remove code and
+       include above file.
+       * gcc.target/arm/cmse/mainline/hard/cmse-7.c: Likewise.
+       * gcc.target/arm/cmse/mainline/soft/cmse-7.c: Likewise.
+       * gcc.target/arm/cmse/mainline/softfp-sp/cmse-7.c: Likewise.
+       * gcc.target/arm/cmse/mainline/softfp/cmse-7.c: Likewise.
+       * gcc.target/arm/cmse/cmse-8.x: New file.
+       * gcc.target/arm/cmse/mainline/hard-sp/cmse-8.c: Remove code and
+       include above file.
+       * gcc.target/arm/cmse/mainline/hard/cmse-8.c: Likewise.
+       * gcc.target/arm/cmse/mainline/soft/cmse-8.c: Likewise.
+       * gcc.target/arm/cmse/mainline/softfp-sp/cmse-8.c: Likewise.
+       * gcc.target/arm/cmse/mainline/softfp/cmse-8.c: Likewise.
+       * gcc.target/arm/cmse/union-1.x: New file.
+       * gcc.target/arm/cmse/baseline/union-1.c: Remove code and include above
+       file.
+       * gcc.target/arm/cmse/mainline/union-1.c: Likewise.
+       * gcc.target/arm/cmse/union-2.x: New file.
+       * gcc.target/arm/cmse/baseline/union-2.c: Remove code and include above
+       file.
+       * gcc.target/arm/cmse/mainline/union-2.c: Likewise.
+
 2017-11-10  Martin Sebor  <msebor@redhat.com>
 
        PR c/81117
index a6c1386c06edbdb58e76fa5e612c918010c507f6..2911da3a72d2a2ab7512476d9e369db8a8fb09b2 100644 (file)
@@ -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" } } */
index d51ce2d42c051aeda8b06ad97086f2563a5fc47d..376e92b23fa66e4db2043e220648eaca3bc63d9d 100644 (file)
@@ -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" } } */
index 77e9104b546a7693fcb2399622e828b1197eac1b..9845b6054c1bfc4208b7064b7364749e78b19102 100644 (file)
@@ -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" } } */
index 3d8941bbfeebd59744c43f10c842816b36ec9915..2ea52dfe6552c7e649f0b29c1bc74955c221ee40 100644 (file)
@@ -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" } } */
index 9ffbb718d34d5bb8f10e1f3c0505c7dc393c670c..9bc32b83d7477c7d600aea5c92102b4126f89c3d 100644 (file)
@@ -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" } } */
index 8a6141829237823b8734de045a590a1917fa60b8..f6c15338d00b515c3c97825ae663792b12e5df51 100644 (file)
@@ -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 (file)
index 642f4e0..0000000
+++ /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 (file)
index 0000000..3124948
--- /dev/null
@@ -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" } } */
index 8ced14b54f9cefa7a32557e67765fda1b7ef5b08..7208a2cedd2f4f8296b2801d6f5e5d7838b26551 100644 (file)
@@ -3,13 +3,7 @@
 /* { dg-require-effective-target arm_arch_v8m_base_ok } */
 /* { dg-add-options arm_arch_v8m_base } */
 
-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" } } */
index ff18e839b02c19c2c77769b18ef5ee1cfacf0c71..afd5b98509c6c425b21ba174e5bef68a4b171c9a 100644 (file)
@@ -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" } } */
index b2e024b7f0776381f511077af91bd1ee5632ff12..6e60f2a762823dadfa670d5a2283aa6f25409f7e 100644 (file)
@@ -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 (file)
index 0000000..62e35cc
--- /dev/null
@@ -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 (file)
index 0000000..de5649d
--- /dev/null
@@ -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 (file)
index 0000000..693a8ae
--- /dev/null
@@ -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 (file)
index 0000000..de5649d
--- /dev/null
@@ -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 (file)
index 0000000..654b21e
--- /dev/null
@@ -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 (file)
index 0000000..7543ac5
--- /dev/null
@@ -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/bitfield-and-union.x b/gcc/testsuite/gcc.target/arm/cmse/bitfield-and-union.x
new file mode 100644 (file)
index 0000000..0a6eb3d
--- /dev/null
@@ -0,0 +1,75 @@
+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;
+}
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 (file)
index 0000000..cdcd5ba
--- /dev/null
@@ -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 (file)
index 0000000..7b03819
--- /dev/null
@@ -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 (file)
index 0000000..3fa372a
--- /dev/null
@@ -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 (file)
index 0000000..7e14795
--- /dev/null
@@ -0,0 +1,7 @@
+int __attribute__ ((cmse_nonsecure_call)) (*bar) (double);
+
+int
+foo (int a)
+{
+  return bar (2.0) + a + 1;
+}
index c3b1396d52e742a1710ed5ad33fbeb559d866f6f..55da2a0c62237f3072ea155fde1e4a38f849dd6f 100644 (file)
@@ -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" } } */
index 0d029044aa9aa1d412c28ee5d18a8e3d0be36546..383363233e632189058559f4f569cd2f23fd3638 100644 (file)
@@ -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" } } */
index 005515ab9cb85c201a2a8b2f6417d73ceeacbc60..03c294ea323a7da7fa365b806db8b15e57ed7695 100644 (file)
@@ -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" } } */
index 6dd218e62fdee2a6af819079ba1ea1909185d076..7692a69b1598857eba0c7c72c16596eb34e672da 100644 (file)
@@ -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" } } */
index c833bcb0ae978572fad46780bc180f61ccb14345..a0a488775fe39ec282f9162714ba78d0217a08e1 100644 (file)
@@ -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" } } */
index d6e4cdb8c44b19c811f3a7b4fbce102a6c768f2b..8bfeeb0bbf61591783b60ec3858bed44efbaca89 100644 (file)
@@ -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/mainline/bitfield-and-union-1.c
deleted file mode 100644 (file)
index e139ba6..0000000
+++ /dev/null
@@ -1,94 +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 "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 (file)
index 0000000..aac5ae1
--- /dev/null
@@ -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" } } */
index a484cfee70b42b81629ed24a58aa9573183f58ba..6f4d6b4b75539a53502c4d99c06dcb36c34e338e 100644 (file)
@@ -5,14 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=softfp } {""} } */
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-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" } } */
index ebc080ac7aca7df8446d144a1c2b99f7062bd63a..0ae2a51990b3a32d6b1189816b8904467e699ead 100644 (file)
@@ -5,13 +5,8 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=softfp } {""} } */
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-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" } } */
index 4fabd45886348e69cdb89a799a1642c967006a95..141ba73484c21df108dc5c376a35787e9c07de3c 100644 (file)
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=softfp } {""} } */
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-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" } } */
index 9b18c3a86296374ff0d1e4b48da72534828acd25..6c5e688f220ca669fa7251acbee9161a2a769cfc 100644 (file)
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=softfp } {""} } */
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-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" } } */
index 36e301a446bbf670d76ad568281f2882c8281768..d35321bfda841be87f74ca17a4050c5eba67bf85 100644 (file)
@@ -5,14 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=softfp } {""} } */
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 
-
-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" } } */
index 5a7fb04f095dbd6155ca13d7c028218d5206a103..955f749cb72f08bc8c07c13e7d0fa17b78428904 100644 (file)
@@ -5,13 +5,8 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=softfp } {""} } */
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 
-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" } } */
index ff775795886ed37f0db668f2355521574186c00e..858555b8d89e10be6eed0ba47911b49843646470 100644 (file)
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=softfp } {""} } */
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 
-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" } } */
index dce0d90cec75aa95677a44a5ec2b804980ea778f..f85d68a3eff97c8f5a3b4057e374522be7e4333d 100644 (file)
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=softfp } {""} } */
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 
-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" } } */
index fe2ac47f7102faaf7a977b34d2c01c5a52ffdd10..11d44550de96c4dfc8ec3ab353b9a08c68d2d092 100644 (file)
@@ -4,13 +4,7 @@
 /* { dg-add-options arm_arch_v8m_main } */
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
 
-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" } } */
index dff8baa1b9dca53de6e5c7b42c7947aa51760a67..dfd2fe6323a5f2772f54599450177974e89a82e1 100644 (file)
@@ -4,13 +4,7 @@
 /* { dg-add-options arm_arch_v8m_main } */
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
 
-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" } } */
 
index a451f7a381de3818fef113f156722fe12802dcc6..76ca271278e07a777986afa1a7cf1d8d585121f5 100644 (file)
@@ -4,13 +4,7 @@
 /* { dg-add-options arm_arch_v8m_main } */
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
 
-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" } } */
index 6502fb7b11d24027799717f6215f573ad804049a..a917aa7778aa03f21d25b93dcfd27b0c2f96521f 100644 (file)
@@ -4,13 +4,7 @@
 /* { dg-add-options arm_arch_v8m_main } */
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=hard" -mfloat-abi=softfp } {""} } */
 
-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" } } */
index c14ef434fa717b6001a873cdc234c8541f7444f0..01e5d659fe2f63f85ce20dde3a019a71c7fea0dd 100644 (file)
@@ -5,13 +5,8 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=hard } {""} } */
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-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" } } */
index db17035547b84a235d2e75d3e82f993841d16f75..5d904786e41fc53f603d0082899599401596a12b 100644 (file)
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=hard } {""} } */
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-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" } } */
index 27acb9e055a3fd8ecc12f59ef62f3cce043f6b27..3feee43c423fe4573121f39e0e244b18090e7d2d 100644 (file)
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=hard } {""} } */
 /* { dg-skip-if "Skip these if testing double precision" {*-*-*} {"-mfpu=fpv[4-5]-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" } } */
index 97aba0d7775607e56c52cb25a526e6cf0c88569f..4eb984f44790b6577bfe6bb501a805219d38e980 100644 (file)
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=hard } {""} } */
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 
-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" } } */
index 5db888037dd1a0bbb4c03bef1cd47254fb6d49b5..4815a480f667d6493b81aa0d8fb8a6578d504813 100644 (file)
@@ -5,13 +5,8 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=hard } {""} } */
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 
-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" } } */
index c4d678d5cce72cc04423b7e403394707c5042238..5535c5514b115d4efb6be977e44b6170ec996fd8 100644 (file)
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=hard } {""} } */
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 
-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" } } */
index 948476d3224d13dfa874d88313e0de7e6ba5c39f..6663fc43f5f8f3ee7376750d288ac5f0858273c8 100644 (file)
@@ -5,13 +5,7 @@
 /* { dg-skip-if "Do not combine float-abi= hard | soft | softfp" {*-*-*} {"-mfloat-abi=soft" -mfloat-abi=hard } {""} } */
 /* { dg-skip-if "Skip these if testing single precision" {*-*-*} {"-mfpu=*-sp-*"} {""} } */
 
-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" } } */
index 1fc846cd7a51303ec00f8f512a54cd697fbd0682..071955f206c04c13ec04bbe7034edb4754c47563 100644 (file)
@@ -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" } } */
index 420d0f136ef171111c1cca6cd24c4f46b9fcb7fc..c7431930ff95215361feea6b28e981ed6d5cb824 100644 (file)
@@ -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 (file)
index 0000000..8fe9535
--- /dev/null
@@ -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 (file)
index 0000000..8a880e7
--- /dev/null
@@ -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;
+}