diff options
Diffstat (limited to 'gcc-4.7/gcc/testsuite/gcc.target/avr/torture')
24 files changed, 0 insertions, 937 deletions
diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-0.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-0.c deleted file mode 100644 index 880654201..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-0.c +++ /dev/null @@ -1,6 +0,0 @@ -/* { dg-options "-std=gnu99" } */ -/* { dg-do run } */ - -#define __as __flash - -#include "addr-space-1.h" diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-1.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-1.c deleted file mode 100644 index 137526527..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-1.c +++ /dev/null @@ -1,6 +0,0 @@ -/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */ -/* { dg-do run } */ - -#define __as __flash1 - -#include "addr-space-1.h" diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-g.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-g.c deleted file mode 100644 index 60feca145..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-g.c +++ /dev/null @@ -1,6 +0,0 @@ -/* { dg-options "-std=gnu99" } */ -/* { dg-do run } */ - -#define __as - -#include "addr-space-1.h" diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-x.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-x.c deleted file mode 100644 index 0b3c43a4b..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1-x.c +++ /dev/null @@ -1,6 +0,0 @@ -/* { dg-options "-std=gnu99" } */ -/* { dg-do run } */ - -#define __as __memx - -#include "addr-space-1.h" diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1.h b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1.h deleted file mode 100644 index 322a5b8b3..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-1.h +++ /dev/null @@ -1,83 +0,0 @@ -#include <stdlib.h> -#include <string.h> - -typedef struct -{ - char i1; - short i2; - long i4; - long long i8; - char str[2][10]; -} a_t; - -const __as a_t A = - { - 12, 345, 678910, 1234567891011ll, - { - "xxx..xxx", - "yyy..yyy" - } - }; - -const __as volatile a_t V = - { - 12+1, 345+1, 678910+1, 1234567891011ll+1, - { - "XXX..XXX", - "YYY..YYY" - } - }; - -a_t A2; -volatile a_t V2; - -int main (void) -{ - if (A.i1 != 12 - || A.i1 != V.i1 -1) - abort(); - - if (A.i2 != 345 - || A.i2 != V.i2 -1) - abort(); - - if (A.i4 != 678910 - || A.i4 != V.i4 -1) - abort(); - - if (A.i8 != 1234567891011ll - || A.i8 != V.i8 -1) - abort(); - - A2 = A; - V2 = V; - - if (A2.i1 != 12 - || A2.i1 != V2.i1 -1) - abort(); - - if (A2.i2 != 345 - || A2.i2 != V2.i2 -1) - abort(); - - if (A2.i4 != 678910 - || A2.i4 != V2.i4 -1) - abort(); - - if (A2.i8 != 1234567891011ll - || A2.i8 != V2.i8 -1) - abort(); - - if (strcmp (A2.str[0], "xxx..xxx")) - abort(); - if (strcmp (A2.str[1], "yyy..yyy")) - abort(); - - if (strcmp ((const char*) V2.str[0], "XXX..XXX")) - abort(); - if (strcmp ((const char*) V2.str[1], "YYY..YYY")) - abort(); - - exit (0); - return 0; -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-0.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-0.c deleted file mode 100644 index d5d4f92a9..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-0.c +++ /dev/null @@ -1,6 +0,0 @@ -/* { dg-options "-std=gnu99" } */ -/* { dg-do run } */ - -#define __as __flash - -#include "addr-space-2.h" diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-1.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-1.c deleted file mode 100644 index c8041f7d1..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-1.c +++ /dev/null @@ -1,6 +0,0 @@ -/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */ -/* { dg-do run } */ - -#define __as __flash1 - -#include "addr-space-2.h" diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-g.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-g.c deleted file mode 100644 index ad0b2b841..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-g.c +++ /dev/null @@ -1,6 +0,0 @@ -/* { dg-options "-std=gnu99" } */ -/* { dg-do run } */ - -#define __as - -#include "addr-space-2.h" diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-x.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-x.c deleted file mode 100644 index 846cca47d..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2-x.c +++ /dev/null @@ -1,9 +0,0 @@ -/* { dg-options "-std=gnu99 -Wa,--no-warn" } */ -/* { dg-do run } */ - -/* --no-warn because: "assembling 24-bit address needs binutils extension" - see binutils PR13503. */ - -#define __as __memx - -#include "addr-space-2.h" diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2.h b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2.h deleted file mode 100644 index c95a1631a..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/addr-space-2.h +++ /dev/null @@ -1,106 +0,0 @@ -extern void exit (int); -extern void abort (void); - -typedef struct T -{ - char val; - const __as struct T *l, *r; -} tree; - -/* - abcd - / \ - ab cd - / \ / \ - a b c d -*/ - -const __as tree a = { 'a', 0, 0 }; -const __as tree b = { 'b', 0, 0 }; -const __as tree c = { 'c', 0, 0 }; -const __as tree d = { 'd', 0, 0 }; - -const __as tree ab = { 'A', &a, &b }; -const __as tree cd = { 'C', &c, &d }; - -const __as tree abcd = { '*', &ab, &cd }; - -static void -test1 (void) -{ - if (abcd.val != '*') - abort(); - - if (abcd.l->val != 'A') - abort(); - if (abcd.r->val != 'C') - abort(); - - if (abcd.l->l->val != 'a') - abort(); - if (abcd.l->r->val != 'b') - abort(); - if (abcd.r->l->val != 'c') - abort(); - if (abcd.r->r->val != 'd') - abort(); -} - -static void -test2 (const __as tree *t) -{ - if (t->val != '*') - abort(); - - if (t->l->val != 'A') - abort(); - if (t->r->val != 'C') - abort(); - - if (t->l->l->val != 'a') - abort(); - if (t->l->r->val != 'b') - abort(); - if (t->r->l->val != 'c') - abort(); - if (t->r->r->val != 'd') - abort(); -} - -static void -test3 (const __as tree *pt) -{ - tree t = *pt; - - if (t.val != '*') - abort(); - - if (t.l->val != 'A') - abort(); - if (t.r->val != 'C') - abort(); - - if (t.l->l->val != 'a') - abort(); - if (t.l->r->val != 'b') - abort(); - if (t.r->l->val != 'c') - abort(); - if (t.r->r->val != 'd') - abort(); -} - -int main (void) -{ - const __as tree *t = &abcd; - test1(); - test2 (&abcd); - test3 (&abcd); - - __asm ("" : "+r" (t)); - test2 (t); - test3 (t); - - exit (0); - return 0; -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/avr-torture.exp b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/avr-torture.exp deleted file mode 100644 index 61cd3197f..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/avr-torture.exp +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (C) 2008 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GCC; see the file COPYING3. If not see -# <http://www.gnu.org/licenses/>. - -# GCC testsuite that uses the `gcc-dg.exp' driver, looping over -# optimization options. - -# Exit immediately if this isn't a AVR target. -if { ![istarget avr-*-*] } then { - return -} - -# Load support procs. -load_lib gcc-dg.exp - -# If a testcase doesn't have special options, use these. -global DEFAULT_CFLAGS -if ![info exists DEFAULT_CFLAGS] then { - set DEFAULT_CFLAGS " -ansi -pedantic-errors" -} - -# Initialize `dg'. -dg-init - - set AVR_TORTURE_OPTIONS [list \ - { -O0 } \ - { -O1 } \ - { -O2 } \ - { -Os -flto } \ - { -O2 -mcall-prologues } \ - { -O2 -fdata-sections } \ - { -O2 -fmerge-all-constants } \ - { -Os -fomit-frame-pointer } \ - { -Os -fomit-frame-pointer -finline-functions } \ - { -O3 -g } \ - { -Os -mcall-prologues} ] - - -#Initialize use of torture lists. -torture-init - -set-torture-options $AVR_TORTURE_OPTIONS - - -# Main loop. -gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{\[cS\],cpp}]] $DEFAULT_CFLAGS - -# Finalize use of torture lists. -torture-finish - -# All done. -dg-finish diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtin_insert_bits-1.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtin_insert_bits-1.c deleted file mode 100644 index fe20c9163..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtin_insert_bits-1.c +++ /dev/null @@ -1,97 +0,0 @@ -/* { dg-do run } */ - -#include <stdlib.h> - -#define MASK_F(M) \ - (0 \ - | ((0xf == (0xf & ((M) >> (4*0)))) ? (1 << 0) : 0) \ - | ((0xf == (0xf & ((M) >> (4*1)))) ? (1 << 1) : 0) \ - | ((0xf == (0xf & ((M) >> (4*2)))) ? (1 << 2) : 0) \ - | ((0xf == (0xf & ((M) >> (4*3)))) ? (1 << 3) : 0) \ - | ((0xf == (0xf & ((M) >> (4*4)))) ? (1 << 4) : 0) \ - | ((0xf == (0xf & ((M) >> (4*5)))) ? (1 << 5) : 0) \ - | ((0xf == (0xf & ((M) >> (4*6)))) ? (1 << 6) : 0) \ - | ((0xf == (0xf & ((M) >> (4*7)))) ? (1 << 7) : 0) \ - | 0) - -#define MASK_0_7(M) \ - (0 \ - | ((8 > (0xf & ((M) >> (4*0)))) ? (1 << 0) : 0) \ - | ((8 > (0xf & ((M) >> (4*1)))) ? (1 << 1) : 0) \ - | ((8 > (0xf & ((M) >> (4*2)))) ? (1 << 2) : 0) \ - | ((8 > (0xf & ((M) >> (4*3)))) ? (1 << 3) : 0) \ - | ((8 > (0xf & ((M) >> (4*4)))) ? (1 << 4) : 0) \ - | ((8 > (0xf & ((M) >> (4*5)))) ? (1 << 5) : 0) \ - | ((8 > (0xf & ((M) >> (4*6)))) ? (1 << 6) : 0) \ - | ((8 > (0xf & ((M) >> (4*7)))) ? (1 << 7) : 0) \ - | 0) - -#define INSERT_BITS(M,B,V) \ - (__extension__({ \ - unsigned char _n, _r = 0; \ - _n = 0xf & (M >> (4*0)); if (_n<8) _r |= (!!(B & (1 << _n))) << 0; \ - _n = 0xf & (M >> (4*1)); if (_n<8) _r |= (!!(B & (1 << _n))) << 1; \ - _n = 0xf & (M >> (4*2)); if (_n<8) _r |= (!!(B & (1 << _n))) << 2; \ - _n = 0xf & (M >> (4*3)); if (_n<8) _r |= (!!(B & (1 << _n))) << 3; \ - _n = 0xf & (M >> (4*4)); if (_n<8) _r |= (!!(B & (1 << _n))) << 4; \ - _n = 0xf & (M >> (4*5)); if (_n<8) _r |= (!!(B & (1 << _n))) << 5; \ - _n = 0xf & (M >> (4*6)); if (_n<8) _r |= (!!(B & (1 << _n))) << 6; \ - _n = 0xf & (M >> (4*7)); if (_n<8) _r |= (!!(B & (1 << _n))) << 7; \ - (unsigned char) ((V) & MASK_F(M)) | _r; \ - })) - -#define MASK_USED(M) (MASK_F(M) | MASK_0_7(M)) - -#define TEST2(M,B,V) \ - do { \ - __asm volatile (";" #M); \ - r1 = MASK_USED (M) \ - & __builtin_avr_insert_bits (M,B,V); \ - r2 = INSERT_BITS (M,B,V); \ - if (r1 != r2) \ - abort (); \ - } while(0) - -#define TEST1(M,X) \ - do { \ - TEST2 (M,X,0x00); TEST2 (M,0x00,X); \ - TEST2 (M,X,0xff); TEST2 (M,0xff,X); \ - TEST2 (M,X,0xaa); TEST2 (M,0xaa,X); \ - TEST2 (M,X,0xcc); TEST2 (M,0xcc,X); \ - TEST2 (M,X,0x96); TEST2 (M,0x96,X); \ - } while(0) - - - -void test8 (void) -{ - unsigned char r1, r2; - unsigned char ib; - - static const unsigned char V[] = - { - 0, 0xaa, 0xcc, 0xf0, 0xff, 0x5b, 0x4d - }; - - for (ib = 0; ib < sizeof (V) / sizeof (*V); ib++) - { - unsigned char b = V[ib]; - - TEST1 (0x76543210, b); - TEST1 (0x3210ffff, b); - TEST1 (0x67452301, b); - TEST1 (0xf0f1f2f3, b); - TEST1 (0xff10ff54, b); - TEST1 (0x01234567, b); - TEST1 (0xff765f32, b); - } -} - -/****************************************************************/ - -int main() -{ - test8(); - - exit(0); -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtin_insert_bits-2.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtin_insert_bits-2.c deleted file mode 100644 index 06cafd6af..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtin_insert_bits-2.c +++ /dev/null @@ -1,94 +0,0 @@ -/* { dg-do run } */ - -#include <stdlib.h> - -#define MASK_F(M) \ - (0 \ - | ((0xf == (0xf & ((M) >> (4*0)))) ? (1 << 0) : 0) \ - | ((0xf == (0xf & ((M) >> (4*1)))) ? (1 << 1) : 0) \ - | ((0xf == (0xf & ((M) >> (4*2)))) ? (1 << 2) : 0) \ - | ((0xf == (0xf & ((M) >> (4*3)))) ? (1 << 3) : 0) \ - | ((0xf == (0xf & ((M) >> (4*4)))) ? (1 << 4) : 0) \ - | ((0xf == (0xf & ((M) >> (4*5)))) ? (1 << 5) : 0) \ - | ((0xf == (0xf & ((M) >> (4*6)))) ? (1 << 6) : 0) \ - | ((0xf == (0xf & ((M) >> (4*7)))) ? (1 << 7) : 0) \ - | 0) - -#define MASK_0_7(M) \ - (0 \ - | ((8 > (0xf & ((M) >> (4*0)))) ? (1 << 0) : 0) \ - | ((8 > (0xf & ((M) >> (4*1)))) ? (1 << 1) : 0) \ - | ((8 > (0xf & ((M) >> (4*2)))) ? (1 << 2) : 0) \ - | ((8 > (0xf & ((M) >> (4*3)))) ? (1 << 3) : 0) \ - | ((8 > (0xf & ((M) >> (4*4)))) ? (1 << 4) : 0) \ - | ((8 > (0xf & ((M) >> (4*5)))) ? (1 << 5) : 0) \ - | ((8 > (0xf & ((M) >> (4*6)))) ? (1 << 6) : 0) \ - | ((8 > (0xf & ((M) >> (4*7)))) ? (1 << 7) : 0) \ - | 0) - -#define INSERT_BITS(M,B,V) \ - (__extension__({ \ - unsigned char _n, _r = 0; \ - _n = 0xf & (M >> (4*0)); if (_n<8) _r |= (!!(B & (1 << _n))) << 0; \ - _n = 0xf & (M >> (4*1)); if (_n<8) _r |= (!!(B & (1 << _n))) << 1; \ - _n = 0xf & (M >> (4*2)); if (_n<8) _r |= (!!(B & (1 << _n))) << 2; \ - _n = 0xf & (M >> (4*3)); if (_n<8) _r |= (!!(B & (1 << _n))) << 3; \ - _n = 0xf & (M >> (4*4)); if (_n<8) _r |= (!!(B & (1 << _n))) << 4; \ - _n = 0xf & (M >> (4*5)); if (_n<8) _r |= (!!(B & (1 << _n))) << 5; \ - _n = 0xf & (M >> (4*6)); if (_n<8) _r |= (!!(B & (1 << _n))) << 6; \ - _n = 0xf & (M >> (4*7)); if (_n<8) _r |= (!!(B & (1 << _n))) << 7; \ - (unsigned char) ((V) & MASK_F(M)) | _r; \ - })) - -#define MASK_USED(M) (MASK_F(M) | MASK_0_7(M)) - -#define TEST2(M,B,V) \ - do { \ - __asm volatile (";" #M); \ - r1 = MASK_USED (M) \ - & __builtin_avr_insert_bits (M,B,V); \ - r2 = INSERT_BITS (M,B,V); \ - if (r1 != r2) \ - abort (); \ - } while(0) - -void test8 (void) -{ - unsigned char r1, r2; - unsigned char ib, iv; - - static const unsigned char V[] = - { - 0, 0xaa, 0xcc, 0xf0, 0xff, 0x5b, 0x4d - }; - - for (ib = 0; ib < sizeof (V) / sizeof (*V); ib++) - { - unsigned char b = V[ib]; - - for (iv = 0; iv < sizeof (V) / sizeof (*V); iv++) - { - unsigned char v = V[iv]; - - TEST2 (0x76543210, b, v); - TEST2 (0xffffffff, b, v); - TEST2 (0x3210ffff, b, v); - TEST2 (0x67452301, b, v); - TEST2 (0xf0f1f2f3, b, v); - TEST2 (0xff10ff54, b, v); - TEST2 (0x0765f321, b, v); - TEST2 (0x11223344, b, v); - TEST2 (0x01234567, b, v); - TEST2 (0xff7765f3, b, v); - } - } -} - -/****************************************************************/ - -int main() -{ - test8(); - - exit(0); -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtins-1.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtins-1.c deleted file mode 100644 index 1fa3aaaae..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtins-1.c +++ /dev/null @@ -1,38 +0,0 @@ -/* { dg-do compile } */ - -void nop (void) { __builtin_avr_nop (); } -void sei (void) { __builtin_avr_sei (); } -void cli (void) { __builtin_avr_cli (); } -void wdr (void) { __builtin_avr_wdr (); } -void sleep (void) { __builtin_avr_sleep (); } - -char fmul (char a, char b) { return __builtin_avr_fmul (a, b); } -char fmuls (char a, char b) { return __builtin_avr_fmuls (a, b); } -char fmulsu (char a, char b) { return __builtin_avr_fmulsu (a, b); } - -char swap1 (char a) -{ - return __builtin_avr_swap (a+1); -} - -char swap2 (char a) -{ - return __builtin_avr_swap (__builtin_avr_swap (a+1)); -} - -char swap15 (void) -{ - return __builtin_avr_swap (15); -} - -void delay0 (void) { __builtin_avr_delay_cycles (0); } -void delay1 (void) { __builtin_avr_delay_cycles (1); } -void delay2 (void) { __builtin_avr_delay_cycles (2); } -void delay3 (void) { __builtin_avr_delay_cycles (3); } - -void delay_1 (void) { __builtin_avr_delay_cycles (44); } -void delay_2 (void) { __builtin_avr_delay_cycles (0x1234); } -void delay_3 (void) { __builtin_avr_delay_cycles (0x123456); } -void delay_4 (void) { __builtin_avr_delay_cycles (-1ul); } - -/* { dg-final { scan-assembler-not "__builtin_avr_" } } */ diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtins-2.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtins-2.c deleted file mode 100644 index ae207d9a9..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtins-2.c +++ /dev/null @@ -1,46 +0,0 @@ -/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */ -/* { dg-do run } */ - -#include <stdlib.h> -#include "../progmem.h" - -int volatile a; - -void f1 (void) -{ - __builtin_avr_sei (); - __builtin_avr_cli (); - __builtin_avr_wdr (); - __builtin_avr_sleep (); - __builtin_avr_nop (); - a = __builtin_avr_swap (a); - a = __builtin_avr_fmul (1,a); - a = __builtin_avr_fmuls (1,a); - a = __builtin_avr_fmulsu (1,a); - a = __builtin_avr_insert_bits (0x1f2f5364, a, a); -} - -const __flash char c0 = 1; -const __flash1 char c1 = 1; - -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; -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtins-error.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtins-error.c deleted file mode 100644 index 692b8afd8..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/builtins-error.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do assemble } */ - -char insert (long a) -{ - return __builtin_avr_insert_bits (15.3f+a, 0, 0); /* { dg-error "expects a compile time" } */ -} - -void delay (long a) -{ - __builtin_avr_delay_cycles (a); /* { dg-error "expects a compile time" } */ -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/int24-mul.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/int24-mul.c deleted file mode 100644 index c85d93277..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/int24-mul.c +++ /dev/null @@ -1,86 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-w" } */ - -#include <stdlib.h> - -const __flash __int24 vals[] = - { - 0, 1, 2, 3, -1, -2, -3, 0xff, 0x100, 0x101, - 0xffL * 0xff, 0xfffL * 0xfff, 0x101010L, 0xaaaaaaL - }; - -void test_u (void) -{ - unsigned int i; - unsigned long la, lb, lc; - __uint24 a, b, c; - - int S = sizeof (vals) / sizeof (*vals); - - for (i = 0; i < 500; i++) - { - if (i < S*S) - { - a = vals[i / S]; - b = vals[i % S]; - } - else - { - if (i & 1) - a += 0x7654321L; - else - b += 0x5fe453L; - } - - c = a * b; - - la = a; - lb = b; - lc = 0xffffff & (la * lb); - - if (c != lc) - abort(); - } -} - -#define TEST_N_U(A1,A2,B) \ - do { \ - if ((0xffffff & (A1*B)) != A2*B) \ - abort(); \ - } while (0) - -void test_nu (void) -{ - unsigned long la; - unsigned int i; - int S = sizeof (vals) / sizeof (*vals); - __uint24 a; - - for (i = 0; i < 500; i++) - { - a = i < S - ? vals[i % S] - : a + 0x7654321; - - la = a; - - TEST_N_U (la, a, 2); - TEST_N_U (la, a, 3); - TEST_N_U (la, a, 4); - TEST_N_U (la, a, 5); - TEST_N_U (la, a, 15); - TEST_N_U (la, a, 16); - TEST_N_U (la, a, 128); - TEST_N_U (la, a, 0x1000); - } -} - -int main (void) -{ - test_u(); - test_nu(); - - exit(0); - - return 0; -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr39633.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr39633.c deleted file mode 100644 index c5f5b0450..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr39633.c +++ /dev/null @@ -1,25 +0,0 @@ -/* { dg-do run } */ - -#include <stdlib.h> - -char c = 42; - -void __attribute__((noinline,noclone)) -pr39633 (char a) -{ - a >>= 7; - if (a) - c = a; -} - -int main() -{ - pr39633 (6); - - if (c != 42) - abort(); - - exit(0); - - return 0; -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr41885.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr41885.c deleted file mode 100644 index f46bc5a75..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr41885.c +++ /dev/null @@ -1,123 +0,0 @@ -/* { dg-options "-w -std=c99 -fno-inline" } */ -/* { dg-do run } */ - -#include <limits.h> -#include <stdint.h> -#include <stdlib.h> - - -uint16_t rotl_16a (uint16_t x) -{ - return (x << 8) | (x >> 8); -} -uint16_t rotl_16b (short dummy, uint16_t x) -{ - return (x << 8) | (x >> 8); -} - -uint32_t rotl_32a (uint32_t x) -{ - return (x << 8) | (x >> 24); -} -uint32_t rotl_32b (short dummy, uint32_t x) -{ - return (x << 8) | (x >> 24); -} -uint32_t rotl_32c (short dummy, uint32_t x) -{ - return (x << 16) | (x >> 16); -} -uint32_t rotl_32d (short dummy, uint32_t x) -{ - return (x << 24) | (x >> 8); -} -uint32_t rotl_32e (long dummy, uint32_t x) -{ - return (x << 24) | (x >> 8); -} - -uint64_t rotl_64 (uint64_t x) -{ - return (x << 56) | (x >> 8); -} - -uint64_t rotl_64a (short dummy, uint64_t x) -{ - return (x << 56) | (x >> 8); -} -uint64_t rotl_64b (short dummy, uint64_t x) -{ - return (x << 48) | (x >> 16); -} -uint64_t rotl_64c (short dummy, uint64_t x) -{ - return (x << 40) | (x >> 24); -} -uint64_t rotl_64d (short dummy, uint64_t x) -{ - return (x << 32) | (x >> 32); -} -uint64_t rotl_64e (short dummy, uint64_t x) -{ - return (x << 24) | (x >> 40); -} -uint64_t rotl_64f (short dummy, uint64_t x) -{ - return (x << 16) | (x >> 48); -} -uint64_t rotl_64g (short dummy, uint64_t x) -{ - return (x << 8) | (x >> 56); -} -uint64_t rotl_64h (long dummy, uint64_t x) -{ - return (x << 16) | (x >> 48); -} - - - - -int main (void) -{ - if (rotl_16a(0x1234) != 0x3412) - abort(); - if (rotl_16b(0xAA55,0x1234) != 0x3412) - abort(); - -uint32_t num32 = 0x12345678; - - if (rotl_32a(num32) != 0x34567812) - abort(); - if (rotl_32b(0xAA55,num32) != 0x34567812) - abort(); - if (rotl_32c(0xAA55,num32) != 0x56781234) - abort(); - if (rotl_32d(0xAA55,num32) != 0x78123456) - abort(); - if (rotl_32e(0x1122AA55,num32) != 0x78123456) - abort(); - -uint64_t num = 0x123456789ABCDEF0ULL; - - if (rotl_64(num) != 0xF0123456789ABCDEULL) - abort(); - if (rotl_64a(0xAA55,num) != 0xF0123456789ABCDEULL) - abort(); - if (rotl_64b(0xAA55,num) != 0xDEF0123456789ABCULL) - abort(); - if (rotl_64c(0xAA55,num) != 0xBCDEF0123456789AULL) - abort(); - if (rotl_64d(0xAA55,num) != 0x9ABCDEF012345678ULL) - abort(); - if (rotl_64e(0xAA55,num) != 0x789ABCDEF0123456ULL) - abort(); - if (rotl_64f(0xAA55,num) != 0x56789ABCDEF01234ULL) - abort(); - if (rotl_64g(0xAA55,num) != 0x3456789ABCDEF012ULL) - abort(); - if (rotl_64h(0x1122AA55,num) != 0x56789ABCDEF01234ULL) - abort(); - - exit (0); -} - diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr51374-1.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr51374-1.c deleted file mode 100644 index 9c98ea5f8..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr51374-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* PR rtl-optimization/51374 */ -/* { dg-do compile } */ - -void vector_18 (void) -{ - extern char slot; - unsigned char status = (*(volatile unsigned char*) 0x2B); - unsigned char data = (*(volatile unsigned char*) 0x2C); - - if (status & 0x10) - slot = 0; -} - -/* { dg-final { scan-assembler-not "\tsbic " } } */ -/* { dg-final { scan-assembler-not "\tsbis " } } */ diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr51782-1.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr51782-1.c deleted file mode 100644 index ff0f9d45f..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/pr51782-1.c +++ /dev/null @@ -1,51 +0,0 @@ -/* PR middle-end/51782 */ -/* { dg-do run } */ -/* { dg-options { "-std=gnu99" } } */ - -#include <stdlib.h> - -struct R { char r; }; -struct RGB { char r,g,b; }; - -__flash const struct R r1 = { 12 }; -__flash const struct RGB r3 = { 23, 56, 78 }; - -char __attribute__((noinline,noclone)) -read1_bug (const __flash struct R *s) -{ - struct R t = *s; - return t.r; -} - -char __attribute__((noinline,noclone)) -read1_ok (const __flash struct R *s) -{ - return s->r; -} - -char __attribute__((noinline,noclone)) -read3_bug (const __flash struct RGB *s) -{ - struct RGB t = *s; - return t.r + t.g + t.b; -} - -char __attribute__((noinline,noclone)) -read3_ok (const __flash struct RGB *s) -{ - return s->r + s->g + s->b; -} - -__flash const struct R * volatile p1 = &r1; -__flash const struct RGB * volatile p3 = &r3; - -int main (void) -{ - if (read1_bug (p1) != read1_ok (p1)) - abort(); - - if (read3_bug (p3) != read3_ok (p3)) - abort(); - - exit (0); -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/progmem-1.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/progmem-1.c deleted file mode 100644 index 790c676c9..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/progmem-1.c +++ /dev/null @@ -1,30 +0,0 @@ -/* { dg-do run } */ - -#include "../exit-abort.h" -#include "../progmem.h" - -const char strA[] PROGMEM = "@A"; -const char strc PROGMEM = 'c'; - -unsigned int volatile s = 2; - -int main() -{ - char c; - - c = pgm_read_char (&strA[s-1]); - if (c != 'A') - abort(); - - c = pgm_read_char (&PSTR ("@@B")[s]); - if (c != 'B') - abort(); - - c = pgm_read_char (&strc); - if (c != 'c') - abort(); - - exit (0); - - return 0; -} diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/progmem-1.cpp b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/progmem-1.cpp deleted file mode 100644 index a1df9e78e..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/progmem-1.cpp +++ /dev/null @@ -1,2 +0,0 @@ -/* { dg-do run } */ -#include "progmem-1.c" diff --git a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/trivial.c b/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/trivial.c deleted file mode 100644 index f1beecb1e..000000000 --- a/gcc-4.7/gcc/testsuite/gcc.target/avr/torture/trivial.c +++ /dev/null @@ -1,15 +0,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; -} |