* gcc.target/avr/progmem.h (pgm_read_char): Handle AVR_TINY.
* gcc.target/avr/pr52472.c: Add "! avr_tiny" target filter.
* gcc.target/avr/pr71627.c: Same.
* gcc.target/avr/torture/addr-space-1-0.c: Same.
* gcc.target/avr/torture/addr-space-1-1.c: Same.
* gcc.target/avr/torture/addr-space-1-x.c: Same.
* gcc.target/avr/torture/addr-space-2-0.c: Same.
* gcc.target/avr/torture/addr-space-2-1.c: Same.
* gcc.target/avr/torture/addr-space-2-x.c: Same.
* gcc.target/avr/torture/sat-hr-plus-minus.c: Same.
* gcc.target/avr/torture/sat-k-plus-minus.c: Same.
* gcc.target/avr/torture/sat-llk-plus-minus.c: Same.
* gcc.target/avr/torture/sat-r-plus-minus.c: Same.
* gcc.target/avr/torture/sat-uhr-plus-minus.c: Same.
* gcc.target/avr/torture/sat-uk-plus-minus.c: Same.
* gcc.target/avr/torture/sat-ullk-plus-minus.c: Same.
* gcc.target/avr/torture/sat-ur-plus-minus.c: Same.
* gcc.target/avr/torture/pr61055.c: Same.
* gcc.target/avr/torture/builtins-3-absfx.c: Only use __flash if
available.
* gcc.target/avr/torture/int24-mul.c: Same.
* gcc.target/avr/torture/pr51782-1.c: Same.
* gcc.target/avr/torture/pr61443.c: Same.
* gcc.target/avr/torture/builtins-2.c: Factor out addr-space stuff...
* gcc.target/avr/torture/builtins-2-flash.c: ...to this new test.
From-SVN: r256690
+2018-01-15 Georg-Johann Lay <avr@gjlay.de>
+
+ Adjust tests to AVR_TINY.
+
+ * gcc.target/avr/progmem.h (pgm_read_char): Handle AVR_TINY.
+ * gcc.target/avr/pr52472.c: Add "! avr_tiny" target filter.
+ * gcc.target/avr/pr71627.c: Same.
+ * gcc.target/avr/torture/addr-space-1-0.c: Same.
+ * gcc.target/avr/torture/addr-space-1-1.c: Same.
+ * gcc.target/avr/torture/addr-space-1-x.c: Same.
+ * gcc.target/avr/torture/addr-space-2-0.c: Same.
+ * gcc.target/avr/torture/addr-space-2-1.c: Same.
+ * gcc.target/avr/torture/addr-space-2-x.c: Same.
+ * gcc.target/avr/torture/sat-hr-plus-minus.c: Same.
+ * gcc.target/avr/torture/sat-k-plus-minus.c: Same.
+ * gcc.target/avr/torture/sat-llk-plus-minus.c: Same.
+ * gcc.target/avr/torture/sat-r-plus-minus.c: Same.
+ * gcc.target/avr/torture/sat-uhr-plus-minus.c: Same.
+ * gcc.target/avr/torture/sat-uk-plus-minus.c: Same.
+ * gcc.target/avr/torture/sat-ullk-plus-minus.c: Same.
+ * gcc.target/avr/torture/sat-ur-plus-minus.c: Same.
+ * gcc.target/avr/torture/pr61055.c: Same.
+ * gcc.target/avr/torture/builtins-3-absfx.c: Only use __flash if
+ available.
+ * gcc.target/avr/torture/int24-mul.c: Same.
+ * gcc.target/avr/torture/pr51782-1.c: Same.
+ * gcc.target/avr/torture/pr61443.c: Same.
+ * gcc.target/avr/torture/builtins-2.c: Factor out addr-space stuff...
+ * gcc.target/avr/torture/builtins-2-flash.c: ...to this new test.
+
2018-01-15 Georg-Johann Lay <avr@gjlay.de>
PR c/83801
-/* { dg-do compile } */
+/* { dg-do compile { target { ! avr_tiny } } } */
/* { dg-options "-Os -g -Wno-pointer-to-int-cast" } */
/* This testcase exposes PR52472. expand_debug_expr mistakenly
-/* { dg-do compile } */
+/* { dg-do compile { target { ! avr_tiny } } } */
/* { dg-options "-O1" } */
__asm__ ("lpm %0, %a1" \
: "=r" (__result) : "z" (__addr16)); \
__result; }))
+#elif defined (__AVR_TINY__)
+/* PR71948 auto-adds 0x4000 as needed, hance just a plain read. */
+#define pgm_read_char(addr) \
+ (*(addr))
#else
#define pgm_read_char(addr) \
(__extension__({ \
/* { dg-options "-std=gnu99" } */
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
#define __as __flash
/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
#define __as __flash1
/* { dg-options "-std=gnu99" } */
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
#define __as __memx
/* { dg-options "-std=gnu99" } */
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
#define __as __flash
/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
#define __as __flash1
/* { dg-options "-std=gnu99 -Wa,--no-warn" } */
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* --no-warn because: "assembling 24-bit address needs binutils extension"
see binutils PR13503. */
--- /dev/null
+/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
+/* { dg-do run { target { ! avr_tiny } } } */
+
+#include <stdlib.h>
+
+const __flash char c0 = 1;
+const __flash1 char c1 = 1;
+
+int main (void)
+{
+ const __memx void *p;
+
+ p = &c0;
+ if (__builtin_avr_flash_segment (p) != 0)
+ abort();
+
+ p = &c1;
+ if (__builtin_avr_flash_segment (p) != 1)
+ abort();
+
+ if (__builtin_avr_flash_segment ("p") != -1)
+ abort();
+
+ exit (0);
+ return 0;
+}
-/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
+/* { dg-options "-std=gnu99" } */
/* { dg-do run } */
#include <stdlib.h>
-#include "../progmem.h"
int volatile a;
a = __builtin_avr_insert_bits (0x1f2f5364, a, a);
}
-const __flash char c0 = 1;
-const __flash1 char c1 = 1;
-
-int main (void)
+int main (void)
{
- const __memx void *p;
-
f1();
__builtin_avr_delay_cycles (1000);
- p = &c0;
- if (__builtin_avr_flash_segment (p) != 0)
- abort();
-
- p = &c1;
- if (__builtin_avr_flash_segment (p) != 1)
- abort();
-
- if (__builtin_avr_flash_segment ("p") != -1)
- abort();
-
exit (0);
return 0;
}
if (abs ## FX (-VAL ## FX) != abs ## FX (VAL ## FX)) \
abort();
+#ifndef __FLASH
+#define __flash /* empty */
+#endif
+
const __flash short fract volatile v = 0.33hr;
const __flash short fract volatile z = 0hr;
#include <stdlib.h>
+#ifndef __FLASH
+#define __flash /* empty */
+#endif
+
const __flash __int24 vals[] =
{
0, 1, 2, 3, -1, -2, -3, 0xff, 0x100, 0x101,
#include <stdlib.h>
+#ifndef __FLASH
+#define __flash /* empty */
+#endif
+
struct R { char r; };
struct RGB { char r,g,b; };
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options { -fno-peephole2 } } */
#include <stdlib.h>
#include <stdlib.h>
#include <stdarg.h>
+#ifndef __FLASH
+#define __flash /* empty */
+#define __memx /* empty */
+#endif
+
#define NC __attribute__((noinline,noclone))
void NC vfun (char n, ...)
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h"
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h"
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h"
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h"
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h"
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h"
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h"
-/* { dg-do run } */
+/* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h"