Commit 1759d116 by Georg-Johann Lay Committed by Georg-Johann Lay

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.

From-SVN: r256690
parent bab0a26d
2018-01-15 Georg-Johann Lay <avr@gjlay.de> 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 PR c/83801
PR c/83729 PR c/83729
* gcc.target/avr/torture/pr83729.c: New test. * gcc.target/avr/torture/pr83729.c: New test.
......
/* { dg-do compile } */ /* { dg-do compile { target { ! avr_tiny } } } */
/* { dg-options "-Os -g -Wno-pointer-to-int-cast" } */ /* { dg-options "-Os -g -Wno-pointer-to-int-cast" } */
/* This testcase exposes PR52472. expand_debug_expr mistakenly /* This testcase exposes PR52472. expand_debug_expr mistakenly
......
/* { dg-do compile } */ /* { dg-do compile { target { ! avr_tiny } } } */
/* { dg-options "-O1" } */ /* { dg-options "-O1" } */
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
__asm__ ("lpm %0, %a1" \ __asm__ ("lpm %0, %a1" \
: "=r" (__result) : "z" (__addr16)); \ : "=r" (__result) : "z" (__addr16)); \
__result; })) __result; }))
#elif defined (__AVR_TINY__)
/* PR71948 auto-adds 0x4000 as needed, hance just a plain read. */
#define pgm_read_char(addr) \
(*(addr))
#else #else
#define pgm_read_char(addr) \ #define pgm_read_char(addr) \
(__extension__({ \ (__extension__({ \
......
/* { dg-options "-std=gnu99" } */ /* { dg-options "-std=gnu99" } */
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
#define __as __flash #define __as __flash
......
/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */ /* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
#define __as __flash1 #define __as __flash1
......
/* { dg-options "-std=gnu99" } */ /* { dg-options "-std=gnu99" } */
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
#define __as __memx #define __as __memx
......
/* { dg-options "-std=gnu99" } */ /* { dg-options "-std=gnu99" } */
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
#define __as __flash #define __as __flash
......
/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */ /* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
#define __as __flash1 #define __as __flash1
......
/* { dg-options "-std=gnu99 -Wa,--no-warn" } */ /* { 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" /* --no-warn because: "assembling 24-bit address needs binutils extension"
see binutils PR13503. */ see binutils PR13503. */
......
/* { 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 } */ /* { dg-do run } */
#include <stdlib.h> #include <stdlib.h>
#include "../progmem.h"
int volatile a; int volatile a;
...@@ -20,27 +19,11 @@ void f1 (void) ...@@ -20,27 +19,11 @@ void f1 (void)
a = __builtin_avr_insert_bits (0x1f2f5364, a, a); a = __builtin_avr_insert_bits (0x1f2f5364, a, a);
} }
const __flash char c0 = 1; int main (void)
const __flash1 char c1 = 1;
int main (void)
{ {
const __memx void *p;
f1(); f1();
__builtin_avr_delay_cycles (1000); __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); exit (0);
return 0; return 0;
} }
...@@ -98,6 +98,10 @@ long long accum test2_llk (void) ...@@ -98,6 +98,10 @@ long long accum test2_llk (void)
if (abs ## FX (-VAL ## FX) != abs ## FX (VAL ## FX)) \ if (abs ## FX (-VAL ## FX) != abs ## FX (VAL ## FX)) \
abort(); abort();
#ifndef __FLASH
#define __flash /* empty */
#endif
const __flash short fract volatile v = 0.33hr; const __flash short fract volatile v = 0.33hr;
const __flash short fract volatile z = 0hr; const __flash short fract volatile z = 0hr;
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
#include <stdlib.h> #include <stdlib.h>
#ifndef __FLASH
#define __flash /* empty */
#endif
const __flash __int24 vals[] = const __flash __int24 vals[] =
{ {
0, 1, 2, 3, -1, -2, -3, 0xff, 0x100, 0x101, 0, 1, 2, 3, -1, -2, -3, 0xff, 0x100, 0x101,
......
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
#include <stdlib.h> #include <stdlib.h>
#ifndef __FLASH
#define __flash /* empty */
#endif
struct R { char r; }; struct R { char r; };
struct RGB { char r,g,b; }; struct RGB { char r,g,b; };
......
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options { -fno-peephole2 } } */ /* { dg-options { -fno-peephole2 } } */
#include <stdlib.h> #include <stdlib.h>
......
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#ifndef __FLASH
#define __flash /* empty */
#define __memx /* empty */
#endif
#define NC __attribute__((noinline,noclone)) #define NC __attribute__((noinline,noclone))
void NC vfun (char n, ...) void NC vfun (char n, ...)
......
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */ /* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h" #include "fix-types.h"
......
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */ /* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h" #include "fix-types.h"
......
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */ /* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h" #include "fix-types.h"
......
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */ /* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h" #include "fix-types.h"
......
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */ /* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h" #include "fix-types.h"
......
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */ /* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h" #include "fix-types.h"
......
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */ /* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h" #include "fix-types.h"
......
/* { dg-do run } */ /* { dg-do run { target { ! avr_tiny } } } */
/* { dg-options "-std=gnu99 -fwrapv" } */ /* { dg-options "-std=gnu99 -fwrapv" } */
#include "fix-types.h" #include "fix-types.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment