diff mbox

[testsuite,AVR] : Make PROGMEM variables const.

Message ID 4DA6C6CA.7000406@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay April 14, 2011, 10:04 a.m. UTC
These test cases

gcc.target/avr/trivial.c
gcc.target/avr/torture/trivial.c

put non-const variables in read-only section .progmem.data which
causes an error. The patch rewrites the files to make respective
variables real-only (and besides that fixes line endings).

Johann

./testsuite

2011-04-14  Georg-Johann Lay  <avr@gjlay.de>

	* gcc.target/avr/trivial.c: Fix line endings. Make PROGMEM
	variables const.
	* gcc.target/avr/torture/trivial.c: Ditto.

Comments

Denis Chertykov April 14, 2011, 10:24 a.m. UTC | #1
2011/4/14 Georg-Johann Lay <avr@gjlay.de>:
> These test cases
>
> gcc.target/avr/trivial.c
> gcc.target/avr/torture/trivial.c
>
> put non-const variables in read-only section .progmem.data which
> causes an error. The patch rewrites the files to make respective
> variables real-only (and besides that fixes line endings).
>
> Johann
>
> ./testsuite
>
> 2011-04-14  Georg-Johann Lay  <avr@gjlay.de>
>
>        * gcc.target/avr/trivial.c: Fix line endings. Make PROGMEM
>        variables const.
>        * gcc.target/avr/torture/trivial.c: Ditto.
>

Approved.

Denis.
diff mbox

Patch

Index: gcc.target/avr/torture/trivial.c
===================================================================
--- gcc.target/avr/torture/trivial.c	(Revision 172382)
+++ gcc.target/avr/torture/trivial.c	(Arbeitskopie)
@@ -1,14 +1,15 @@ 
-/* { dg-do run } */
-#include <stdio.h>
-
-#define __ATTR_PROGMEM__ __attribute__((__progmem__))
-
-#define PROGMEM __ATTR_PROGMEM__
-char PROGMEM a1 = 0x12; 
-int PROGMEM a2 = 0x2345; 
-long PROGMEM a3 = 0x12345678; 
-int main(void)
-{
-  printf("Hello World\n");
-  return 0;
-}
+/* { dg-do run } */
+
+#include <stdio.h>
+
+#define PROGMEM __attribute__((__progmem__))
+
+const char PROGMEM a1 = 0x12; 
+const int PROGMEM a2 = 0x2345; 
+const long PROGMEM a3 = 0x12345678; 
+
+int main(void)
+{
+  printf ("Hello World\n");
+  return 0;
+}
Index: gcc.target/avr/trivial.c
===================================================================
--- gcc.target/avr/trivial.c	(Revision 172382)
+++ gcc.target/avr/trivial.c	(Arbeitskopie)
@@ -1,14 +1,15 @@ 
-/* { dg-do run } */
-#include <stdio.h>
-
-#define __ATTR_PROGMEM__ __attribute__((__progmem__))
-
-#define PROGMEM __ATTR_PROGMEM__
-char PROGMEM a1 = 0x12; 
-int PROGMEM a2 = 0x2345; 
-long PROGMEM a3 = 0x12345678; 
-int main(void)
-{
-  printf("Hello World\n");
-  return 0;
-}
+/* { dg-do run } */
+
+#include <stdio.h>
+
+#define PROGMEM __attribute__((__progmem__))
+
+const char PROGMEM a1 = 0x12; 
+const int PROGMEM a2 = 0x2345; 
+const long PROGMEM a3 = 0x12345678; 
+
+int main(void)
+{
+  printf ("Hello World\n");
+  return 0;
+}