[avr,applied] Fix some avr test cases
Checks
Commit Message
The patch below fixes some obvious problems in gcc.target/avr:
* Remove duplicate -mmcu=
* Skip tests with address spaces on Reduced Tiny which does not support
address spaces at all.
* Address spaces are GNU-C, but some tests were missing -std=gnu*
* Don't test address-space __flash1 on devices that don't have it.
Johann
--
AVR: Fix some test options. Skip tests with address-space on Reduced Tiny.
gcc/testsuite/
* gcc.target/avr/lra-cpymem_qi.c: Remove duplicate -mmcu=.
* gcc.target/avr/lra-elim.c: Same.
* gcc.target/avr/pr112830.c: Skip for Reduced Tiny.
* gcc.target/avr/pr46779-1.c: Same.
* gcc.target/avr/pr46779-2.c: Same.
* gcc.target/avr/pr86869.c: Skip for Reduced Tiny and add -std=gnu99
for GNU-C due to address spaces.
* gcc.target/avr/pr89270.c: Same.
* gcc.target/avr/torture/builtins-2-flash.c: Only test address
space __flash1 if we have it.
* gcc.target/avr/torture/addr-space-1-1.c: Same.
* gcc.target/avr/torture/addr-space-2-1.c: Same.
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-mmcu=avr51 -Os" } */
+/* { dg-options "-Os" } */
#include <stdbool.h>
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-mmcu=avr25 -Os" } */
+/* { dg-options "-Os" } */
typedef int HItype __attribute__ ((mode (HI)));
HItype
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target { ! avr_tiny } } } */
/* { dg-options "" } */
typedef __SIZE_TYPE__ size_t;
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-Os -fsplit-wide-types" } */
/* This testcase should uncover bugs like
@@ -1,4 +1,4 @@
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-Os -fno-split-wide-types" } */
/* This testcase should uncover bugs like
@@ -1,4 +1,5 @@
-/* { dg-do compile } */
+/* { dg-do compile { target { ! avr_tiny } } } */
+/* { dg-additional-options "-std=gnu99 -w" } */
struct S {
char y[2];
@@ -1,4 +1,5 @@
-/* { dg-do compile } */
+/* { dg-do compile { target { ! avr_tiny } } } */
+/* { dg-additional-options "-std=gnu99" } */
void test()
{
@@ -1,6 +1,10 @@
/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
/* { dg-do run { target { ! avr_tiny } } } */
+#ifdef __FLASH1
#define __as __flash1
+#else
+#define __as __flash
+#endif
#include "addr-space-1.h"
@@ -1,6 +1,10 @@
/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
/* { dg-do run { target { ! avr_tiny } } } */
+#ifdef __FLASH1
#define __as __flash1
+#else
+#define __as __flash
+#endif
#include "addr-space-2.h"
@@ -4,7 +4,9 @@
#include <stdlib.h>
const __flash char c0 = 1;
+#ifdef __FLASH1
const __flash1 char c1 = 1;
+#endif
int main (void)
{
@@ -14,9 +16,11 @@ int main (void)
if (__builtin_avr_flash_segment (p) != 0)
abort();
+#ifdef __FLASH1
p = &c1;
if (__builtin_avr_flash_segment (p) != 1)
abort();
+#endif
if (__builtin_avr_flash_segment ("p") != -1)
abort();