+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
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
+++ /dev/null
-/* { 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" } } */
--- /dev/null
+/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}
--- /dev/null
+int __attribute__ ((cmse_nonsecure_call)) (*bar) (float, double);
+
+int
+foo (int a)
+{
+ return bar (3.0f, 2.0) + a + 1;
+}
--- /dev/null
+extern float bar (void);
+
+float __attribute__ ((cmse_nonsecure_entry))
+foo (void)
+{
+ return bar ();
+}
--- /dev/null
+int __attribute__ ((cmse_nonsecure_call)) (*bar) (void);
+
+int
+foo (int a)
+{
+ return bar () + a + 1;
+}
--- /dev/null
+int __attribute__ ((cmse_nonsecure_call)) (*bar) (double);
+
+int
+foo (int a)
+{
+ return bar (2.0) + a + 1;
+}
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
+++ /dev/null
-/* { 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" } } */
--- /dev/null
+/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
/* { 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" } } */
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}