diff options
author | Dan Albert <danalbert@google.com> | 2016-02-24 13:48:45 -0800 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2016-02-24 13:51:18 -0800 |
commit | b9de1157289455b0ca26daff519d4a0ddcd1fa13 (patch) | |
tree | 4c56cc0a34b91f17033a40a455f26652304f7b8d /gcc-4.8.1/gcc/testsuite/gcc.target/sh | |
parent | 098157a754787181cfa10e71325832448ddcea98 (diff) | |
download | toolchain_gcc-b9de1157289455b0ca26daff519d4a0ddcd1fa13.tar.gz toolchain_gcc-b9de1157289455b0ca26daff519d4a0ddcd1fa13.tar.bz2 toolchain_gcc-b9de1157289455b0ca26daff519d4a0ddcd1fa13.zip |
Update 4.8.1 to 4.8.3.
My previous drop was the wrong version. The platform mingw is
currently using 4.8.3, not 4.8.1 (not sure how I got that wrong).
From ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.3/gcc-4.8.3.tar.bz2.
Bug: http://b/26523949
Change-Id: Id85f1bdcbbaf78c7d0b5a69e74c798a08f341c35
Diffstat (limited to 'gcc-4.8.1/gcc/testsuite/gcc.target/sh')
129 files changed, 0 insertions, 5434 deletions
diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/20080410-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/20080410-1.c deleted file mode 100644 index 63e517e94..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/20080410-1.c +++ /dev/null @@ -1,29 +0,0 @@ -/* { dg-do compile { target "sh-*-*" } } */ -/* { dg-options "-O0" } */ -/* { dg-skip-if "" { "sh*-*-*" } "-mb" "" } */ -/* { dg-final { scan-assembler-not "add\tr0,r0" } } */ - -/* This test checks chain reloads conflicts. If they don't - conflict, the same hard register R0 is used for the both reloads - but in this case the second reload needs an intermediate register - (which is the reload register). As the result we have the - following code - - mov #4,r0 -- first reload - mov r14,r0 -- second reload - add r0,r0 -- second reload - - The right code should be - - mov #4,r0 -- first reload - mov r14,r1 -- second reload - add r0,r1 -- second reload - -*/ - -_Complex float foo_float (); - -void bar_float () -{ - __real foo_float (); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/fpul-usage-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/fpul-usage-1.c deleted file mode 100644 index 394e7ef81..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/fpul-usage-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Check that the FPUL register is used when reading a float as an int and - vice versa, as opposed to pushing and popping the values over the stack. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler "fpul" } } */ -/* { dg-final { scan-assembler-not "r15" } } */ - -int -float_as_int (float val) -{ - union { float f; int i; } u; - u.f = val; - return u.i; -} - -float -int_as_float (int val) -{ - union { float f; int i; } u; - u.i = val; - return u.f; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/mfmovd.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/mfmovd.c deleted file mode 100644 index b5653c764..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/mfmovd.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Verify that we generate fmov.d instructions to move doubles when -mfmovd - option is enabled. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-mfmovd" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a" "-m2a-single" "-m4" "-m4-single" "-m4-100" "-m4-100-single" "-m4-200" "-m4-200-single" "-m4-300" "-m4-300-single" "-m4a" "-m4a-single" } } */ -/* { dg-final { scan-assembler "fmov.d" } } */ - -extern double g; - -void -f (double d) -{ - g = d; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-1.c deleted file mode 100644 index 5d5b6d7f9..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-1.c +++ /dev/null @@ -1,17 +0,0 @@ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2 -fomit-frame-pointer" } */ -/* { dg-final { scan-assembler "mov fr4,fr.; mov fr5,fr." { target sh-*-* } } } */ -/* { dg-final { scan-assembler "mov fr4,fr.; mov fr5,fr." { target sh[1234lb]*-*-* } } } */ -/* { dg-final { scan-assembler "mov fr0,fr.; mov fr1,fr." { target sh[56]*-*-* } } } */ -double -f (double d) -{ - double r; - -#if defined (__SH_FPU_DOUBLE__) - asm ("mov %S1,%S0; mov %R1,%R0" : "=f" (r) : "f" (d)); -#else - asm ("mov fr4,fr4; mov fr5,fr5"); -#endif - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-2-mb.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-2-mb.c deleted file mode 100644 index ac2ce687e..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-2-mb.c +++ /dev/null @@ -1,19 +0,0 @@ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-mb -O2 -fomit-frame-pointer" } */ -/* { dg-final { scan-assembler "mov @r.,r.; mov @\\(4,r.\\),r." } } */ -double d; - -double -f (void) -{ - double r; - -/* If -ml from the target options is passed after -mb from dg-options, we - end up with th reverse endianness. */ -#if TARGET_SHMEDIA || defined (__LITTLE_ENDIAN__) - asm ("mov @r1,r3; mov @(4,r1),r4"); -#else - asm ("mov %S1,%S0; mov %R1,%R0" : "=&r" (r) : "m" (d)); -#endif - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-2-ml.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-2-ml.c deleted file mode 100644 index 570e7dd0b..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-2-ml.c +++ /dev/null @@ -1,13 +0,0 @@ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2 -fomit-frame-pointer" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-mb" && "-m5*"} { "" } } */ -/* { dg-final { scan-assembler "mov @\\(4,r.\\),r.; mov @r.,r." } } */ -double d; - -double -f (void) -{ - double r; - asm ("mov %S1,%S0; mov %R1,%R0" : "=&r" (r) : "m" (d)); - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-3.c deleted file mode 100644 index 58d7849cf..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-3.c +++ /dev/null @@ -1,14 +0,0 @@ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2 -fomit-frame-pointer" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m2e" "-m3e" "*single-only" } { "" } } */ -/* { dg-final { scan-assembler "mov #?0,r.*; mov #?20,r" } } */ -/* { dg-final { scan-assembler "mov #?1077149696,r.*; mov #?0,r" } } */ -double -f () -{ - double r; - - asm ("mov %S1,%S0; mov %R1,%R0" : "=r" (r) : "i" (20)); - asm ("mov %S1,%S0; mov %R1,%R0" : "+r" (r) : "i" (20.)); - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-4.c deleted file mode 100644 index c848c26c0..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr21255-4.c +++ /dev/null @@ -1,13 +0,0 @@ -/* { dg-do compile { target { sh*-*-* && nonpic } } } */ -/* { dg-options "-O2 -fomit-frame-pointer" } */ - -double -f () -{ - double r; - - asm ("mov %S1,%S0; mov %R1,%R0" : "=r" (r) : "i" (f)); -/* { dg-error "invalid operand to %S" "" {target "sh*-*-*" } 9 } */ -/* { dg-error "invalid operand to %R" "" {target "sh*-*-*" } 9 } */ - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-1.c deleted file mode 100644 index 6c28e8c3b..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Check that fcmp/eq and fcmp/gt instructions are generated by default - (implicit -mieee). */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fcmp/eq" 4 } } */ -/* { dg-final { scan-assembler-times "fcmp/gt" 4 } } */ - -int -test_00 (float a, float b) -{ - return a <= b; -} - -int -test_01 (float a, float b) -{ - return a >= b; -} - -int -test_02 (double a, double b) -{ - return a <= b; -} - -int -test_03 (double a, double b) -{ - return a >= b; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-2.c deleted file mode 100644 index 37c4035de..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-2.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Check that only the fcmp/gt instruction is generated when specifying - -ffinite-math-only (implicit -mno-ieee). */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -ffinite-math-only" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "fcmp/eq" } } */ -/* { dg-final { scan-assembler-times "fcmp/gt" 4 } } */ - -int -test_00 (float a, float b) -{ - return a <= b; -} - -int -test_01 (float a, float b) -{ - return a >= b; -} - -int -test_02 (double a, double b) -{ - return a <= b; -} - -int -test_03 (double a, double b) -{ - return a >= b; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-3.c deleted file mode 100644 index cbda922e1..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-3.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Check that fcmp/eq and fcmp/gt instructions are generated when specifying - -ffinite-math-only and -mieee. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -ffinite-math-only -mieee" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fcmp/eq" 4 } } */ -/* { dg-final { scan-assembler-times "fcmp/gt" 4 } } */ - -int -test_00 (float a, float b) -{ - return a <= b; -} - -int -test_01 (float a, float b) -{ - return a >= b; -} - -int -test_02 (double a, double b) -{ - return a <= b; -} - -int -test_03 (double a, double b) -{ - return a >= b; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-4.c deleted file mode 100644 index 3e4aa51cd..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr33135-4.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Check that only the fcmp/gt instruction is generated when specifying - -fno-finite-math-only and -mno-ieee. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -fno-finite-math-only -mno-ieee" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "fcmp/eq" } } */ -/* { dg-final { scan-assembler-times "fcmp/gt" 4 } } */ - -int -test_00 (float a, float b) -{ - return a <= b; -} - -int -test_01 (float a, float b) -{ - return a >= b; -} - -int -test_02 (double a, double b) -{ - return a <= b; -} - -int -test_03 (double a, double b) -{ - return a >= b; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr39423-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr39423-1.c deleted file mode 100644 index dac0f89ee..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr39423-1.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Check that displacement addressing is used for indexed addresses with a - small offset, instead of re-calculating the index. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-not "add\t#1" } } */ - -int -test_00 (int tab[], int index) -{ - return tab[index + 1]; -} - -int -test_01 (short tab[], int index) -{ - return tab[index + 1]; -} - -int -test_02 (unsigned short tab[], int index) -{ - return tab[index + 1]; -} - -int -test_03 (long long tab[], int index) -{ - return (int)tab[index + 1]; -} - -void -test_04 (int tab[], int index, int val) -{ - tab[index + 1] = val; -} - -void -test_05 (short tab[], int index, int val) -{ - tab[index + 1] = (short)val; -} - -void -test_06 (unsigned short tab[], int index, int val) -{ - tab[index + 1] = (unsigned short)val; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr39423-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr39423-2.c deleted file mode 100644 index 8e71505f2..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr39423-2.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Check that displacement addressing is used for indexed addresses with a - small offset, instead of re-calculating the index and that the movu.w - instruction is used on SH2A. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */ -/* { dg-final { scan-assembler-not "add\t#1" } } */ -/* { dg-final { scan-assembler "movu.w" } } */ - -int -test_00 (unsigned short tab[], int index) -{ - return tab[index + 1]; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr43417.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr43417.c deleted file mode 100644 index 081ff46b9..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr43417.c +++ /dev/null @@ -1,36 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -m4" } */ - -int pid_count = 0; -main (int argc, char *argv[]) -{ - unsigned int c; - unsigned long long maxbytes = 0; - extern char *optarg; - int i; - int pid_cntr; - int pid; - int pid_list[1000]; - while ((c = getopt (argc, argv, "c:b:p:wvh")) != (-1)) - { - switch ((char) c) - { - case 'b': - maxbytes = atoll (optarg); - } - } - pid = fork (); - while ((pid != 0) && (maxbytes > 1024 * 1024 * 1024)) - { - maxbytes = maxbytes - (1024 * 1024 * 1024); - pid = fork (); - if (pid != 0) - pid_cntr++; - pid_list[i] = pid; - } - while ((pid_count < pid_cntr)) - { - } - kill (pid_list[i], 9); -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49263.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49263.c deleted file mode 100644 index b5ffe714f..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49263.c +++ /dev/null @@ -1,86 +0,0 @@ -/* Verify that TST #imm, R0 instruction is generated if the constant - allows it. Under some circumstances another compare instruction might - be selected, which is also fine. Any AND instructions are considered - counter productive and fail the test. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-not "and" } } */ - -#define make_func(__valtype__, __valget__, __tstval__, __suff__)\ - int test_imm_##__tstval__##__suff__ (__valtype__ val) \ - {\ - return ((__valget__) & (0x##__tstval__ << 0)) ? -20 : -40;\ - } - -#define make_func_0_F(__valtype__, __valget__, __y__, __suff__)\ - make_func (__valtype__, __valget__, __y__##0, __suff__)\ - make_func (__valtype__, __valget__, __y__##1, __suff__)\ - make_func (__valtype__, __valget__, __y__##2, __suff__)\ - make_func (__valtype__, __valget__, __y__##3, __suff__)\ - make_func (__valtype__, __valget__, __y__##4, __suff__)\ - make_func (__valtype__, __valget__, __y__##5, __suff__)\ - make_func (__valtype__, __valget__, __y__##6, __suff__)\ - make_func (__valtype__, __valget__, __y__##7, __suff__)\ - make_func (__valtype__, __valget__, __y__##8, __suff__)\ - make_func (__valtype__, __valget__, __y__##9, __suff__)\ - make_func (__valtype__, __valget__, __y__##A, __suff__)\ - make_func (__valtype__, __valget__, __y__##B, __suff__)\ - make_func (__valtype__, __valget__, __y__##C, __suff__)\ - make_func (__valtype__, __valget__, __y__##D, __suff__)\ - make_func (__valtype__, __valget__, __y__##E, __suff__)\ - make_func (__valtype__, __valget__, __y__##F, __suff__)\ - -#define make_funcs_0_FF(__valtype__, __valget__, __suff__)\ - make_func_0_F (__valtype__, __valget__, 0, __suff__)\ - make_func_0_F (__valtype__, __valget__, 1, __suff__)\ - make_func_0_F (__valtype__, __valget__, 2, __suff__)\ - make_func_0_F (__valtype__, __valget__, 3, __suff__)\ - make_func_0_F (__valtype__, __valget__, 4, __suff__)\ - make_func_0_F (__valtype__, __valget__, 5, __suff__)\ - make_func_0_F (__valtype__, __valget__, 6, __suff__)\ - make_func_0_F (__valtype__, __valget__, 7, __suff__)\ - make_func_0_F (__valtype__, __valget__, 8, __suff__)\ - make_func_0_F (__valtype__, __valget__, 9, __suff__)\ - make_func_0_F (__valtype__, __valget__, A, __suff__)\ - make_func_0_F (__valtype__, __valget__, B, __suff__)\ - make_func_0_F (__valtype__, __valget__, C, __suff__)\ - make_func_0_F (__valtype__, __valget__, D, __suff__)\ - make_func_0_F (__valtype__, __valget__, E, __suff__)\ - make_func_0_F (__valtype__, __valget__, F, __suff__)\ - -make_funcs_0_FF (signed char*, *val, int8_mem) -make_funcs_0_FF (signed char, val, int8_reg) - -make_funcs_0_FF (unsigned char*, *val, uint8_mem) -make_funcs_0_FF (unsigned char, val, uint8_reg) - -make_funcs_0_FF (short*, *val, int16_mem) -make_funcs_0_FF (short, val, int16_reg) - -make_funcs_0_FF (unsigned short*, *val, uint16_mem) -make_funcs_0_FF (unsigned short, val, uint16_reg) - -make_funcs_0_FF (int*, *val, int32_mem) -make_funcs_0_FF (int, val, int32_reg) - -make_funcs_0_FF (unsigned int*, *val, uint32_mem) -make_funcs_0_FF (unsigned int, val, uint32_reg) - -make_funcs_0_FF (long long*, *val, int64_lowword_mem) -make_funcs_0_FF (long long, val, int64_lowword_reg) - -make_funcs_0_FF (unsigned long long*, *val, uint64_lowword_mem) -make_funcs_0_FF (unsigned long long, val, uint64_lowword_reg) - -make_funcs_0_FF (long long*, *val >> 32, int64_highword_mem) -make_funcs_0_FF (long long, val >> 32, int64_highword_reg) - -make_funcs_0_FF (unsigned long long*, *val >> 32, uint64_highword_mem) -make_funcs_0_FF (unsigned long long, val >> 32, uint64_highword_reg) - -make_funcs_0_FF (long long*, *val >> 16, int64_midword_mem) -make_funcs_0_FF (long long, val >> 16, int64_midword_reg) - -make_funcs_0_FF (unsigned long long*, *val >> 16, uint64_midword_mem) -make_funcs_0_FF (unsigned long long, val >> 16, uint64_midword_reg) - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49468-di.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49468-di.c deleted file mode 100644 index 1b485c0ce..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49468-di.c +++ /dev/null @@ -1,23 +0,0 @@ -/* Check that 64 bit integer abs is generated as negc instruction pairs - and conditional branch instead of default branch-free code. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "negc" 4 } } */ - - -/* Normal integer absolute value. */ -long long -abs_0 (long long i) -{ - return (i < 0) ? -i : i; -} - -/* Negated integer absolute value. - The generated code should be the same, except that the branch - condition is inverted. */ -long long -abs_1 (long long i) -{ - return (i > 0) ? -i : i; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49468-si.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49468-si.c deleted file mode 100644 index 144eef4d6..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49468-si.c +++ /dev/null @@ -1,23 +0,0 @@ -/* Check that 32 bit integer abs is generated as neg instruction and - conditional branch instead of default branch-free code. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "neg" 2 } } */ - - -/* Normal integer absolute value. */ -int -abs_0 (int i) -{ - return (i < 0) ? -i : i; -} - -/* Negated integer absolute value. - The generated code should be the same, except that the branch - condition is inverted. */ -int -abs_1 (int i) -{ - return (i > 0) ? -i : i; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-1.c deleted file mode 100644 index e19f1bf38..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Check that the option -mdiv=call-div1 works. */ -/* { dg-do link { target "sh*-*-*" } } */ -/* { dg-options "-mdiv=call-div1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ - -int -test00 (int a, int b) -{ - return a / b; -} - -unsigned int -test01 (unsigned int a, unsigned b) -{ - return a / b; -} - -int -main (int argc, char** argv) -{ - return test00 (argc, 123) + test01 (argc, 123); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-2.c deleted file mode 100644 index eef832e30..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-2.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Check that the option -mdiv=call-fp works. */ -/* { dg-do link { target "sh*-*-*" } } */ -/* { dg-options "-mdiv=call-fp" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ - -int -test00 (int a, int b) -{ - return a / b; -} - -unsigned int -test01 (unsigned int a, unsigned b) -{ - return a / b; -} - -int -main (int argc, char** argv) -{ - return test00 (argc, 123) + test01 (argc, 123); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-3.c deleted file mode 100644 index 80a7df548..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-3.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Check that the option -mdiv=call-table works. */ -/* { dg-do link { target "sh*-*-*" } } */ -/* { dg-options "-mdiv=call-table" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ - -int -test00 (int a, int b) -{ - return a / b; -} - -unsigned int -test01 (unsigned int a, unsigned b) -{ - return a / b; -} - -int -main (int argc, char** argv) -{ - return test00 (argc, 123) + test01 (argc, 123); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-4.c deleted file mode 100644 index 998a8b69f..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-4.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Check that the option -mdiv=call-fp does not produce calls to the - library function that uses FPU to implement integer division if FPU insns - are not supported or are disabled. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-mdiv=call-fp" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*"} { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" } } */ -/* { dg-final { scan-assembler-not "sdivsi3_i4\n|udivsi3_i4\n" } } */ - -int -test00 (int a, int b) -{ - return a / b; -} - -unsigned int -test01 (unsigned int a, unsigned b) -{ - return a / b; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-5.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-5.c deleted file mode 100644 index 09e99a85f..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr49880-5.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Check that the option -mdiv=call-fp results in the corresponding library - function calls on targets that have a double precision FPU. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-mdiv=call-fp" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*"} { "-m2a" "-m4" "-m4a" "*single-only" } } */ -/* { dg-final { scan-assembler "sdivsi3_i4\n" } } */ -/* { dg-final { scan-assembler "udivsi3_i4\n" } } */ - -int -test00 (int a, int b) -{ - return a / b; -} - -unsigned int -test01 (unsigned int a, unsigned b) -{ - return a / b; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-1.c deleted file mode 100644 index 8852b8f87..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-1.c +++ /dev/null @@ -1,34 +0,0 @@ -/* PR target/50749: Verify that post-increment addressing is generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-times "mov.b\t@r\[0-9]\+\\+,r\[0-9]\+" 1 } } */ -/* { dg-final { scan-assembler-times "mov.w\t@r\[0-9]\+\\+,r\[0-9]\+" 1 } } */ -/* { dg-final { scan-assembler-times "mov.l\t@r\[0-9]\+\\+,r\[0-9]\+" 1 } } */ - -char* -test_func_00 (char* p, int* x) -{ - int r = 0; - r += *p++; - *x = r; - return p; -} - -short* -test_func_01 (short* p, int* x) -{ - int r = 0; - r += *p++; - *x = r; - return p; -} - -int* -test_func_02 (int* p, int* x) -{ - int r = 0; - r += *p++; - *x = r; - return p; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-2.c deleted file mode 100644 index b101e8d04..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-2.c +++ /dev/null @@ -1,70 +0,0 @@ -/* PR target/50749: Verify that subsequent post-increment addressings - are generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-times "mov.b\t@r\[0-9]\+\\+,r\[0-9]\+" 5 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.w\t@r\[0-9]\+\\+,r\[0-9]\+" 5 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.l\t@r\[0-9]\+\\+,r\[0-9]\+" 5 { xfail *-*-*} } } */ - -char* -test_func_00 (char* p, int* x) -{ - int r = 0; - r += *p++; - r += *p++; - *x = r; - return p; -} - -char* -test_func_01 (char* p, int* x) -{ - int r = 0; - r += *p++; - r += *p++; - r += *p++; - *x = r; - return p; -} - -short* -test_func_02 (short* p, int* x) -{ - int r = 0; - r += *p++; - r += *p++; - *x = r; - return p; -} - -short* -test_func_03 (short* p, int* x) -{ - int r = 0; - r += *p++; - r += *p++; - r += *p++; - *x = r; - return p; -} - -int* -test_func_04 (int* p, int* x) -{ - int r = 0; - r += *p++; - r += *p++; - *x = r; - return p; -} - -int* -test_func_05 (int* p, int* x) -{ - int r = 0; - r += *p++; - r += *p++; - r += *p++; - *x = r; - return p; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-3.c deleted file mode 100644 index 99f16b60c..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-3.c +++ /dev/null @@ -1,40 +0,0 @@ -/* PR target/50749: Verify that post-increment addressing is generated - inside a loop. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-times "mov.b\t@r\[0-9]\+\\+,r\[0-9]\+" 1 } } */ -/* { dg-final { scan-assembler-times "mov.w\t@r\[0-9]\+\\+,r\[0-9]\+" 1 } } */ -/* { dg-final { scan-assembler-times "mov.l\t@r\[0-9]\+\\+,r\[0-9]\+" 1 } } */ - -int -test_func_00 (char* p, int c) -{ - int r = 0; - do - { - r += *p++; - } while (--c); - return r; -} - -int -test_func_01 (short* p, int c) -{ - int r = 0; - do - { - r += *p++; - } while (--c); - return r; -} - -int -test_func_02 (int* p, int c) -{ - int r = 0; - do - { - r += *p++; - } while (--c); - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-4.c deleted file mode 100644 index 01050c602..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-postinc-4.c +++ /dev/null @@ -1,46 +0,0 @@ -/* PR target/50749: Verify that post-increment addressing is generated - inside a loop. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-times "mov.b\t@r\[0-9]\+\\+,r\[0-9]\+" 3 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.w\t@r\[0-9]\+\\+,r\[0-9]\+" 3 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.l\t@r\[0-9]\+\\+,r\[0-9]\+" 3 { xfail *-*-*} } } */ - -int -test_func_00 (char* p, int c) -{ - int r = 0; - do - { - r += *p++; - r += *p++; - r += *p++; - } while (--c); - return r; -} - -int -test_func_01 (short* p, int c) -{ - int r = 0; - do - { - r += *p++; - r += *p++; - r += *p++; - } while (--c); - return r; -} - -int -test_func_02 (int* p, int c) -{ - int r = 0; - do - { - r += *p++; - r += *p++; - r += *p++; - } while (--c); - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-1.c deleted file mode 100644 index 5f816e91c..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-1.c +++ /dev/null @@ -1,28 +0,0 @@ -/* PR target/50749: Verify that pre-decrement addressing is generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-times "mov.b\tr\[0-9]\+,@-r\[0-9]\+" 1 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.w\tr\[0-9]\+,@-r\[0-9]\+" 1 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.l\tr\[0-9]\+,@-r\[0-9]\+" 1 { xfail *-*-*} } } */ - -char* -test_func_00 (char* p, int c) -{ - *--p = (char)c; - return p; -} - -short* -test_func_01 (short* p, int c) -{ - *--p = (short)c; - return p; -} - -int* -test_func_02 (int* p, int c) -{ - *--p = c; - return p; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-2.c deleted file mode 100644 index 73e19f378..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-2.c +++ /dev/null @@ -1,58 +0,0 @@ -/* PR target/50749: Verify that subsequent pre-decrement addressings - are generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-times "mov.b\tr\[0-9]\+,@-r\[0-9]\+" 5 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.w\tr\[0-9]\+,@-r\[0-9]\+" 5 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.l\tr\[0-9]\+,@-r\[0-9]\+" 5 { xfail *-*-*} } } */ - -char* -test_func_00 (char* p, int c) -{ - *--p = (char)c; - *--p = (char)c; - return p; -} - -char* -test_func_01 (char* p, int c) -{ - *--p = (char)c; - *--p = (char)c; - *--p = (char)c; - return p; -} - -short* -test_func_02 (short* p, int c) -{ - *--p = (short)c; - *--p = (short)c; - return p; -} - -short* -test_func_03 (short* p, int c) -{ - *--p = (short)c; - *--p = (short)c; - *--p = (short)c; - return p; -} - -int* -test_func_04 (int* p, int c) -{ - *--p = c; - *--p = c; - return p; -} - -int* -test_func_05 (int* p, int c) -{ - *--p = c; - *--p = c; - *--p = c; - return p; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-3.c deleted file mode 100644 index f242bf378..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-3.c +++ /dev/null @@ -1,37 +0,0 @@ -/* PR target/50749: Verify that pre-decrement addressing is generated - inside a loop. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-times "mov.b\tr\[0-9]\+,@-r\[0-9]\+" 1 } } */ -/* { dg-final { scan-assembler-times "mov.w\tr\[0-9]\+,@-r\[0-9]\+" 1 } } */ -/* { dg-final { scan-assembler-times "mov.l\tr\[0-9]\+,@-r\[0-9]\+" 1 } } */ - -char* -test_func_00 (char* p, int c, int x) -{ - do - { - *--p = (char)x; - } while (--c); - return p; -} - -short* -test_func_01 (short* p, int c, int x) -{ - do - { - *--p = (short)x; - } while (--c); - return p; -} - -int* -test_func_02 (int* p, int c, int x) -{ - do - { - *--p = x; - } while (--c); - return p; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-4.c deleted file mode 100644 index 24601ca6b..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-qihisi-predec-4.c +++ /dev/null @@ -1,43 +0,0 @@ -/* PR target/50749: Verify that pre-decrement addressing is generated - inside a loop. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-times "mov.b\tr\[0-9]\+,@-r\[0-9]\+" 3 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.w\tr\[0-9]\+,@-r\[0-9]\+" 3 { xfail *-*-*} } } */ -/* { dg-final { scan-assembler-times "mov.l\tr\[0-9]\+,@-r\[0-9]\+" 3 { xfail *-*-*} } } */ - -char* -test_func_00 (char* p, int c, int x) -{ - do - { - *--p = (char)x; - *--p = (char)x; - *--p = (char)x; - } while (--c); - return p; -} - -short* -test_func_01 (short* p, int c, int x) -{ - do - { - *--p = (short)x; - *--p = (short)x; - *--p = (short)x; - } while (--c); - return p; -} - -int* -test_func_02 (int* p, int c, int x) -{ - do - { - *--p = x; - *--p = x; - *--p = x; - } while (--c); - return p; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-1.c deleted file mode 100644 index 98b71b2be..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* PR target/50749: Verify that post-increment addressing is generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fmov.s\t@r\[0-9]\+\\+,fr\[0-9]\+" 1 } } */ - -float* -test_func_00 (float* p, float* x) -{ - float r = 0; - r += *p++; - *x = r; - return p; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-2.c deleted file mode 100644 index b40becd33..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-2.c +++ /dev/null @@ -1,27 +0,0 @@ -/* PR target/50749: Verify that subsequent post-increment addressings - are generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2*" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fmov.s\t@r\[0-9]\+\\+,fr\[0-9]\+" 5 { xfail *-*-*} } } */ - -float* -test_func_00 (float* p, float* x) -{ - float r = 0; - r += *p++; - r += *p++; - *x = r; - return p; -} - -float* -test_func_01 (float* p, float* x) -{ - float r = 0; - r += *p++; - r += *p++; - r += *p++; - *x = r; - return p; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-3.c deleted file mode 100644 index 27d13e8d3..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-3.c +++ /dev/null @@ -1,17 +0,0 @@ -/* PR target/50749: Verify that post-increment addressing is generated - inside a loop. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fmov.s\t@r\[0-9]\+\\+,fr\[0-9]\+" 1 } } */ - -float -test_func_00 (float* p, int c) -{ - float r = 0; - do - { - r += *p++; - } while (--c); - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-4.c deleted file mode 100644 index 66d29f0a4..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-postinc-4.c +++ /dev/null @@ -1,19 +0,0 @@ -/* PR target/50749: Verify that post-increment addressing is generated - inside a loop. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2*" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fmov.s\t@r\[0-9]\+\\+,fr\[0-9]\+" 3 { xfail *-*-*} } } */ - -float -test_func_00 (float* p, int c) -{ - float r = 0; - do - { - r += *p++; - r += *p++; - r += *p++; - } while (--c); - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-1.c deleted file mode 100644 index d7d129a7c..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-1.c +++ /dev/null @@ -1,13 +0,0 @@ -/* PR target/50749: Verify that pre-decrement addressing is generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fmov.s\tfr\[0-9]\+,@-r\[0-9]\+" 1 } } */ - -float* -test_func_00 (float* p, float c) -{ - *--p = c; - return p; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-2.c deleted file mode 100644 index 96d9a6c18..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-2.c +++ /dev/null @@ -1,23 +0,0 @@ -/* PR target/50749: Verify that subsequent pre-decrement addressings - are generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2*" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fmov.s\tfr\[0-9]\+,@-r\[0-9]\+" 5 { xfail *-*-*} } } */ - -float* -test_func_00 (float* p, float c) -{ - *--p = c; - *--p = c; - return p; -} - -float* -test_func_01 (float* p, float c) -{ - *--p = c; - *--p = c; - *--p = c; - return p; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-3.c deleted file mode 100644 index b3023b7a8..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-3.c +++ /dev/null @@ -1,16 +0,0 @@ -/* PR target/50749: Verify that pre-decrement addressing is generated - inside a loop. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fmov.s\tfr\[0-9]\+,@-r\[0-9]\+" 1 } } */ - -float* -test_func_00 (float* p, int c, float x) -{ - do - { - *--p = x; - } while (--c); - return p; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-4.c deleted file mode 100644 index 6d7b90534..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50749-sf-predec-4.c +++ /dev/null @@ -1,18 +0,0 @@ -/* PR target/50749: Verify that pre-decrement addressing is generated - inside a loop. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2*" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fmov.s\tfr\[0-9]\+,@-r\[0-9]\+" 3 { xfail *-*-*} } } */ - -float* -test_func_00 (float* p, int c, float x) -{ - do - { - *--p = x; - *--p = x; - *--p = x; - } while (--c); - return p; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-1.c deleted file mode 100644 index 3793bd0d4..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-1.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Check that the mov.b displacement addressing insn is generated. - If the insn is generated as expected, there should be no address - calculations outside the mov insns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-not "add|sub" } } */ - -void -testfunc_00 (const char* ap, char* bp, char val) -{ - bp[0] = ap[15]; - bp[2] = ap[5]; - bp[9] = ap[7]; - bp[0] = ap[15]; - bp[4] = val; - bp[14] = val; -} - -void -testfunc_01 (volatile const char* ap, volatile char* bp, char val) -{ - bp[0] = ap[15]; - bp[2] = ap[5]; - bp[9] = ap[7]; - bp[0] = ap[15]; - bp[4] = val; - bp[14] = val; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-2.c deleted file mode 100644 index ae4b0af5d..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-2.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Check that the mov.b displacement addressing insn is generated and the - base address is adjusted only once. On SH2A this test is skipped because - there is a 4 byte mov.b insn that can handle larger displacements. Thus - on SH2A the base address will not be adjusted in this case. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" "-m2a*" } { "" } } */ -/* { dg-final { scan-assembler-times "add" 2 } } */ - -void -testfunc_00 (const char* ap, char* bp) -{ - bp[0] = ap[15]; - bp[2] = ap[5]; - bp[9] = ap[7]; - bp[0] = ap[25]; -} - -void -testfunc_01 (volatile const char* ap, volatile char* bp) -{ - bp[0] = ap[15]; - bp[2] = ap[5]; - bp[9] = ap[7]; - bp[0] = ap[25]; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-3.c deleted file mode 100644 index 58c85f833..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-3.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Check that on SH2A the 4 byte mov.b displacement insn is generated to - handle larger displacements. If it is generated correctly, there should - be no base address adjustments outside the mov.b insns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */ -/* { dg-final { scan-assembler-not "add|sub" } } */ - -void -testfunc_00 (const char* ap, char* bp) -{ - bp[100] = ap[15]; - bp[200] = ap[50]; - bp[900] = ap[71]; - bp[0] = ap[25]; -} - -void -testfunc_01 (volatile const char* ap, volatile char* bp) -{ - bp[100] = ap[15]; - bp[200] = ap[50]; - bp[900] = ap[71]; - bp[0] = ap[25]; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-4.c deleted file mode 100644 index f3f035770..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-4.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Check that the mov.w displacement addressing insn is generated. - If the insn is generated as expected, there should be no address - calculations outside the mov insns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-not "add|sub" } } */ - -void -testfunc_00 (const short* ap, short* bp, short val) -{ - bp[0] = ap[15]; - bp[2] = ap[5]; - bp[9] = ap[7]; - bp[0] = ap[15]; - bp[4] = val; - bp[14] = val; -} - -void -testfunc_01 (volatile const short* ap, volatile short* bp, short val) -{ - bp[0] = ap[15]; - bp[2] = ap[5]; - bp[9] = ap[7]; - bp[0] = ap[15]; - bp[4] = val; - bp[14] = val; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-5.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-5.c deleted file mode 100644 index 48d5403b2..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-5.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Check that the mov.w displacement addressing insn is generated and the - base address is adjusted only once. On SH2A this test is skipped because - there is a 4 byte mov.w insn that can handle larger displacements. Thus - on SH2A the base address will not be adjusted in this case. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" "-m2a*" } { "" } } */ -/* { dg-final { scan-assembler-times "add" 2 } } */ - -void -testfunc_00 (const short* ap, short* bp) -{ - bp[0] = ap[15]; - bp[2] = ap[5]; - bp[9] = ap[7]; - bp[0] = ap[25]; -} - -void -testfunc_01 (volatile const short* ap, volatile short* bp) -{ - bp[0] = ap[15]; - bp[2] = ap[5]; - bp[9] = ap[7]; - bp[0] = ap[25]; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-6.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-6.c deleted file mode 100644 index 83fb5abea..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-6.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Check that on SH2A the 4 byte mov.w displacement insn is generated to - handle larger displacements. If it is generated correctly, there should - be no base address adjustments outside the mov.w insns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */ -/* { dg-final { scan-assembler-not "add|sub" } } */ - -void -testfunc_00 (const short* ap, short* bp) -{ - bp[100] = ap[15]; - bp[200] = ap[50]; - bp[900] = ap[71]; - bp[0] = ap[25]; -} - -void -testfunc_01 (volatile const short* ap, volatile short* bp) -{ - bp[100] = ap[15]; - bp[200] = ap[50]; - bp[900] = ap[71]; - bp[0] = ap[25]; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-7.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-7.c deleted file mode 100644 index 859cba42f..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-7.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Check that mov.b and mov.w displacement insns are generated. - If this is working properly, there should be no base address adjustments - outside the mov insns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-not "add|sub" } } */ - -typedef struct -{ - char a; - char b; - char c; - char d; - - short e; - short f; - - int g; - int h; -} X; - -void -testfunc_00 (X* x) -{ - x->g = x->b | x->c; - x->h = x->e | x->f; - x->d = x->g; - x->f = x->h; -} - -int testfunc_01 (X* x) -{ - return x->b | x->e | x->g; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-8.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-8.c deleted file mode 100644 index bced631a1..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr50751-8.c +++ /dev/null @@ -1,100 +0,0 @@ -/* Check that on SH2A the 4 byte movu.b and movu.w displacement insns are - generated. This has to be checked with -O2 because some of the patterns - rely on peepholes. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */ -/* { dg-final { scan-assembler-times "movu.b" 4 } } */ -/* { dg-final { scan-assembler-times "movu.w" 3 } } */ - -int -test_00 (unsigned char* x) -{ - /* 1x movu.b */ - return x[0]; -} - -int -test_01 (unsigned short* x) -{ - /* 1x movu.w */ - return x[0]; -} - -int -test_02 (unsigned char* x) -{ - /* 1x movu.b */ - return x[1]; -} - -int -test_03 (unsigned char* x) -{ - /* 1x movu.b */ - return x[32]; -} - -int -test_04 (unsigned char* x) -{ - /* 1x movu.b */ - return x[9000]; -} - -int -test_05 (unsigned short* x) -{ - /* 1x movu.w */ - return x[9000]; -} - -int -test_06 (unsigned char* x, int i) -{ - /* No movu.b expected here. Should use mov.b (r0,r4) + extu.b instead. */ - return x[i]; -} - -int -test_07 (unsigned short* x, int i) -{ - /* No movu.w expected here. Should use mov.w (r0,r4) + extu.w instead. */ - return x[i]; -} - -int -test_08 (unsigned char* x, int c) -{ - /* No movu.b expected here. Should use post-inc addressing instead. */ - int s = 0; - int i; - for (i = 0; i < c; ++i) - s += x[i]; - return s; -} - -void -test_09 (unsigned char* x, unsigned char* y) -{ - /* No movu.b expected here, since the zero-extension is irrelevant. */ - x[1] = y[1]; - x[2] = y[2]; -} - -void -test_10 (unsigned char* x, unsigned short* y) -{ - /* No movu.w expected here, since the zero-extension is irrelevant. */ - x[1] = y[1]; - x[2] = y[2]; -} - -int -test_11 (unsigned char* x, unsigned short* y) -{ - /* 1x movu.w */ - int yy = y[1]; - x[1] = yy; - return yy; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-1.c deleted file mode 100644 index 601c1c1c2..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Check that inverted conditional branch logic does not generate - unnecessary explicit T bit extractions, inversions and - test instructions. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -mbranch-cost=2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-not "movt|tst|negc|extu" } } */ - -int -testfunc_00 (int a, int b, int c, int d) -{ - return (a != b || a != d) ? b : c; -} - -int -testfunc_01 (int a, int b, int c, int d) -{ - return (a == b || a == d) ? b : c; -} - -int -testfunc_02 (int a, int b, int c, int d) -{ - return (a == b && a == d) ? b : c; -} - -int -testfunc_03 (int a, int b, int c, int d) -{ - return (a != b && a != d) ? b : c; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-10.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-10.c deleted file mode 100644 index 20f052eed..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-10.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Check that compare-branch is inverted properly. - In this case the improved bit test is a side effect of compare-branch - inversion patterns, even though the branch condition does not get - inverted here. - Example: - mov.b @(14,r9),r0 -> mov.b @(14,r9),r0 - shll r0 cmp/pz r0 - subc r0,r0 bt .L192 - and #1,r0 - tst r0,r0 - bt .L195 -*/ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "shll|subc|and" } } */ -int -test_00 (int* p) -{ - int nr = 15; - volatile char* addr = (volatile char*)&p[1]; - - if ((addr[(nr >> 3) ^ 7] & (1 << (nr & 7))) == 0) - return 40; - else - return 50; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-11.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-11.c deleted file mode 100644 index 4a9c93c93..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-11.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Check that zero-displacement branches are used instead of branch-free - execution patterns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -mzdcbranch" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "subc|and" } } */ - -int* -test_00 (int* s) -{ - if (s[0] == 0) - if (!s[3]) - s = 0; - return s; -} - -int* -test_01 (int* s) -{ - if (s[0] == 0) - if (s[3]) - s = 0; - return s; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-12.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-12.c deleted file mode 100644 index ca8e2d4b3..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-12.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Check that the negc instruction is generated as expected for the cases - below. If we see a movrt or #-1 negc sequence it means that the pattern - which handles the inverted case does not work properly. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "negc" 10 } } */ -/* { dg-final { scan-assembler-not "movrt|#-1|add|sub" } } */ - -int -test00 (int a, int b, int* x) -{ - return (a == b) ? 0x7FFFFFFF : 0x80000000; -} - -int -test00_inv (int a, int b) -{ - return (a != b) ? 0x80000000 : 0x7FFFFFFF; -} - -int -test01 (int a, int b) -{ - return (a >= b) ? 0x7FFFFFFF : 0x80000000; -} - -int -test01_inv (int a, int b) -{ - return (a < b) ? 0x80000000 : 0x7FFFFFFF; -} - -int -test02 (int a, int b) -{ - return (a > b) ? 0x7FFFFFFF : 0x80000000; -} - -int -test02_inv (int a, int b) -{ - return (a <= b) ? 0x80000000 : 0x7FFFFFFF; -} - -int -test03 (int a, int b) -{ - return ((a & b) == 0) ? 0x7FFFFFFF : 0x80000000; -} - -int -test03_inv (int a, int b) -{ - return ((a & b) != 0) ? 0x80000000 : 0x7FFFFFFF; -} - -int -test04 (int a) -{ - return ((a & 0x55) == 0) ? 0x7FFFFFFF : 0x80000000; -} - -int -test04_inv (int a) -{ - return ((a & 0x55) != 0) ? 0x80000000 : 0x7FFFFFFF; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-13.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-13.c deleted file mode 100644 index 7e823dc03..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-13.c +++ /dev/null @@ -1,85 +0,0 @@ -/* This is a case extracted from CSiBE which contained the following - sequence: - shll r0 - movt r0 - tst r0,r0 - bf .L11 - where the 'tst r0,r0' before the branch can be omitted by inverting the - branch condition. The tested function contains two other tst insns. If - everything goes as expected we will be seeing only those other two tst - insns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "tst" 2 } } */ - -static __inline__ int -__test_bit (unsigned long nr, volatile void * addr) -{ - /* This is on purpose. */ - int oldbit; - return oldbit & 1; -} - -static __inline__ int -__constant_test_bit (unsigned long nr, volatile void * addr) -{ - return (((volatile char *) addr)[(nr>>3)^7] & (1<<(nr&7))) != 0; -} - -struct list_head -{ - struct list_head *next, *prev; -}; - -static inline void -__list_del (struct list_head *prev, struct list_head *next) -{ - next->prev = prev; - prev->next = next; -} - -static inline void -list_del (struct list_head *entry) -{ - __list_del(entry->prev, entry->next); - entry->next = 0; - entry->prev = 0; -} - -extern int nr_active_pages; -extern int nr_inactive_pages; -extern struct list_head active_list; - -typedef struct page -{ - unsigned long flags; - struct list_head lru; -} mem_map_t; - -void -activate_page_nolock (struct page * page) -{ - if ((__builtin_constant_p((6)) - ? __constant_test_bit((6),(&(page)->flags)) - : __test_bit((6),(&(page)->flags)) ) - && !(__builtin_constant_p((7)) - ? __constant_test_bit((7),(&(page)->flags)) - : __test_bit((7),(&(page)->flags)) )) - { - list_del(&(page)->lru); - nr_inactive_pages--; - if (!(__builtin_constant_p(6) ? __constant_test_bit((6),(&(page)->flags)) - : __test_bit((6),(&(page)->flags)))) - printk("", "", 43); - - if ((__builtin_constant_p(7) ? __constant_test_bit((7),(&(page)->flags)) - : __test_bit((7),(&(page)->flags)))) - printk("", "", 43); - - (__builtin_constant_p(7) ? __constant_set_bit((7),(&(page)->flags)) - : __set_bit((7),(&(page)->flags)) ); - list_add(&(page)->lru, &active_list); - nr_active_pages++; - } -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-14.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-14.c deleted file mode 100644 index 0ff7008fb..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-14.c +++ /dev/null @@ -1,107 +0,0 @@ -/* This is a case extracted from CSiBE which would sometimes contain the - following sequence: - cmp/eq r12,r13 - movt r0 - xor #1,r0 - extu.b r0,r0 - movt r3 - tst r0,r0 - bf/s .L35 - where the negated T bit store did not combine properly. Since there are - other movt insns we only check for the xor and the extu. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "xor|extu" } } */ - -typedef struct transaction_s transaction_t; - -struct journal_head -{ - transaction_t * b_transaction; - struct journal_head *b_cpnext, *b_cpprev; -}; - -struct transaction_s -{ - struct journal_head * t_checkpoint_list; - transaction_t *t_cpnext, *t_cpprev; -}; - -struct journal_s -{ - transaction_t * j_checkpoint_transactions; - unsigned long j_first, j_last; -}; - -typedef struct journal_s journal_t; - -extern int __try_to_free_cp_buf (struct journal_head *jh); -extern int __cleanup_transaction (journal_t *journal, transaction_t *transaction); -extern void __flush_batch (void **bhs, int *batch_count); -extern void* jh2bh (void*); - -static int -__flush_buffer (journal_t *journal, struct journal_head *jh, - void **bhs, int *batch_count, int *drop_count) -{ - void *bh = jh2bh (jh); - int ret = 0; - if (bh) - { - bhs[*batch_count] = bh; - (*batch_count)++; - if (*batch_count == 64) - ret = 1; - } - else - { - int last_buffer = 0; - if (jh->b_cpnext == jh) - last_buffer = 1; - if (__try_to_free_cp_buf (jh)) - { - (*drop_count)++; - ret = last_buffer; - } - } - return ret; -} - -int -log_do_checkpoint (journal_t *journal, int nblocks) -{ - transaction_t *transaction, *last_transaction, *next_transaction; - int batch_count = 0; - void *bhs[64]; - -repeat: - transaction = journal->j_checkpoint_transactions; - if (transaction == ((void *)0)) - return 0; - last_transaction = transaction->t_cpprev; - next_transaction = transaction; - do - { - struct journal_head *jh, *last_jh, *next_jh; - int drop_count = 0; - int cleanup_ret, retry = 0; - transaction = next_transaction; - next_transaction = transaction->t_cpnext; - jh = transaction->t_checkpoint_list; - last_jh = jh->b_cpprev; - next_jh = jh; - do - { - jh = next_jh; - next_jh = jh->b_cpnext; - retry = __flush_buffer(journal, jh, bhs, &batch_count, &drop_count); - } while (jh != last_jh && !retry); - - if (retry) - goto repeat; - - cleanup_ret = __cleanup_transaction(journal, transaction); - goto repeat; - } while (transaction != last_transaction); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-15.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-15.c deleted file mode 100644 index ec98d5e61..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-15.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Check that the redundant test removal code in the *cbranch_t split works - as expected on non-SH2A targets. Because on SH2A the movrt instruction - is used, this test is re-used and checked differently in pr51244-16.c. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" "-m2a*" } { "" } } */ -/* { dg-final { scan-assembler-times "tst" 6 } } */ -/* { dg-final { scan-assembler-times "movt" 6 } } */ -/* { dg-final { scan-assembler-times "xor" 3 } } */ -/* { dg-final { scan-assembler-not "extu|exts|negc" } } */ - -typedef char bool; - -int -test_0 (int a, int b, int c, int* d) -{ - /* non SH2A: 1x tst, 1x movt, 1x xor - SH2A: 1x tst, 1x movrt */ - bool x = a == 0; - d[2] = !x; - return x ? b : c; -} - -int -test_1 (int a, int b, int c, int* d) -{ - /* 1x tst, 1x movt */ - bool x = a != 0; - d[2] = !x; - return x ? b : c; -} - -int -test_2 (int a, int b, int c, char* d) -{ - /* Check that there is no sign/zero-extension before the store. - non SH2A: 1x tst, 1x movt, 1x xor - SH2A: 1x tst, 1x movrt */ - bool x = a == 0; - d[2] = !x; - return x ? b : c; -} - -int -test_3 (int a, int b, int c, char* d) -{ - /* Check that there is no sign/zero-extension before the store. - 1x tst, 1x movt */ - bool x = a != 0; - d[2] = !x; - return x ? b : c; -} - -int -test_4 (int a, int b, int c, char* d) -{ - /* 1x tst, 1x movt */ - bool x = a != 0; - d[2] = !x; - return !x ? b : c; -} - -int -test_5 (int a, int b, int c, char* d) -{ - /* non SH2A: 1x tst, 1x movt, 1x xor - SH2A: 1x tst, 1x movrt */ - bool x = a == 0; - d[2] = !x; - return !x ? b : c; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-16.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-16.c deleted file mode 100644 index 8717df7f3..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-16.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Check that the redundant test removal code in the *cbranch_t split works - as expected on SH2A targets. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */ -/* { dg-final { scan-assembler-times "tst" 6 } } */ -/* { dg-final { scan-assembler-times "movt" 3 } } */ -/* { dg-final { scan-assembler-times "movrt" 3 } } */ -/* { dg-final { scan-assembler-not "extu|exts|negc" } } */ - -#include "pr51244-15.c" diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-17.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-17.c deleted file mode 100644 index e7d1ddd2a..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-17.c +++ /dev/null @@ -1,297 +0,0 @@ -/* Check that no unnecessary zero extensions are done on values that are - results of arithmetic with T bit inputs. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "extu|exts" } } */ - -int -test00 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == 0; - return x == y; -} - -int -test01 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == d; - return x == y; -} - -int -test02 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c == d; - return x == y; -} - -int -test03 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c != d; - return x == y; -} - -int -test04 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c != d; - return x == y; -} - -int -test05 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == 0; - return x != y; -} - -int -test06 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == 0; - return x ^ y; -} - -int -test07 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == 0; - return x | y; -} - -int -test08 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == 0; - return x & y; -} - -int -test09 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == d; - return x != y; -} - -int -test10 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c == d; - return x != y; -} - -int -test11 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c != d; - return x != y; -} - -int -test12 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c != d; - return x != y; -} - -int -test13 (int a, int b, int c, int d, int e, int f) -{ - int x = a == b; - int y = c == 0; - int z = d == e; - return x == y || x == z; -} - -int -test14 (int a, int b, int c, int d, int e, int f) -{ - int x = a == b; - int y = c == 0; - int z = d == e; - return x == y && x == z; -} - -int -test15 (int a, int b, int c, int d, int e, int f) -{ - int x = a != b; - int y = c == 0; - int z = d == e; - return x == y || x == z; -} - -int -test16 (int a, int b, int c, int d, int e, int f) -{ - int x = a != b; - int y = c == 0; - int z = d == e; - return x == y && x == z; -} - -int -test17 (int a, int b, int c, int d, int e, int f) -{ - int x = a != b; - int y = c != 0; - int z = d == e; - return x == y || x == z; -} - -int -test18 (int a, int b, int c, int d, int e, int f) -{ - int x = a != b; - int y = c != 0; - int z = d == e; - return x == y && x == z; -} - -int -test19 (int a, int b, int c, int d, int e, int f) -{ - int x = a != b; - int y = c != 0; - int z = d == e; - return x == y || x == z; -} - -int -test20 (int a, int b, int c, int d, int e, int f) -{ - int x = a != b; - int y = c != 0; - int z = d != e; - return x == y && x == z; -} - -int -test21 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == 0; - return x + y; -} - -int -test22 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c == 0; - return x + y; -} - -int -test23 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c != 0; - return x + y; -} - -int -test24 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == 0; - return x - y; -} - -int -test25 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c == 0; - return x - y; -} - -int -test26 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c != 0; - return x - y; -} - -int -test27 (int a, int b, int c, int d) -{ - int x = a == b; - int y = c == 0; - return x * y; -} - -int -test28 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c == 0; - return x * y; -} - -int -test29 (int a, int b, int c, int d) -{ - int x = a != b; - int y = c != 0; - return x * y; -} - -int -test30 (int a, int b) -{ - return ((a & 0x7F) == 1) - | ((a & 0xFF00) == 0x0200) - | ((a & 0xFF0000) == 0x030000); -} - -int -test31 (int a, int b) -{ - return ((a & 0x7F) == 1) - | ((a & 0xFF00) == 0x0200) - | ((a & 0xFF0000) == 0x030000) - | ((a & 0xFF000000) == 0x04000000); -} - -int -test32 (int* a, int b, int c, volatile char* d) -{ - d[1] = a[0] != 0; - return b; -} - -int -test33 (int* a, int b, int c, volatile char* d) -{ - d[1] = a[0] == 0; - return b; -} - -char -test34 (int a, int* b) -{ - return (b[4] & b[0] & a) == a; -} - -unsigned char -test35 (int a, int* b) -{ - return (b[4] & b[0] & a) == a; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-18.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-18.c deleted file mode 100644 index dbfb9901c..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-18.c +++ /dev/null @@ -1,102 +0,0 @@ -/* Check that no unnecessary T bit stores are done before conditional - branches. - This case was extracted from the CSiBE set and contained the following - sequence: - cmp/hi r1,r0 - movt r1 - tst r1,r1 - bt .L12 - mov.l @r10,r1 - In this reduced code the movt and tst insns were only present in the - unwanted sequence. Thus, if we see any tst or movt insns, something is - not working as expected. This test requires -O2 because the T bit stores - in question will be eliminated in additional insn split passes after - reload. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "movt|tst" } } */ - -typedef char Char; -typedef unsigned char Bool; -typedef unsigned char UChar; -typedef int Int32; -typedef unsigned int UInt32; -typedef short Int16; -typedef unsigned short UInt16; - -static inline Bool -mainGtU (UInt32 i1, UInt32 i2, UChar* block, UInt16* quadrant, UInt32 nblock, - Int32* budget) -{ - Int32 k; - UChar c1, c2; - UInt16 s1, s2; - k = nblock + 8; - do - { - c1 = block[i1]; - c2 = block[i2]; - if (c1 != c2) - return (c1 > c2); - s1 = quadrant[i1]; - s2 = quadrant[i2]; - if (s1 != s2) - return (s1 > s2); - - i1++; i2++; - k -= 8; - } while (k >= 0); - - return 0; -} - -static inline void -mainSimpleSort (UInt32* ptr, UChar* block, UInt16* quadrant, Int32 nblock, - Int32 lo, Int32 hi, Int32 d, Int32* budget) -{ - Int32 i, j, h, bigN, hp; - UInt32 v; - bigN = hi - lo + 1; - hp = 0; - h = 1; - j = lo + h; - v = ptr[j]; - - while (mainGtU (ptr[j-h]+d, v+d, block, quadrant, nblock, budget)) - { - ptr[j] = ptr[j-h]; - j = j - h; - } -} - -static inline void -mainQSort3 (UInt32* ptr, UChar* block, UInt16* quadrant, Int32 nblock, - Int32 loSt, Int32 hiSt, Int32 dSt, Int32* budget) -{ - Int32 unLo, unHi, ltLo, gtHi; - Int32 sp, lo, hi, d; - - Int32 stackLo[100]; - Int32 stackHi[100]; - Int32 stackD [100]; - - sp = 0; - stackLo[sp] = loSt; - stackHi[sp] = hiSt; - stackD [sp] = dSt; - lo = stackLo[sp]; - hi = stackHi[sp]; - d = stackD [sp]; - mainSimpleSort (ptr, block, quadrant, nblock, lo, hi, d, budget); -} - -void -mainSort (UInt32* ptr, UChar* block, UInt16* quadrant, UInt32* ftab, - Int32 nblock, Int32 verb, Int32* budget) -{ - Int32 sb = 0; - Int32 lo = ftab[sb] & (~((1 << 21))); - Int32 hi = (ftab[sb+1] & (~((1 << 21)))) - 1; - mainQSort3 (ptr, block, quadrant, nblock, lo, hi, 2, budget); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-19.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-19.c deleted file mode 100644 index 4d4f781ed..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-19.c +++ /dev/null @@ -1,75 +0,0 @@ -/* Check that no unnecessary T bit stores are done before conditional - branches. - This case was extracted from the CSiBE set and contained the following - sequence: - mov.l @(8,r4),r2 - mov.l @(4,r4),r3 - cmp/gt r2,r3 - movt r2 -.L3: - tst r2,r2 - bt/s .L12 - mov #-1,r0 - - ..... - - mov.l @r4,r2 - tst r2,r2 - bra .L3 - movt r2 - - In this reduced code the movt insns were only present in the - unwanted sequences. Thus, if we see any movt insns, something is not - working as expected. This test requires -O2 because the T bit stores - in question will be eliminated in additional insn split passes after - reload. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "movt" } } */ - -struct request -{ - unsigned long nr_sectors; -}; - -struct request_list -{ - int count; -}; - -struct request_queue -{ - struct request_list rq; - volatile int nr_sectors; - int max_queue_sectors; - int can_throttle; - unsigned long bounce_pfn; -}; - -typedef struct request_queue request_queue_t; - -static inline int -blk_oversized_queue (request_queue_t* q) -{ - if (q->can_throttle) - return q->nr_sectors > q->max_queue_sectors; - return q->rq.count == 0; -} - -struct request* -get_request (request_queue_t* q, int rw) -{ - struct request* rq = ((void*)0); - struct request_list *rl = &q->rq; - - if (blk_oversized_queue (q)) - { - if ((rw == 1) || (rw == 0)) - return ((void*)0); - if (blk_oversized_queue (q)) - return ((void*)0); - } - - return (void*)-100; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-2.c deleted file mode 100644 index d98467610..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-2.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Check that when taking the complement of the T bit using the negc - instruction pattern, the constant -1 is loaded only once. - On SH2A this test is skipped because the movrt instruction is used - to get the complement of the T bit. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -mbranch-cost=2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" "-m2a*" } { "" } } */ -/* { dg-final { scan-assembler-times "mov\t#-1" 1 } } */ - -void -testfunc_00 (int* a, int* b, int c, int d) -{ - b[0] = a[0] != c; - b[1] = a[1] != d; - b[2] = a[2] != c; - b[3] = a[3] != d; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-3.c deleted file mode 100644 index ebb3c3ae4..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-3.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Check that when taking the complement of the T bit on SH2A, - the movrt instruction is being generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -mbranch-cost=2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */ -/* { dg-final { scan-assembler-times "movrt" 4 } } */ - -void -testfunc_00 (int* a, int* b, int c, int d) -{ - b[0] = a[0] != c; - b[1] = a[1] != d; - b[2] = a[2] != c; - b[3] = a[3] != d; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-4.c deleted file mode 100644 index f3073780a..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-4.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Check that storing the (negated) T bit as all ones or zeros in a reg - uses the subc instruction. On SH2A a sequence with the movrt instruction - is also OK instead of subc. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -mbranch-cost=2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-not "movt|tst|negc" } } */ -/* { dg-final { scan-assembler "subc|movrt|neg|not" } } */ - -int test_00 (int x, int y) -{ - return x != y ? -1 : 0; -} - -int test_01 (int x, int y) -{ - return x == y ? -1 : 0; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-5.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-5.c deleted file mode 100644 index a99889df3..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-5.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Check that no unnecessary sign or zero extension insn is generated after - a negc or movrt insn that stores the inverted T bit in a reg. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "extu|exts" } } */ - -int -test_00 (int a, int b, int* c, short* d, int x) -{ - *d = x != 0; - *c = -1; - - if (x != 0) - return a > 0; - - return 0; -} - -unsigned char -test_01 (int x) -{ - if (x < 58 && x > 47) - return 1; - return 0; -} - -char -test_02 (int x) -{ - if (x < 58 && x > 47) - return 1; - return 0; -} - -unsigned short -test_03 (int x) -{ - if (x < 58 && x > 47) - return 1; - return 0; -} - -short -test_04 (int x) -{ - if (x < 58 && x > 47) - return 1; - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-6.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-6.c deleted file mode 100644 index cfd466197..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-6.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Check that no unnecessary sign or zero extension insn is generated after - a negc or movrt insn that stores the inverted T bit in a reg. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "extu|exts" } } */ - -float -test_00 (float q[4], float m[9]) -{ - float s0 = m[0] + m[1]; - float s1 = m[0] - m[1]; - - return q[s0 > s1 ? 0 : 1]; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-7.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-7.c deleted file mode 100644 index e7e3ac138..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-7.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Check that compare-branch is inverted properly. - Example: - clrt -> clrt - subc r0,r6 subc r0,r6 - mov r3,r7 mov r3,r7 - subc r1,r7 subc r1,r7 - mov #0,r1 tst r7,r7 - cmp/hi r1,r7 bf .L111 - bt .L111 bra .L197 - bra .L197 - nop -*/ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "cmp/hi" } } */ -/* { dg-final { scan-assembler-not "mov\t#0" } } */ - -int other_func (long long); -int -test_00 (unsigned long long a, unsigned long long b) -{ - if ((a - b) > 0xFFFFFFFFLL) - return other_func (a - b); - return 20; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-8.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-8.c deleted file mode 100644 index 9d95ae3f8..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-8.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Check that compare-branch is inverted properly. - Example: - mov #1,r0 -> tst r8,r8 - neg r8,r1 bt .L47 - shad r1,r0 - tst #1,r0 - bf .L47 -*/ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "shad|neg" } } */ - -int test_01_00 (int*, void*); -int -test_01 (int* m, void* v) -{ - unsigned long n = (unsigned long)v - 1; - - if (!n) - return 50; - - if (1 & (1 << n)) /* if n == 0: 1 & (1 << 0) -> true */ - return 60; - else /* if n != 0: 1 & (1 << n) -> false */ - return -8; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-9.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-9.c deleted file mode 100644 index 13639bdc8..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr51244-9.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Check that compare-branch is inverted properly. - Example: - mov.w .L566,r2 -> mov.w .L566,r2 - add r11,r2 add r11,r2 - mov.l @(12,r2),r7 mov.l @(8,r2),r5 - mov.l @(8,r2),r5 mov.l @(12,r2),r2 - mov #0,r2 tst r2,r2 - cmp/hi r2,r7 bt .L534 - bf .L534 -*/ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "mov\t#0" } } */ -static inline unsigned int -test_03_00 (unsigned int x) -{ - /* Return unassigned value on purpose. */ - unsigned int res; - return res; -} - -struct S -{ - unsigned int a; - unsigned int b; -}; - -int test_03 (struct S* i) -{ - if ((i->a != 2 && i->a != 3) || i->a > test_03_00 (i->b)) - return -5; - - return -55; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr52933-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr52933-1.c deleted file mode 100644 index 037f916f3..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr52933-1.c +++ /dev/null @@ -1,168 +0,0 @@ -/* Check that the div0s instruction is used for integer sign comparisons. - Each test case is expected to emit at least one div0s insn. - Problems when combining the div0s comparison result with surrounding - logic usually show up as redundant tst insns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "div0s" 25 } } */ -/* { dg-final { scan-assembler-not "tst" } } */ - -typedef unsigned char bool; - -int other_func_a (int, int); -int other_func_b (int, int); - -bool -test_00 (int a, int b) -{ - return (a ^ b) >= 0; -} - -bool -test_01 (int a, int b) -{ - return (a ^ b) < 0; -} - -int -test_02 (int a, int b, int c, int d) -{ - if ((a ^ b) < 0) - return other_func_a (a, c); - else - return other_func_b (d, b); -} - -int -test_03 (int a, int b, int c, int d) -{ - if ((a ^ b) >= 0) - return other_func_a (a, c); - else - return other_func_b (d, b); -} - -int -test_04 (int a, int b) -{ - return (a ^ b) >= 0 ? -20 : -40; -} - -bool -test_05 (int a, int b) -{ - return (a ^ b) < 0; -} - -int -test_06 (int a, int b) -{ - return (a ^ b) < 0 ? -20 : -40; -} - -bool -test_07 (int a, int b) -{ - return (a < 0) == (b < 0); -} - -int -test_08 (int a, int b) -{ - return (a < 0) == (b < 0) ? -20 : -40; -} - -bool -test_09 (int a, int b) -{ - return (a < 0) != (b < 0); -} - -int -test_10 (int a, int b) -{ - return (a < 0) != (b < 0) ? -20 : -40; -} - -bool -test_11 (int a, int b) -{ - return (a >= 0) ^ (b < 0); -} - -int -test_12 (int a, int b) -{ - return (a >= 0) ^ (b < 0) ? -20 : -40; -} - -bool -test_13 (int a, int b) -{ - return !((a >= 0) ^ (b < 0)); -} - -int -test_14 (int a, int b) -{ - return !((a >= 0) ^ (b < 0)) ? -20 : -40; -} - -bool -test_15 (int a, int b) -{ - return (a & 0x80000000) == (b & 0x80000000); -} - -int -test_16 (int a, int b) -{ - return (a & 0x80000000) == (b & 0x80000000) ? -20 : -40; -} - -bool -test_17 (int a, int b) -{ - return (a & 0x80000000) != (b & 0x80000000); -} - -int -test_18 (int a, int b) -{ - return (a & 0x80000000) != (b & 0x80000000) ? -20 : -40; -} - -int -test_19 (unsigned int a, unsigned int b) -{ - return (a ^ b) >> 31; -} - -int -test_20 (unsigned int a, unsigned int b) -{ - return (a >> 31) ^ (b >> 31); -} - -int -test_21 (int a, int b) -{ - return ((a & 0x80000000) ^ (b & 0x80000000)) >> 31 ? -30 : -10; -} - -int -test_22 (int a, int b, int c, int d) -{ - if ((a < 0) == (b < 0)) - return other_func_a (a, b); - else - return other_func_b (c, d); -} - -bool -test_23 (int a, int b, int c, int d) -{ - /* Should emit 2x div0s. */ - return ((a < 0) == (b < 0)) | ((c < 0) == (d < 0)); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr52933-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr52933-2.c deleted file mode 100644 index b0e650bf0..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr52933-2.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Check that the div0s instruction is used for integer sign comparisons - when -mpretend-cmove is enabled. - Each test case is expected to emit at least one div0s insn. - Problems when combining the div0s comparison result with surrounding - logic usually show up as redundant tst insns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2 -mpretend-cmove" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "div0s" 25 } } */ -/* { dg-final { scan-assembler-not "tst" } } */ - -#include "pr52933-1.c" diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53511-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53511-1.c deleted file mode 100644 index 5295d95f4..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53511-1.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Verify that the fmac insn is used for the standard fmaf function. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m3" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler "fmac" } } */ - -#include <math.h> - -float -test_func_00 (float a, float b, float c) -{ - return fmaf (a, b, c); -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-1.c deleted file mode 100644 index 0813d5959..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-1.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Verify that the fsca insn is used when specifying -mfsca and - -funsafe-math-optimizations. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -mfsca -funsafe-math-optimizations" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2*" "-m3*" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fsca" 3 } } */ - -#include <math.h> - -float -test_func_00 (float x) -{ - return sinf (x) + cosf (x); -} - -float -test_func_01 (float x) -{ - return sinf (x); -} - -float -test_func_02 (float x) -{ - return cosf (x); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-2.c deleted file mode 100644 index d629ee712..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-2.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Verify that the fsca insn is not used when specifying -mno-fsca and - -funsafe-math-optimizations. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -mno-fsca -funsafe-math-optimizations" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2*" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "fsca" } } */ - -#include <math.h> - -float -test_func_00 (float x) -{ - return sinf (x) + cosf (x); -} - -float -test_func_01 (float x) -{ - return sinf (x); -} - -float -test_func_02 (float x) -{ - return cosf (x); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-3.c deleted file mode 100644 index 21801bb6d..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-3.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Verify that the fsrra insn is used when specifying -mfsrra and - -funsafe-math-optimizations and -ffinite-math-only. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -mfsrra -funsafe-math-optimizations -ffinite-math-only" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2*" "-m3*" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler "fsrra" } } */ - -#include <math.h> - -float -test_func_00 (float x) -{ - return 1 / sqrtf (x); -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-4.c deleted file mode 100644 index 9ddad38b2..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53512-4.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Verify that the fsrra insn is not used when specifying -mno-fsrra and - -funsafe-math-optimizations and -ffinite-math-only. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -mno-fsrra -funsafe-math-optimizations -ffinite-math-only" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2*" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-not "fsrra" } } */ - -#include <math.h> - -float -test_func_00 (float x) -{ - return 1 / sqrtf (x); -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53568-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53568-1.c deleted file mode 100644 index 22f836ef8..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53568-1.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Check that the bswap32 pattern is generated as swap.b and swap.w - instructions. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "swap.w" 7 } } */ -/* { dg-final { scan-assembler-times "swap.b" 16 } } */ -/* { dg-final { scan-assembler-times "extu.w" 2 } } */ -/* { dg-final { scan-assembler-times "mov" 1 } } */ -/* { dg-final { scan-assembler-not "{shll8|shlr8|shld|shad}" } } */ - -int -test_func_00 (int a) -{ - /* 1x swap.w - 2x swap.b */ - return __builtin_bswap32 (a); -} - -unsigned int -test_func_01 (unsigned int a) -{ - /* 1x swap.w - 2x swap.b */ - return __builtin_bswap32 (a); -} - -int -test_func_02 (int a) -{ - /* 1x swap.w - 2x swap.b */ - return (((a >> 0) & 0xFF) << 24) - | (((a >> 8) & 0xFF) << 16) - | (((a >> 16) & 0xFF) << 8) - | (((a >> 24) & 0xFF) << 0); -} - -unsigned int -test_func_03 (unsigned int a) -{ - /* 1x swap.w - 2x swap.b */ - return (((a >> 0) & 0xFF) << 24) - | (((a >> 8) & 0xFF) << 16) - | (((a >> 16) & 0xFF) << 8) - | (((a >> 24) & 0xFF) << 0); -} - -int -test_func_04 (int a) -{ - /* 1x swap.b - 1x extu.w */ - return __builtin_bswap32 (a) >> 16; -} - -unsigned short -test_func_05 (unsigned short a) -{ - /* 1x swap.b - 1x extu.w */ - return __builtin_bswap32 (a) >> 16; -} - -long long -test_func_06 (long long a) -{ - /* 2x swap.w - 4x swap.b */ - return __builtin_bswap64 (a); -} - -long long -test_func_07 (long long a) -{ - /* 1x swap.w - 2x swap.b - 1x mov #0,Rn */ - return __builtin_bswap64 (a) >> 32; -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53988.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53988.c deleted file mode 100644 index 4bade1efb..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr53988.c +++ /dev/null @@ -1,74 +0,0 @@ -/* Check that the tst Rm,Rn instruction is generated for QImode and HImode - values loaded from memory. If everything goes as expected we won't see - any sign/zero extensions or and ops. On SH2A we don't expect to see the - movu insn. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "tst\tr" 8 } } */ -/* { dg-final { scan-assembler-not "tst\t#255" } } */ -/* { dg-final { scan-assembler-not "exts|extu|and|movu" } } */ - -int -test00 (char* a, char* b, int c, int d) -{ - if (*a & *b) - return c; - return d; -} - -int -test01 (unsigned char* a, unsigned char* b, int c, int d) -{ - if (*a & *b) - return c; - return d; -} - -int -test02 (short* a, short* b, int c, int d) -{ - if (*a & *b) - return c; - return d; -} - -int -test03 (unsigned short* a, unsigned short* b, int c, int d) -{ - if (*a & *b) - return c; - return d; -} - -int -test04 (char* a, short* b, int c, int d) -{ - if (*a & *b) - return c; - return d; -} - -int -test05 (short* a, char* b, int c, int d) -{ - if (*a & *b) - return c; - return d; -} - -int -test06 (int* a, char* b, int c, int d) -{ - if (*a & *b) - return c; - return d; -} - -int -test07 (int* a, short* b, int c, int d) -{ - if (*a & *b) - return c; - return d; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-1.c deleted file mode 100644 index 399b0a53e..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-1.c +++ /dev/null @@ -1,174 +0,0 @@ -/* Check that the rotcr instruction is generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "rotcr" 24 } } */ -/* { dg-final { scan-assembler-times "shll\t" 1 } } */ - -typedef char bool; - -long long -test_00 (long long a) -{ - return a >> 1; -} - -unsigned int -test_01 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a >> 1) | (r << 31)); -} - -unsigned int -test_02 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a >> 2) | (r << 31)); -} - -unsigned int -test_03 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a >> 3) | (r << 31)); -} - -unsigned int -test_04 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a >> 4) | (r << 31)); -} - -unsigned int -test_05 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a >> 5) | (r << 31)); -} - -unsigned int -test_06 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a >> 6) | (r << 31)); -} - -unsigned int -test_07 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a >> 7) | (r << 31)); -} - -unsigned int -test_08 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a >> 8) | (r << 31)); -} - -unsigned int -test_09 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a >> 31) | (r << 31)); -} - -int -test_10 (int a, int b) -{ - bool r = a == b; - return r << 31; -} - -unsigned int -test_11 (unsigned int a, int b) -{ - /* 1x shlr, 1x rotcr */ - return (a >> 1) | (b << 31); -} - -unsigned int -test_12 (unsigned int a, int b) -{ - return (a >> 2) | (b << 31); -} - -unsigned int -test_13 (unsigned int a, int b) -{ - return (a >> 3) | (b << 31); -} - -unsigned int -test_14 (unsigned int a, int b) -{ - /* 1x shll, 1x rotcr */ - bool r = b < 0; - return ((a >> 1) | (r << 31)); -} - -unsigned int -test_15 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a >> 1) | (r << 31)); -} - -unsigned int -test_16 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a >> 2) | (r << 31)); -} - -unsigned int -test_17 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a >> 3) | (r << 31)); -} - -unsigned int -test_18 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a >> 4) | (r << 31)); -} - -unsigned int -test_19 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a >> 5) | (r << 31)); -} - -unsigned int -test_20 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a >> 6) | (r << 31)); -} - -unsigned int -test_21 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a >> 7) | (r << 31)); -} - -unsigned int -test_22 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a >> 8) | (r << 31)); -} - -unsigned int -test_23 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a >> 31) | (r << 31)); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-2.c deleted file mode 100644 index 61b703d4d..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-2.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Check that for dynamic logical right shifts with a constant the negated - constant is loaded directly, instead of loading the postitive constant - and negating it separately. This was a case that happened at optimization - level -O2 and looked like: - cmp/eq r6,r5 - mov #30,r1 - neg r1,r1 - shld r1,r4 - mov r4,r0 - rts - rotcr r0 */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*"} { "-m3* -m2a* -m4*" } } */ -/* { dg-final { scan-assembler-not "neg" } } */ - -unsigned int -test (unsigned int a, int b, int c) -{ - unsigned char r = b == c; - return ((a >> 31) | (r << 31)); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-3.c deleted file mode 100644 index ffb976ba1..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-3.c +++ /dev/null @@ -1,40 +0,0 @@ -/* The dynamic shift library functions truncate the shift count to 5 bits. - Verify that this is taken into account and no extra shift count - truncations are generated before the library call. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m1*" "-m2" "-m2e*" } } */ -/* { dg-final { scan-assembler-not "and" } } */ -/* { dg-final { scan-assembler-not "31" } } */ - -int -test00 (unsigned int a, int* b, int c, int* d, unsigned int e) -{ - int s = 0; - int i; - for (i = 0; i < c; ++i) - s += d[i] + b[i] + (e << (i & 31)); - return s; -} - -int -test01 (unsigned int a, int* b, int c, int* d, unsigned int e) -{ - int s = 0; - int i; - for (i = 0; i < c; ++i) - s += d[i] + b[i] + (e >> (i & 31)); - return s; -} - -int -test03 (unsigned int a, unsigned int b) -{ - return b << (a & 31); -} - -unsigned int -test04 (unsigned int a, int b) -{ - return a >> (b & 31); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-4.c deleted file mode 100644 index 4617c3a5f..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-4.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Check that the rotcr instruction is generated when shifting the - negated T bit on non-SH2A. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" "-m2a*" } { "" } } */ -/* { dg-final { scan-assembler-times "rotcr" 1 } } */ -/* { dg-final { scan-assembler-times "tst" 1 } } */ -/* { dg-final { scan-assembler-times "movt" 1 } } */ - -int -test_00 (int a, int b) -{ - int r = a != b; - return r << 31; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-5.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-5.c deleted file mode 100644 index f781acabf..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-5.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Check that the movrt rotr instruction sequence is generated when shifting - the negated T bit on SH2A. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" } } */ -/* { dg-final { scan-assembler-times "movrt" 1 } } */ -/* { dg-final { scan-assembler-times "rotr" 1 } } */ - -int -test_00 (int a, int b) -{ - int r = a != b; - return r << 31; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-6.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-6.c deleted file mode 100644 index a12a0e930..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-6.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Check that the rotr and rotl instructions are generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "rotr" 2 } } */ -/* { dg-final { scan-assembler-times "rotl" 2 } } */ - -int -test_00 (int a) -{ - return (a << 1) | ((a >> 31) & 1); -} - -int -test_01 (int a) -{ - return (a << 1) | ((unsigned int)a >> 31); -} - -int -test_02 (int a) -{ - return ((unsigned int)a >> 1) | (a << 31); -} - -int -test_03 (int a) -{ - return ((a >> 1) & 0x7FFFFFFF) | (a << 31); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-7.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-7.c deleted file mode 100644 index 40ca8219a..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-7.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Check that the rotcr instruction is generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "rotcr" 4 } } */ -/* { dg-final { scan-assembler-not "movt" } } */ -/* { dg-final { scan-assembler-not "or\t" } } */ -/* { dg-final { scan-assembler-not "rotr" } } */ -/* { dg-final { scan-assembler-not "and" } } */ - -typedef char bool; - -int -test_00 (int* a, int* b) -{ - int i; - unsigned int r = 0; - for (i = 0; i < 16; ++i) - { - bool t = a[i] == b[i]; - r = (t << 31) | (r >> 1); - } - return r; -} - -int -test_01 (int* a, int* b) -{ - int i; - unsigned int r = 0; - for (i = 0; i < 16; ++i) - { - bool t = a[i] == b[i]; - r = (t << 31) | (r >> 2); - } - return r; -} - -int -test_02 (int* a, int* b) -{ - int i; - unsigned int r = 0; - for (i = 0; i < 16; ++i) - { - bool t = a[i] == b[i]; - r = (t << 31) | (r >> 3); - } - return r; -} - -unsigned int -test_03 (const bool* a) -{ - int i; - unsigned int r = 0; - for (i = 0; i < 32; ++i) - { - bool t = a[i]; - r = (t << 31) | (r >> 1); - } - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-8.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-8.c deleted file mode 100644 index fa9e8f383..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-8.c +++ /dev/null @@ -1,203 +0,0 @@ -/* Check that the rotcl instruction is generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "rotcl" 28 } } */ - -typedef char bool; - -long long -test_00 (long long a) -{ - return a << 1; -} - -unsigned int -test_01 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a << 1) | r); -} - -unsigned int -test_02 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a << 2) | r); -} - -unsigned int -test_03 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a << 3) | r); -} - -unsigned int -test_04 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a << 4) | r); -} - -unsigned int -test_05 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a << 5) | r); -} - -unsigned int -test_06 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a << 6) | r); -} - -unsigned int -test_07 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a << 7) | r); -} - -unsigned int -test_08 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a << 8) | r); -} - -unsigned int -test_09 (unsigned int a, int b, int c) -{ - bool r = b == c; - return ((a << 31) | r); -} - -unsigned int -test_10 (unsigned int a, int b) -{ - /* 1x shlr, 1x rotcl */ - return (a << 1) | (b & 1); -} - -unsigned int -test_11 (unsigned int a, int b) -{ - /* 1x shlr, 1x rotcl (+1x add as shll) */ - return (a << 2) | (b & 1); -} - -unsigned int -test_12 (unsigned int a, int b) -{ - /* 1x shlr, 1x shll2, 1x rotcl */ - return (a << 3) | (b & 1); -} - -unsigned int -test_13 (unsigned int a, int b) -{ - /* 1x shll, 1x rotcl */ - bool r = b < 0; - return (a << 1) | r; -} - -unsigned int -test_14 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a << 1) | r); -} - -unsigned int -test_15 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a << 11) | r); -} - -unsigned int -test_16 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a << 3) | r); -} - -unsigned int -test_17 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a << 4) | r); -} - -unsigned int -test_18 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a << 5) | r); -} - -unsigned int -test_19 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a << 6) | r); -} - -unsigned int -test_20 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a << 7) | r); -} - -unsigned int -test_21 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a << 8) | r); -} - -unsigned int -test_22 (unsigned int a, int b, int c) -{ - bool r = b != c; - return ((a << 31) | r); -} - -unsigned int -test_23 (unsigned int a, int b, int c) -{ - /* 1x shll, 1x rotcl */ - return (a >> 31) | (b << 13); -} - -unsigned int -test_24 (unsigned int a, unsigned int b) -{ - /* 1x shll, 1x rotcl */ - return (a >> 31) | (b << 1); -} - -unsigned int -test_25 (unsigned int a, unsigned int b) -{ - /* 1x shll, 1x rotcl */ - return (a >> 31) | (b << 3); -} - -unsigned int -test_26 (unsigned int a, unsigned int b) -{ - /* 1x shll, 1x rotcl */ - return (b << 3) | (a >> 31); -} - -unsigned int -test_27 (unsigned int a, unsigned int b) -{ - /* 1x shlr, 1x rotcl */ - return (a << 1) | ((b >> 4) & 1); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-9.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-9.c deleted file mode 100644 index bd889dc34..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54089-9.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Check that the rotcr instruction is generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "rotcl" 4 } } */ -/* { dg-final { scan-assembler-not "movt" } } */ -/* { dg-final { scan-assembler-not "or\t" } } */ -/* { dg-final { scan-assembler-not "rotl" } } */ -/* { dg-final { scan-assembler-not "and" } } */ - -typedef char bool; - -int -test_00 (int* a, int* b) -{ - int i; - int r = 0; - for (i = 0; i < 16; ++i) - { - bool t = a[i] == b[i]; - r = (r << 1) | t; - } - return r; -} - -int -test_01 (int* a, int* b) -{ - int i; - int r = 0; - for (i = 0; i < 16; ++i) - { - bool t = a[i] == b[i]; - r = (r << 2) | t; - } - return r; -} - -int -test_02 (int* a, int* b) -{ - int i; - int r = 0; - for (i = 0; i < 16; ++i) - { - bool t = a[i] == b[i]; - r = (r << 3) | t; - } - return r; -} - -int -test_03 (const bool* a) -{ - int i; - int r = 0; - for (i = 0; i < 16; ++i) - { - bool t = a[i]; - r = (r << 1) | (t & 1); - } - return r; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54236-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54236-1.c deleted file mode 100644 index 748b6c9f2..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54236-1.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Tests to check the utilization of addc, subc and negc instructions in - special cases. If everything works as expected we won't see any - movt instructions in these cases. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "addc" 4 } } */ -/* { dg-final { scan-assembler-times "subc" 3 } } */ -/* { dg-final { scan-assembler-times "sett" 5 } } */ -/* { dg-final { scan-assembler-times "negc" 1 } } */ -/* { dg-final { scan-assembler-not "movt" } } */ - -int -test_00 (int a, int b, int c, int d) -{ - /* 1x addc, 1x sett */ - return a + b + 1; -} - -int -test_01 (int a, int b, int c, int d) -{ - /* 1x addc */ - return a + (c == d); -} - -int -test_02 (int a, int b, int c, int d) -{ - /* 1x subc, 1x sett */ - return a - b - 1; -} - -int -test_03 (int a, int b, int c, int d) -{ - /* 1x subc */ - return a - (c == d); -} - -int -test_04 (int a, int b, int c, int d) -{ - /* 1x addc, 1x sett */ - return a + b + c + 1; -} - -int -test_05 (int a, int b, int c, int d) -{ - /* 1x subc, 1x sett */ - return a - b - c - 1; -} - -int -test_06 (int a, int b, int c, int d) -{ - /* 1x negc */ - return 0 - a - (b == c); -} - -int -test_07 (int *vec) -{ - /* Must not see a 'sett' or 'addc' here. - This is a case where combine tries to produce - 'a + (0 - b) + 1' out of 'a - b + 1'. */ - int z = vec[0]; - int vi = vec[1]; - int zi = vec[2]; - - if (zi != 0 && z < -1) - vi -= (((vi >> 7) & 0x01) << 1) - 1; - - return vi; -} - -int -test_08 (int a) -{ - /* 1x addc, 1x sett */ - return (a << 1) + 1; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54386.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54386.c deleted file mode 100644 index 4e17f37b0..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54386.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Check that the inlined mem load is not handled as unaligned load. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-not "shll|extu|or" } } */ - -static inline int -readint0 (int* x) -{ - return *x; -} - -int -test0 (int* x) -{ - return readint0 (x); -} - -inline int -readint1 (int* x) -{ - return *x; -} - -int -test1 (int* x) -{ - return readint1 (x); -} - -static int -readint2 (int* x) -{ - return *x; -} - -int -test2 (int* x) -{ - return readint2 (x); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-1.c deleted file mode 100644 index e5c035708..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Verify that the delay slot is stuffed with register pop insns for normal - (i.e. not interrupt handler) function returns. If everything goes as - expected we won't see any nop insns. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-not "nop" } } */ - -int test00 (int a, int b); - -int -test01 (int a, int b, int c, int d) -{ - return test00 (a, b) + c; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-2.c deleted file mode 100644 index 4f3877c41..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-2.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Verify that the delay slot is not stuffed with register pop insns for - interrupt handler function returns on SH1* and SH2* targets, where the - rte insn uses the stack pointer. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m1*" "-m2*" } } */ -/* { dg-final { scan-assembler-times "nop" 1 } } */ - -int test00 (int a, int b); - -int __attribute__ ((interrupt_handler)) -test01 (int a, int b, int c, int d) -{ - return test00 (a, b) + c; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-3.c deleted file mode 100644 index 29292589c..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-3.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Verify that the rte delay slot is not stuffed with register pop insns - which touch the banked registers r0..r7 on SH3* and SH4* targets. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m3*" "-m4*" } } */ -/* { dg-final { scan-assembler-times "nop" 1 } } */ - -int __attribute__ ((interrupt_handler)) -test00 (int a, int b, int c, int d) -{ - return a + b; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-4.c deleted file mode 100644 index 0b77d0983..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54602-4.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Verify that the delay slot is stuffed with register pop insns on SH3* and - SH4* targets, where the stack pointer is not used by the rte insn. If - everything works out, we won't see a nop insn. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m3*" "-m4*" } } */ -/* { dg-final { scan-assembler-not "nop" } } */ - -int test00 (int a, int b); - -int __attribute__ ((interrupt_handler)) -test01 (int a, int b, int c, int d) -{ - return test00 (a, b) + c; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54680.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54680.c deleted file mode 100644 index 27c44d3ca..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54680.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Verify that the fsca input value is not converted to float and then back - to int. Notice that we can't count just "lds" insns because mode switches - use "lds.l". */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O2 -mfsca -funsafe-math-optimizations" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2*" "-m3*" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */ -/* { dg-final { scan-assembler-times "fsca" 7 } } */ -/* { dg-final { scan-assembler-times "shad" 1 } } */ -/* { dg-final { scan-assembler-times "lds\t" 6 } } */ -/* { dg-final { scan-assembler-times "fmul" 2 } } */ -/* { dg-final { scan-assembler-times "ftrc" 1 } } */ - -#include <math.h> - -static const float pi = 3.14159265359f; - -float -test00 (int x) -{ - /* 1x shad, 1x lds, 1x fsca */ - return sinf ( (x >> 8) * (2*pi) / (1 << 16)); -} - -float -test01 (int x) -{ - /* 1x lds, 1x fsca */ - return sinf (x * (2*pi) / 65536); -} - -float -test02 (int x) -{ - /* 1x lds, 1x fsca */ - return sinf (x * (2*pi / 65536)); -} - -float -test03 (int x) -{ - /* 1x lds, 1x fsca */ - float scale = 2*pi / 65536; - return sinf (x * scale); -} - -float -test04 (int x) -{ - /* 1x lds, 1x fsca */ - return cosf (x / 65536.0f * 2*pi); -} - -float -test05 (int x) -{ - /* 1x lds, 1x fsca, 1x fmul */ - float scale = 2*pi / 65536; - return sinf (x * scale) * cosf (x * scale); -} - -float -test_06 (float x) -{ - /* 1x fmul, 1x ftrc, 1x fsca */ - return sinf (x); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54685.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54685.c deleted file mode 100644 index 38a1410fb..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54685.c +++ /dev/null @@ -1,58 +0,0 @@ -/* Check that a comparison 'unsigned int <= 0x7FFFFFFF' results in code - utilizing the cmp/pz instruction. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-not "not\[ \t\]" } } */ -/* { dg-final { scan-assembler-times "cmp/pz" 7 } } */ -/* { dg-final { scan-assembler-times "shll" 1 } } */ -/* { dg-final { scan-assembler-times "movt" 4 } } */ - -int -test_00 (unsigned int a) -{ - return !(a > 0x7FFFFFFF); -} - -int -test_01 (unsigned int a) -{ - return !(a > 0x7FFFFFFF) ? -5 : 10; -} - -int -test_02 (unsigned int a) -{ - /* 1x shll, 1x movt */ - return a >= 0x80000000; -} - -int -test_03 (unsigned int a) -{ - return a >= 0x80000000 ? -5 : 10; -} - -int -test_04 (unsigned int a) -{ - return a <= 0x7FFFFFFF; -} - -int -test_05 (unsigned int a) -{ - return a <= 0x7FFFFFFF ? -5 : 10; -} - -int -test_06 (unsigned int a) -{ - return a < 0x80000000; -} - -int -test_07 (unsigned int a) -{ - return a < 0x80000000 ? -5 : 10; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-1.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-1.c deleted file mode 100644 index 9108a3fde..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-1.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Check that the __builtin_thread_pointer and __builtin_set_thread_pointer - built-in functions result in gbr store / load instructions. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "ldc" 1 } } */ -/* { dg-final { scan-assembler-times "stc" 1 } } */ -/* { dg-final { scan-assembler-times "gbr" 2 } } */ - -void* -test00 (void) -{ - return __builtin_thread_pointer (); -} - -void -test01 (void* p) -{ - __builtin_set_thread_pointer (p); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-2.c deleted file mode 100644 index 91f3648a5..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-2.c +++ /dev/null @@ -1,259 +0,0 @@ -/* Check that thread pointer relative memory accesses are converted to - gbr displacement address modes. If we see a gbr register store - instruction something is not working properly. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "stc\tgbr" 0 } } */ - -/* --------------------------------------------------------------------------- - Simple GBR load. -*/ -#define func(name, rettype, type, disp)\ - rettype \ - name ## _tp_load (void) \ - { \ - type* tp = (type*)__builtin_thread_pointer (); \ - return tp[disp]; \ - } - -func (test00, int, int, 0) -func (test01, int, int, 5) -func (test02, int, int, 255) - -func (test03, int, short, 0) -func (test04, int, short, 5) -func (test05, int, short, 255) - -func (test06, int, char, 0) -func (test07, int, char, 5) -func (test08, int, char, 255) - -func (test09, int, unsigned int, 0) -func (test10, int, unsigned int, 5) -func (test11, int, unsigned int, 255) - -func (test12, int, unsigned short, 0) -func (test13, int, unsigned short, 5) -func (test14, int, unsigned short, 255) - -func (test15, int, unsigned char, 0) -func (test16, int, unsigned char, 5) -func (test17, int, unsigned char, 255) - -func (test18, long long, long long, 0) -func (test19, long long, long long, 5) -func (test20, long long, long long, 127) - -func (test21, long long, unsigned long long, 0) -func (test22, long long, unsigned long long, 5) -func (test23, long long, unsigned long long, 127) - -#undef func - -/* --------------------------------------------------------------------------- - Simple GBR store. -*/ -#define func(name, argtype, type, disp)\ - void \ - name ## _tp_store (argtype a) \ - { \ - type* tp = (type*)__builtin_thread_pointer (); \ - tp[disp] = (type)a; \ - } - -func (test00, int, int, 0) -func (test01, int, int, 5) -func (test02, int, int, 255) - -func (test03, int, short, 0) -func (test04, int, short, 5) -func (test05, int, short, 255) - -func (test06, int, char, 0) -func (test07, int, char, 5) -func (test08, int, char, 255) - -func (test09, int, unsigned int, 0) -func (test10, int, unsigned int, 5) -func (test11, int, unsigned int, 255) - -func (test12, int, unsigned short, 0) -func (test13, int, unsigned short, 5) -func (test14, int, unsigned short, 255) - -func (test15, int, unsigned char, 0) -func (test16, int, unsigned char, 5) -func (test17, int, unsigned char, 255) - -func (test18, long long, long long, 0) -func (test19, long long, long long, 5) -func (test20, long long, long long, 127) - -func (test21, long long, unsigned long long, 0) -func (test22, long long, unsigned long long, 5) -func (test23, long long, unsigned long long, 127) - -#undef func - -/* --------------------------------------------------------------------------- - Arithmetic on the result of a GBR load. -*/ -#define func(name, retargtype, type, disp, op, opname)\ - retargtype \ - name ## _tp_load_arith_ ##opname (retargtype a) \ - { \ - type* tp = (type*)__builtin_thread_pointer (); \ - return tp[disp] op a; \ - } - -#define funcs(op, opname) \ - func (test00, int, int, 0, op, opname) \ - func (test01, int, int, 5, op, opname) \ - func (test02, int, int, 255, op, opname) \ - func (test03, int, short, 0, op, opname) \ - func (test04, int, short, 5, op, opname) \ - func (test05, int, short, 255, op, opname) \ - func (test06, int, char, 0, op, opname) \ - func (test07, int, char, 5, op, opname) \ - func (test08, int, char, 255, op, opname) \ - func (test09, int, unsigned int, 0, op, opname) \ - func (test10, int, unsigned int, 5, op, opname) \ - func (test11, int, unsigned int, 255, op, opname) \ - func (test12, int, unsigned short, 0, op, opname) \ - func (test13, int, unsigned short, 5, op, opname) \ - func (test14, int, unsigned short, 255, op, opname) \ - func (test15, int, unsigned char, 0, op, opname) \ - func (test16, int, unsigned char, 5, op, opname) \ - func (test17, int, unsigned char, 255, op, opname) \ - func (test18, long long, long long, 0, op, opname) \ - func (test19, long long, long long, 5, op, opname) \ - func (test20, long long, long long, 127, op, opname) \ - func (test21, long long, unsigned long long, 0, op, opname) \ - func (test22, long long, unsigned long long, 5, op, opname) \ - func (test23, long long, unsigned long long, 127, op, opname) \ - -funcs (+, plus) -funcs (-, minus) -funcs (*, mul) -funcs (&, and) -funcs (|, or) -funcs (^, xor) - -#undef funcs -#undef func - -/* --------------------------------------------------------------------------- - Arithmetic of the result of two GBR loads. -*/ -#define func(name, rettype, type, disp0, disp1, op, opname)\ - rettype \ - name ## _tp_load_load_arith_ ##opname (void) \ - { \ - type* tp = (type*)__builtin_thread_pointer (); \ - return tp[disp0] op tp[disp1]; \ - } - -#define funcs(op, opname) \ - func (test00, int, int, 0, 5, op, opname) \ - func (test02, int, int, 1, 255, op, opname) \ - func (test03, int, short, 0, 5, op, opname) \ - func (test05, int, short, 1, 255, op, opname) \ - func (test06, int, char, 0, 5, op, opname) \ - func (test08, int, char, 1, 255, op, opname) \ - func (test09, int, unsigned int, 0, 5, op, opname) \ - func (test11, int, unsigned int, 1, 255, op, opname) \ - func (test12, int, unsigned short, 0, 5, op, opname) \ - func (test14, int, unsigned short, 1, 255, op, opname) \ - func (test15, int, unsigned char, 0, 5, op, opname) \ - func (test17, int, unsigned char, 1, 255, op, opname) \ - func (test18, long long, long long, 0, 5, op, opname) \ - func (test19, long long, long long, 1, 127, op, opname) \ - func (test20, long long, unsigned long long, 0, 5, op, opname) \ - func (test21, long long, unsigned long long, 1, 127, op, opname) \ - -funcs (+, plus) -funcs (-, minus) -funcs (*, mul) -funcs (&, and) -funcs (|, or) -funcs (^, xor) - -#undef funcs -#undef func - -/* --------------------------------------------------------------------------- - GBR load GBR store copy. -*/ - -#define func(name, type, disp0, disp1)\ - void \ - name ## _tp_copy (void) \ - { \ - type* tp = (type*)__builtin_thread_pointer (); \ - tp[disp0] = tp[disp1]; \ - } - -func (test00, int, 0, 5) -func (test02, int, 1, 255) -func (test03, short, 0, 5) -func (test05, short, 1, 255) -func (test06, char, 0, 5) -func (test08, char, 1, 255) -func (test09, unsigned int, 0, 5) -func (test11, unsigned int, 1, 255) -func (test12, unsigned short, 0, 5) -func (test14, unsigned short, 1, 255) -func (test15, unsigned char, 0, 5) -func (test17, unsigned char, 1, 255) -func (test18, long long, 0, 5) -func (test19, long long, 1, 127) -func (test20, unsigned long long, 0, 5) -func (test21, unsigned long long, 1, 127) - -#undef func - -/* --------------------------------------------------------------------------- - GBR load, arithmetic, GBR store -*/ - -#define func(name, argtype, type, disp, op, opname)\ - void \ - name ## _tp_load_arith_store_ ##opname (argtype a) \ - { \ - type* tp = (type*)__builtin_thread_pointer (); \ - tp[disp] op a; \ - } - -#define funcs(op, opname) \ - func (test00, int, int, 0, op, opname) \ - func (test01, int, int, 5, op, opname) \ - func (test02, int, int, 255, op, opname) \ - func (test03, int, short, 0, op, opname) \ - func (test04, int, short, 5, op, opname) \ - func (test05, int, short, 255, op, opname) \ - func (test06, int, char, 0, op, opname) \ - func (test07, int, char, 5, op, opname) \ - func (test08, int, char, 255, op, opname) \ - func (test09, int, unsigned int, 0, op, opname) \ - func (test10, int, unsigned int, 5, op, opname) \ - func (test11, int, unsigned int, 255, op, opname) \ - func (test12, int, unsigned short, 0, op, opname) \ - func (test13, int, unsigned short, 5, op, opname) \ - func (test14, int, unsigned short, 255, op, opname) \ - func (test15, int, unsigned char, 0, op, opname) \ - func (test16, int, unsigned char, 5, op, opname) \ - func (test17, int, unsigned char, 255, op, opname) \ - func (test18, long long, long long, 0, op, opname) \ - func (test19, long long, long long, 5, op, opname) \ - func (test20, long long, long long, 127, op, opname) \ - func (test21, long long, unsigned long long, 0, op, opname) \ - func (test22, long long, unsigned long long, 5, op, opname) \ - func (test23, long long, unsigned long long, 127, op, opname) \ - -funcs (+=, plus) -funcs (-=, minus) -funcs (*=, mul) -funcs (&=, and) -funcs (|=, or) -funcs (^=, xor) diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-3.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-3.c deleted file mode 100644 index 2b6f18617..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-3.c +++ /dev/null @@ -1,69 +0,0 @@ -/* Check that these thread relative memory accesses play along with - surrounding code. - These should be moved to C torture tests once there are target - independent thread_pointer built-in functions available. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ - -int -test00 (void* p, int x) -{ - int* tcb = (int*)__builtin_thread_pointer (); - int r = tcb[4]; - - __builtin_set_thread_pointer (p); - - tcb = (int*)__builtin_thread_pointer (); - return tcb[255] + r; -} - -int -test01 (void) -{ - unsigned short* tcb = (unsigned short*)__builtin_thread_pointer (); - return tcb[500]; -} - -void -test02 (int* x, int a, int b) -{ - int* tcb = (int*)__builtin_thread_pointer (); - tcb[50] = a; - - __builtin_set_thread_pointer (x); - - tcb = (int*)__builtin_thread_pointer (); - tcb[40] = b; -} - -int -test03 (const int* x, int c) -{ - volatile int* tcb = (volatile int*)__builtin_thread_pointer (); - - int s = 0; - int i; - for (i = 0; i < c; ++i) - s ^= x[i] + tcb[40]; - - return s; -} - -int -test04 (const int* x, int c, int** xx, int d) -{ - int s = 0; - int i; - for (i = 0; i < c; ++i) - { - volatile int* tcb = (volatile int*)__builtin_thread_pointer (); - tcb[20] = s; - - __builtin_set_thread_pointer (xx[i]); - - tcb = (volatile int*)__builtin_thread_pointer (); - s ^= x[i] + tcb[40] + d; - } - return s; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-4.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-4.c deleted file mode 100644 index 3ee36a313..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr54760-4.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Check that the GBR address optimization does not combine a gbr store - and its use when a function call is inbetween, when GBR is a call used - register, i.e. it is invalidated by function calls. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1 -fcall-used-gbr" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler "stc\tgbr" } } */ - -extern int test00 (void); -int -test01 (int x) -{ - /* We must see a stc gbr,rn before the function call, because - a function call could modify the gbr. In this case the user requests - the old gbr value, before the function call. */ - int* p = (int*)__builtin_thread_pointer (); - p[5] = test00 (); - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr55146.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr55146.c deleted file mode 100644 index 11dd49ff6..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr55146.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Check that the 'extu.b' instruction is generated for short jump tables. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-Os" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler "extu.b" } } */ - -int -test (int arg) -{ - int rc; - switch (arg) - { - case 0: - asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "mov r4,%0" - : "=r" (rc) - : "r" (arg)); - break; - case 1: - asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "mov r5,%0" - : "=r" (rc) - : "r" (arg)); - break; - case 2: - asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "mov r6,%0" - : "=r" (rc) - : "r" (arg)); - break; - case 3: - asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "mov r7,%0" - : "=r" (rc) - : "r" (arg)); - break; - case 4: - asm ("nop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "nop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\tnop\n\t" - "mov r8,%0" - : "=r" (rc) - : "r" (arg)); - break; - } - return rc; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr55160.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr55160.c deleted file mode 100644 index ae0d83aa7..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr55160.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Check that the decrement-and-test instruction is generated. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ -/* { dg-final { scan-assembler-times "dt\tr" 2 } } */ - -int -test_00 (int* x, int c) -{ - int s = 0; - int i; - for (i = 0; i < c; ++i) - s += x[i]; - return s; -} - -int -test_01 (int* x, int c) -{ - int s = 0; - int i; - for (i = 0; i < c; ++i) - s += *--x; - return s; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr57108.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr57108.c deleted file mode 100644 index 3d39637b6..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/pr57108.c +++ /dev/null @@ -1,19 +0,0 @@ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O1" } */ - -void __assert_func (void) __attribute__ ((__noreturn__)) ; - -void ATATransfer (int num, int buffer) -{ - int wordCount; - - while (num > 0) - { - wordCount = num * 512 / sizeof (int); - - ((0 == (buffer & 63)) ? (void)0 : __assert_func () ); - ((0 == (wordCount & 31)) ? (void)0 : __assert_func ()); - } - - - } diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/prefetch.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/prefetch.c deleted file mode 100644 index e08737374..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/prefetch.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Testcase to check generation of a SH4 and SH2A operand cache prefetch - instruction PREF @Rm. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O0" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m2a*" "-m3*" "-m4*" } } */ -/* { dg-final { scan-assembler "pref"} } */ - -void -opt (void) -{ - int *p, wk; - int data[100]; - - /* data prefetch , instructions hit the cache. */ - - __builtin_prefetch (&data[0], 0, 0); - __builtin_prefetch (&data[0], 0, 1); - __builtin_prefetch (&data[0], 0, 2); - __builtin_prefetch (&data[0], 0, 3); - __builtin_prefetch (&data[0], 1, 0); - __builtin_prefetch (&data[0], 1, 1); - __builtin_prefetch (&data[0], 1, 2); - __builtin_prefetch (&data[0], 1, 3); - - - for (p = &data[0]; p < &data[9]; p++) - { - if (*p > *(p + 1)) - { - wk = *p; - *p = *(p + 1); - *(p + 1) = wk; - } - } -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/rte-delay-slot.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/rte-delay-slot.c deleted file mode 100644 index eca5db943..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/rte-delay-slot.c +++ /dev/null @@ -1,33 +0,0 @@ -/* { dg-do compile { target "sh-*-*" } } */ -/* { dg-options "-O2" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m1 -m2*" } */ -/* { dg-final { scan-assembler-not "\trte\t\n\tmov.l\t@r15\\+" } } */ - -/* This test checks if the compiler generates a pop instruction - in the delay slot after rte. For the sh and sh2, the rte - instruction reads the return pc from the stack and any pop - in the delay slot crashes the hardware. - - Incorrect code generated - mov.l @r15+,r1 - rte - mov.l @r15+,r14 - - The right code should be - - mov.l @r15+,r1 - mov.l @r15+,r14 - rte - nop -*/ -void INT_MTU2_1_TGIA1 (void) - __attribute__ ((interrupt_handler)); -void -INT_MTU2_1_TGIA1 (void) -{ - volatile int i = 0; - volatile int x, y; - - for (i = 0; i < 10; i++) - y = y + x; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh-relax-vxworks.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh-relax-vxworks.c deleted file mode 100644 index f8c2ffef4..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh-relax-vxworks.c +++ /dev/null @@ -1,5 +0,0 @@ -/* Check that -mrelax produces the correct error message. */ -/* { dg-do compile { target { sh-*-vxworks* && nonpic } } } */ -/* { dg-error "-mrelax is only supported for RTP PIC" "" { target *-*-* } 0 } */ -/* { dg-options "-O1 -mrelax" } */ -int x; diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh-relax.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh-relax.c deleted file mode 100644 index 54422de46..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh-relax.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Check that -mrelax works. */ -/* { dg-do run { target { { sh-*-* sh?-*-* } && { ! { sh*-*-vxworks* && nonpic } } } } } */ -/* { dg-options "-O1 -mrelax" } */ - -extern void abort (void); -extern int qwerty (int); - -int -f (int i) -{ - return qwerty (i) + 1; -} - -int -qwerty (int i) -{ - switch (i) - { - case 1: - return 'q'; - case 2: - return 'w'; - case 3: - return 'e'; - case 4: - return 'r'; - case 5: - return 't'; - case 6: - return 'y'; - } -} - -int -main () -{ - if (f (1) != 'q' + 1 || f (2) != 'w' + 1 || f (3) != 'e' + 1 - || f(4) != 'r' + 1 || f (5) != 't' + 1 || f (6) != 'y' + 1) - abort (); - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh.exp b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh.exp deleted file mode 100644 index 0ee70c27e..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh.exp +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2007-2013 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 `dg.exp' driver. - -# Exit immediately if this isn't a sh target. -if ![istarget sh*-*-*] 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 - -# Main loop. -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ - "" $DEFAULT_CFLAGS - -# All done. -dg-finish diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-band.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-band.c deleted file mode 100644 index 34862b725..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-band.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction for - "BAND.B #imm3, @(disp12, Rn)". */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O1 -mbitops" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "band.b"} } */ - -volatile struct -{ - union - { - unsigned char BYTE; - struct - { - unsigned char BIT7:1; - unsigned char BIT6:1; - unsigned char BIT5:1; - unsigned char BIT4:1; - unsigned char BIT3:1; - unsigned char BIT2:1; - unsigned char BIT1:1; - unsigned char BIT0:1; - } - BIT; - } - ICR0; -} -USRSTR; - -volatile union t_IOR -{ - unsigned short WORD; - struct - { - unsigned char IOR15:1; - unsigned char IOR14:1; - unsigned char IOR13:1; - unsigned char IOR12:1; - unsigned char IOR11:1; - unsigned char IOR10:1; - unsigned char IOR9:1; - unsigned char IOR8:1; - unsigned char IOR7:1; - unsigned char IOR6:1; - unsigned char IOR5:1; - unsigned char IOR4:1; - unsigned char IOR3:1; - unsigned char IOR2:1; - unsigned char IOR1:1; - unsigned char IOR0:1; - } - BIT; -} -PORT; - -int -main () -{ - volatile unsigned char a; - - /* Instruction generated is BAND.B #imm3, @(disp12, Rn) */ - USRSTR.ICR0.BIT.BIT3 = USRSTR.ICR0.BIT.BIT4 & USRSTR.ICR0.BIT.BIT1; - USRSTR.ICR0.BIT.BIT2 = USRSTR.ICR0.BIT.BIT6 & USRSTR.ICR0.BIT.BIT6; - USRSTR.ICR0.BIT.BIT4 = USRSTR.ICR0.BIT.BIT2 & USRSTR.ICR0.BIT.BIT4; - USRSTR.ICR0.BIT.BIT6 = USRSTR.ICR0.BIT.BIT1 & USRSTR.ICR0.BIT.BIT3; - - a = USRSTR.ICR0.BIT.BIT0 & USRSTR.ICR0.BIT.BIT1; - a = USRSTR.ICR0.BIT.BIT5 & USRSTR.ICR0.BIT.BIT7; - a = USRSTR.ICR0.BIT.BIT2 & USRSTR.ICR0.BIT.BIT6; - - PORT.BIT.IOR13 = PORT.BIT.IOR0 & USRSTR.ICR0.BIT.BIT7; - PORT.BIT.IOR15 = PORT.BIT.IOR6 & USRSTR.ICR0.BIT.BIT2; - PORT.BIT.IOR3 = PORT.BIT.IOR2 & USRSTR.ICR0.BIT.BIT5; - PORT.BIT.IOR1 = PORT.BIT.IOR13 & USRSTR.ICR0.BIT.BIT1; - - PORT.BIT.IOR1 = PORT.BIT.IOR2 & USRSTR.ICR0.BIT.BIT1; - PORT.BIT.IOR11 = PORT.BIT.IOR9 & USRSTR.ICR0.BIT.BIT2; - PORT.BIT.IOR8 = PORT.BIT.IOR14 & USRSTR.ICR0.BIT.BIT5; - - PORT.BIT.IOR10 &= USRSTR.ICR0.BIT.BIT1; - PORT.BIT.IOR1 &= USRSTR.ICR0.BIT.BIT2; - PORT.BIT.IOR5 &= USRSTR.ICR0.BIT.BIT5; - PORT.BIT.IOR14 &= USRSTR.ICR0.BIT.BIT4; - - /* Instruction generated on using size optimization option "-Os". */ - a = a & USRSTR.ICR0.BIT.BIT1; - a = a & USRSTR.ICR0.BIT.BIT4; - a = a & USRSTR.ICR0.BIT.BIT0; - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bclr.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bclr.c deleted file mode 100644 index d4e11f952..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bclr.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction - 'BCLR #imm3,Rn'. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "bclr"} } */ - -struct a -{ - char a, b; - short c; -}; - -/* This function generates the instruction "BCLR #imm3,Rn" only - on using optimization option "-O1" and above. */ - -int -a2 () -{ - volatile int j; - volatile static struct a x = {1, 66, ~1}, y = {1, 2, ~2}; - - if (j > 1) - return (x.a == y.a && (x.b & ~1) == y.b); - if (j > 2) - return (x.a == y.a && (x.b & ~2) == y.b); - if (j > 3) - return (x.a == y.a && (x.b & ~4) == y.b); - if (j > 4) - return (x.a == y.a && (x.b & ~8) == y.b); - if (j > 5) - return (x.a == y.a && (x.b & ~16) == y.b); - if (j > 6) - return (x.a == y.a && (x.b & ~32) == y.b); - if (j > 7) - return (x.a == y.a && (x.b & ~64) == y.b); - if (j > 8) - return (x.a == y.a && (x.b & ~128) == y.b); -} - -int -main () -{ - volatile unsigned char x; - - x &= 0xFE; - x &= 0xFD; - x &= 0xFB; - x &= 0xF7; - x &= 0xEF; - x &= 0xDF; - x &= 0xBF; - x &= 0x7F; - - if (!a2 ()) - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bclrmem.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bclrmem.c deleted file mode 100644 index 41cb3bdfe..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bclrmem.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction - "BCLR #imm3,@(disp12,Rn)". */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O2 -mbitops" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "bclr"} } */ -/* { dg-final { scan-assembler "bclr.b"} } */ - -volatile union un_paddr -{ - unsigned char BYTE; - struct - { - unsigned char B15:1; - unsigned char B14:1; - unsigned char B13:1; - unsigned char B12:1; - unsigned char B11:1; - unsigned char B10:1; - unsigned char B9:1; - unsigned char B8:1; - unsigned char B7:1; - unsigned char B6:1; - unsigned char B5:1; - unsigned char B4:1; - unsigned char B3:1; - unsigned char B2:1; - unsigned char B1:1; - unsigned char B0:1; - } - BIT; -} -PADDR; - -int -main () -{ - PADDR.BIT.B0 = 0; - PADDR.BIT.B3 = 0; - PADDR.BIT.B6 = 0; - - PADDR.BIT.B1 &= 0; - PADDR.BIT.B4 &= 0; - PADDR.BIT.B7 &= 0; - - PADDR.BIT.B10 = 0; - PADDR.BIT.B13 = 0; - PADDR.BIT.B15 = 0; - - PADDR.BIT.B9 &= 0; - PADDR.BIT.B12 &= 0; - PADDR.BIT.B14 &= 0; - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bld.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bld.c deleted file mode 100644 index 1cf56fe27..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bld.c +++ /dev/null @@ -1,43 +0,0 @@ -/* A testcase to check generation of the following SH2A specific - instructions. - - BLD #imm3, Rn - BLD.B #imm3, @(disp12, Rn) - */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-Os -mbitops" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "bld"} } */ -/* { dg-final { scan-assembler "bld.b"} } */ - -volatile struct -{ - union - { - unsigned char BYTE; - struct - { - unsigned char BIT7:1; - unsigned char BIT6:1; - unsigned char BIT5:1; - unsigned char BIT4:1; - unsigned char BIT3:1; - unsigned char BIT2:1; - unsigned char BIT1:1; - unsigned char BIT0:1; - } - BIT; - } - ICR0; -} -USRSTR; - -int -main () -{ - volatile unsigned char a, b, c; - USRSTR.ICR0.BIT.BIT6 &= a; - USRSTR.ICR0.BIT.BIT5 |= b; - USRSTR.ICR0.BIT.BIT4 ^= c; - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bor.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bor.c deleted file mode 100644 index c3803c6b9..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bor.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction for - "BOR.B #imm3, @(disp12, Rn)". */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O1 -mbitops" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "bor.b"} } */ - -volatile struct -{ - union - { - unsigned char BYTE; - struct - { - unsigned char BIT7:1; - unsigned char BIT6:1; - unsigned char BIT5:1; - unsigned char BIT4:1; - unsigned char BIT3:1; - unsigned char BIT2:1; - unsigned char BIT1:1; - unsigned char BIT0:1; - } - BIT; - } - ICR0; -} -USRSTR; - -volatile union t_IOR -{ - unsigned short WORD; - struct - { - unsigned char IOR15:1; - unsigned char IOR14:1; - unsigned char IOR13:1; - unsigned char IOR12:1; - unsigned char IOR11:1; - unsigned char IOR10:1; - unsigned char IOR9:1; - unsigned char IOR8:1; - unsigned char IOR7:1; - unsigned char IOR6:1; - unsigned char IOR5:1; - unsigned char IOR4:1; - unsigned char IOR3:1; - unsigned char IOR2:1; - unsigned char IOR1:1; - unsigned char IOR0:1; - } - BIT; -} -PORT; - -int -main () -{ - volatile unsigned char a; - - /* Instruction generated is BOR.B #imm3, @(disp12, Rn) */ - USRSTR.ICR0.BIT.BIT3 = USRSTR.ICR0.BIT.BIT4 | USRSTR.ICR0.BIT.BIT1; - USRSTR.ICR0.BIT.BIT2 = USRSTR.ICR0.BIT.BIT6 | USRSTR.ICR0.BIT.BIT6; - USRSTR.ICR0.BIT.BIT4 = USRSTR.ICR0.BIT.BIT2 | USRSTR.ICR0.BIT.BIT4; - USRSTR.ICR0.BIT.BIT6 = USRSTR.ICR0.BIT.BIT1 | USRSTR.ICR0.BIT.BIT3; - - a = USRSTR.ICR0.BIT.BIT0 | USRSTR.ICR0.BIT.BIT1; - a = USRSTR.ICR0.BIT.BIT5 | USRSTR.ICR0.BIT.BIT7; - a = USRSTR.ICR0.BIT.BIT2 | USRSTR.ICR0.BIT.BIT6; - - PORT.BIT.IOR13 = PORT.BIT.IOR0 | USRSTR.ICR0.BIT.BIT7; - PORT.BIT.IOR15 = PORT.BIT.IOR6 | USRSTR.ICR0.BIT.BIT2; - PORT.BIT.IOR3 = PORT.BIT.IOR2 | USRSTR.ICR0.BIT.BIT5; - PORT.BIT.IOR1 = PORT.BIT.IOR13 | USRSTR.ICR0.BIT.BIT1; - - PORT.BIT.IOR1 = PORT.BIT.IOR2 | USRSTR.ICR0.BIT.BIT1; - PORT.BIT.IOR11 = PORT.BIT.IOR9 | USRSTR.ICR0.BIT.BIT2; - PORT.BIT.IOR8 = PORT.BIT.IOR14 | USRSTR.ICR0.BIT.BIT5; - - PORT.BIT.IOR10 |= USRSTR.ICR0.BIT.BIT1; - PORT.BIT.IOR1 |= USRSTR.ICR0.BIT.BIT2; - PORT.BIT.IOR5 |= USRSTR.ICR0.BIT.BIT5; - PORT.BIT.IOR14 |= USRSTR.ICR0.BIT.BIT4; - - /* Instruction generated on using size optimization option "-Os". */ - a = a & USRSTR.ICR0.BIT.BIT1; - a = a & USRSTR.ICR0.BIT.BIT4; - a = a & USRSTR.ICR0.BIT.BIT0; - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bset.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bset.c deleted file mode 100644 index b64852b4c..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bset.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction - 'BSET #imm3,Rn'. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "bset"} } */ - -struct a -{ - char a, b; - short c; -}; - -/* This function generates the instruction "BSET #imm3,Rn" only - on using optimization option "-O1" and above. */ - -int -a2 () -{ - volatile int j; - volatile static struct a x = {1, 66, ~1}, y = {1, 2, ~2}; - - if (j > 1) - return (x.a == y.a && (x.b | 1) == y.b); - if (j > 2) - return (x.a == y.a && (x.b | 2) == y.b); - if (j > 3) - return (x.a == y.a && (x.b | 4) == y.b); - if (j > 4) - return (x.a == y.a && (x.b | 8) == y.b); - if (j > 5) - return (x.a == y.a && (x.b | 16) == y.b); - if (j > 6) - return (x.a == y.a && (x.b | 32) == y.b); - if (j > 7) - return (x.a == y.a && (x.b | 64) == y.b); - if (j > 8) - return (x.a == y.a && (x.b | 128) == y.b); -} - -int -main () -{ - volatile unsigned char x; - - x |= 0x1; - x |= 0x2; - x |= 0x4; - x |= 0x8; - x |= 0x16; - x |= 0x32; - x |= 0x64; - x |= 0x128; - - if (!a2 ()) - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bsetmem.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bsetmem.c deleted file mode 100644 index b0ebf0851..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bsetmem.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction - "BSET #imm3,@(disp12,Rn)". */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O2 -mbitops" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "bset"} } */ -/* { dg-final { scan-assembler "bset.b"} } */ - -volatile union un_paddr -{ - unsigned char BYTE; - struct - { - unsigned char B15:1; - unsigned char B14:1; - unsigned char B13:1; - unsigned char B12:1; - unsigned char B11:1; - unsigned char B10:1; - unsigned char B9:1; - unsigned char B8:1; - unsigned char B7:1; - unsigned char B6:1; - unsigned char B5:1; - unsigned char B4:1; - unsigned char B3:1; - unsigned char B2:1; - unsigned char B1:1; - unsigned char B0:1; - } - BIT; -} -PADDR; - -int -main () -{ - PADDR.BIT.B0 = 1; - PADDR.BIT.B3 = 1; - PADDR.BIT.B6 = 1; - - PADDR.BIT.B1 |= 1; - PADDR.BIT.B4 |= 1; - PADDR.BIT.B7 |= 1; - - PADDR.BIT.B10 = 1; - PADDR.BIT.B13 = 1; - PADDR.BIT.B15 = 1; - - PADDR.BIT.B9 |= 1; - PADDR.BIT.B12 |= 1; - PADDR.BIT.B14 |= 1; - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bxor.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bxor.c deleted file mode 100644 index afe0a5ec9..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-bxor.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction for - "BXOR.B #imm3, @(disp12, Rn)". */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O1 -mbitops" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "bxor.b"} } */ - -volatile struct -{ - union - { - unsigned char BYTE; - struct - { - unsigned char BIT7:1; - unsigned char BIT6:1; - unsigned char BIT5:1; - unsigned char BIT4:1; - unsigned char BIT3:1; - unsigned char BIT2:1; - unsigned char BIT1:1; - unsigned char BIT0:1; - } - BIT; - } - ICR0; -} -USRSTR; - -volatile union t_IOR -{ - unsigned short WORD; - struct - { - unsigned char IOR15:1; - unsigned char IOR14:1; - unsigned char IOR13:1; - unsigned char IOR12:1; - unsigned char IOR11:1; - unsigned char IOR10:1; - unsigned char IOR9:1; - unsigned char IOR8:1; - unsigned char IOR7:1; - unsigned char IOR6:1; - unsigned char IOR5:1; - unsigned char IOR4:1; - unsigned char IOR3:1; - unsigned char IOR2:1; - unsigned char IOR1:1; - unsigned char IOR0:1; - } - BIT; -} -PORT; - -int -main () -{ - volatile unsigned char a; - - /* Instruction generated is BXOR.B #imm3, @(disp12, Rn) */ - USRSTR.ICR0.BIT.BIT3 = USRSTR.ICR0.BIT.BIT4 ^ USRSTR.ICR0.BIT.BIT1; - USRSTR.ICR0.BIT.BIT2 = USRSTR.ICR0.BIT.BIT6 ^ USRSTR.ICR0.BIT.BIT6; - USRSTR.ICR0.BIT.BIT4 = USRSTR.ICR0.BIT.BIT2 ^ USRSTR.ICR0.BIT.BIT4; - USRSTR.ICR0.BIT.BIT6 = USRSTR.ICR0.BIT.BIT1 ^ USRSTR.ICR0.BIT.BIT3; - - a = USRSTR.ICR0.BIT.BIT0 ^ USRSTR.ICR0.BIT.BIT1; - a = USRSTR.ICR0.BIT.BIT5 ^ USRSTR.ICR0.BIT.BIT7; - a = USRSTR.ICR0.BIT.BIT2 ^ USRSTR.ICR0.BIT.BIT6; - - PORT.BIT.IOR13 = PORT.BIT.IOR0 ^ USRSTR.ICR0.BIT.BIT7; - PORT.BIT.IOR15 = PORT.BIT.IOR6 ^ USRSTR.ICR0.BIT.BIT2; - PORT.BIT.IOR3 = PORT.BIT.IOR2 ^ USRSTR.ICR0.BIT.BIT5; - PORT.BIT.IOR1 = PORT.BIT.IOR13 ^ USRSTR.ICR0.BIT.BIT1; - - PORT.BIT.IOR1 = PORT.BIT.IOR2 ^ USRSTR.ICR0.BIT.BIT1; - PORT.BIT.IOR11 = PORT.BIT.IOR9 ^ USRSTR.ICR0.BIT.BIT2; - PORT.BIT.IOR8 = PORT.BIT.IOR14 ^ USRSTR.ICR0.BIT.BIT5; - - PORT.BIT.IOR10 ^= USRSTR.ICR0.BIT.BIT1; - PORT.BIT.IOR1 ^= USRSTR.ICR0.BIT.BIT2; - PORT.BIT.IOR5 ^= USRSTR.ICR0.BIT.BIT5; - PORT.BIT.IOR14 ^= USRSTR.ICR0.BIT.BIT4; - - /* Instruction generated on using size optimization option "-Os". */ - a = a ^ USRSTR.ICR0.BIT.BIT1; - a = a ^ USRSTR.ICR0.BIT.BIT4; - a = a ^ USRSTR.ICR0.BIT.BIT0; - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-jsrn.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-jsrn.c deleted file mode 100644 index 9b9b92cb9..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-jsrn.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction for - 'JSR/N @Rm'. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O0" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "jsr/n"} } */ - -void foo(void) -{ -} - -void bar() -{ - foo(); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-movi20s.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-movi20s.c deleted file mode 100644 index 55d2f665b..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-movi20s.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Testcase to check generation of 'MOVI20S #imm20, Rn'. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O0" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "movi20s"} } */ - -volatile long la; - -void -testfun (void) -{ - la = -134217728; - la = 134217216; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-movrt.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-movrt.c deleted file mode 100644 index 9df9f4ba9..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-movrt.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction for - 'MOVRT Rn'. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O1" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "movrt"} } */ - -int -foo (void) -{ - int a, b, g, stop; - if (stop = ((a + b) % 2 != g)) - ; - return stop; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-resbank.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-resbank.c deleted file mode 100644 index aab6852f3..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-resbank.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Test for resbank attribute. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "resbank" } } */ - -extern void bar(void); - -void foo(void) __attribute__((interrupt_handler, resbank)); -void foo(void) -{ - bar(); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-rtsn.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-rtsn.c deleted file mode 100644 index 2601ced5c..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-rtsn.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Testcase to check generation of a SH2A specific instruction for - 'RTS/N'. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "-O0" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler "rts/n"} } */ - -void -bar (void) -{ -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-tbr-jump.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-tbr-jump.c deleted file mode 100644 index 8029b03dd..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh2a-tbr-jump.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Testcase to check generation of a SH2A specific, - TBR relative jump instruction - 'JSR @@(disp8,TBR)'. */ -/* { dg-do assemble {target sh*-*-*}} */ -/* { dg-options "" } */ -/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" } */ -/* { dg-final { scan-assembler-times "jsr/n\\t@@\\(40,tbr\\)" 1} } */ -/* { dg-final { scan-assembler-times "jsr/n\\t@@\\(72,tbr\\)" 1} } */ - -extern void foo1 (void) __attribute__ ((function_vector(10))); -extern void foo2 (void); -extern int bar1 (void) __attribute__ ((function_vector(18))); -extern int bar2 (void); - -int -bar() -{ - foo1(); - foo2(); - - bar1(); - bar2(); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c deleted file mode 100644 index 7912fbc55..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Verify that we generate movua to load unaligned 32-bit values on SH4A. */ -/* { dg-do run { target "sh*-*-*" } } */ -/* { dg-options "-O1 -save-temps -fno-inline" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a*" } } */ -/* { dg-final { scan-assembler-times "movua.l" 6 } } */ - -/* Aligned. */ -struct s0 { long long d : 32; } x0; -long long f0() { - return x0.d; -} - -/* Unaligned load. */ -struct s1 { long long c : 8; long long d : 32; } x1; -long long f1() { - return x1.d; -} - -/* Unaligned load. */ -struct s2 { long long c : 16; long long d : 32; } x2; -long long f2() { - return x2.d; -} - -/* Unaligned load. */ -struct s3 { long long c : 24; long long d : 32; } x3; -long long f3() { - return x3.d; -} - -/* Aligned. */ -struct s4 { long long c : 32; long long d : 32; } x4; -long long f4() { - return x4.d; -} - -/* Aligned. */ -struct u0 { unsigned long long d : 32; } y_0; -unsigned long long g0() { - return y_0.d; -} - -/* Unaligned load. */ -struct u1 { long long c : 8; unsigned long long d : 32; } y_1; -unsigned long long g1() { - return y_1.d; -} - -/* Unaligned load. */ -struct u2 { long long c : 16; unsigned long long d : 32; } y2; -unsigned long long g2() { - return y2.d; -} - -/* Unaligned load. */ -struct u3 { long long c : 24; unsigned long long d : 32; } y3; -unsigned long long g3() { - return y3.d; -} - -/* Aligned. */ -struct u4 { long long c : 32; unsigned long long d : 32; } y4; -unsigned long long g4() { - return y4.d; -} - -#include <assert.h> - -int -main (void) -{ - x1.d = 0x12345678; - assert (f1 () == 0x12345678); - - x2.d = 0x12345678; - assert (f2 () == 0x12345678); - - x3.d = 0x12345678; - assert (f3 () == 0x12345678); - - y_1.d = 0x12345678; - assert (g1 () == 0x12345678); - - y2.d = 0x12345678; - assert (g2 () == 0x12345678); - - y3.d = 0x12345678; - assert (g3 () == 0x12345678); - - return 0; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-cosf.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-cosf.c deleted file mode 100644 index 68bb20f2c..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-cosf.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Verify that we generate single-precision sine and cosine approximate - (fsca) in fast math mode on SH4A with FPU. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O -ffast-math" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */ -/* { dg-final { scan-assembler "fsca" } } */ - -#include <math.h> - -float test(float f) { return cosf(f); } - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-fprun.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-fprun.c deleted file mode 100644 index e5fbc4aca..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-fprun.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Verify that fsca and fssra yield reasonable results. */ -/* This test calls the sinf and cosf library functions for targets other - than sh4a, but the VxWorks kernel doesn't have those functions. */ -/* { dg-do run { target { "sh*-*-*" && { ! vxworks_kernel } } } } */ -/* { dg-options "-O -ffast-math" } */ - -#include <math.h> -#include <stdlib.h> - -float sqrt_arg = 4.0f, sqrt_res = 2.0f; -float dg2rad_f; -double dg2rad_d; - -float __attribute__ ((noinline)) -test_sinf (float x) -{ - return sinf (x); -} - -float __attribute ((noinline)) -test_cosf (float x) -{ - return cosf (x); -} - -void -check_f (float res, float expected) -{ - if (res >= expected - 0.001f && res <= expected + 0.001f) - return; - - abort (); -} - -void -check_d (double res, double expected) -{ - if (res >= expected - 0.001 && res <= expected + 0.001) - return; - - abort (); -} - -int -main() -{ - check_f (sqrtf(sqrt_arg), sqrt_res); - dg2rad_f = dg2rad_d = atan(1) / 45; - check_f (test_sinf(90*dg2rad_f), 1); - check_f (test_cosf(90*dg2rad_f), 0); - check_d (sin(-90*dg2rad_d), -1); - check_d (cos(180*dg2rad_d), -1); - check_d (sin(-45*dg2rad_d) * cosf(135*dg2rad_f), 0.5); - exit (0); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-fsrra.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-fsrra.c deleted file mode 100644 index 4ce2e28e2..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-fsrra.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Verify that we generate single-precision square root reciprocal - approximate (fsrra) in fast math mode on SH4A with FPU. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O -ffast-math" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */ -/* { dg-final { scan-assembler "fsrra" } } */ - -#include <math.h> - -float test(float f) { return 1 / sqrtf(f); } - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c deleted file mode 100644 index 7e817c4c1..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-memmovua.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Verify that we generate movua to copy unaligned memory regions to - 32-bit-aligned addresses on SH4A. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" "-m4a-nofpu" } } */ -/* { dg-final { scan-assembler-times "movua.l" 2 } } */ - -#include <string.h> - -struct s { int i; char a[10], b[10]; } x; -int f() { - memcpy(x.a, x.b, 10); -} - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-sincosf.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-sincosf.c deleted file mode 100644 index 0ca33e30a..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-sincosf.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Verify that we generate a single single-precision sine and cosine - approximate (fsca) in fast math mode when a function computes both - sine and cosine. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O -ffast-math" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */ -/* { dg-final { scan-assembler-times "fsca" 1 } } */ - -#include <math.h> - -float test(float f) { return sinf(f) + cosf(f); } - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-sinf.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-sinf.c deleted file mode 100644 index 4d9abea04..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sh4a-sinf.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Verify that we generate single-precision sine and cosine approximate - (fsca) in fast math mode on SH4A with FPU. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-O -ffast-math" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */ -/* { dg-final { scan-assembler "fsca" } } */ - -#include <math.h> - -float test(float f) { return sinf(f); } - diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sp-switch.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sp-switch.c deleted file mode 100644 index 1bfe6a7de..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/sp-switch.c +++ /dev/null @@ -1,10 +0,0 @@ -/* { dg-do compile { target "sh-*-*" } } */ -/* { dg-final { scan-assembler "mov\tr0,r15" } } */ -/* { dg-final { scan-assembler ".long\t_alt_stack" } } */ - -void *alt_stack; -void f() __attribute__ ((interrupt_handler, sp_switch ("alt_stack"))); - -void f() -{ -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/struct-arg-dw2.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/struct-arg-dw2.c deleted file mode 100644 index 81f80df1e..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/struct-arg-dw2.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Verify that we don't generate frame related insn against stack adjustment - for the object sent partially in registers. */ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-options "-g" } */ -/* { dg-final { scan-assembler-not "\t.cfi_def_cfa_offset 16" } } */ - -typedef struct -{ - unsigned short A1; - unsigned short A2; -} A_t; - -typedef struct -{ - A_t C13[10]; -} C_t; - -void -Store (C_t Par) -{ - unsigned char *ptr; - unsigned int test; - - ptr = (unsigned char*) 0x12345678; - ptr++; -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/torture/pr34777.c b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/torture/pr34777.c deleted file mode 100644 index b2ec56adf..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/torture/pr34777.c +++ /dev/null @@ -1,30 +0,0 @@ -/* { dg-do compile { target "sh*-*-*" } } */ -/* { dg-additional-options "-fschedule-insns -fPIC -mprefergot" } */ -/* { dg-skip-if "" { "sh*-*-*" } { "-m5*" } { "" } } */ - -static __inline __attribute__ ((__always_inline__)) void * -_dl_mmap (void * start, int length, int prot, int flags, int fd, - int offset) -{ - register long __sc3 __asm__ ("r3") = 90; - register long __sc4 __asm__ ("r4") = (long) start; - register long __sc5 __asm__ ("r5") = (long) length; - register long __sc6 __asm__ ("r6") = (long) prot; - register long __sc7 __asm__ ("r7") = (long) flags; - register long __sc0 __asm__ ("r0") = (long) fd; - register long __sc1 __asm__ ("r1") = (long) offset; - __asm__ __volatile__ ("trapa %1" - : "=z" (__sc0) - : "i" (0x10 + 6), "0" (__sc0), "r" (__sc4), - "r" (__sc5), "r" (__sc6), "r" (__sc7), - "r" (__sc3), "r" (__sc1) - : "memory" ); -} - -extern int _dl_pagesize; -void -_dl_dprintf(int fd, const char *fmt, ...) -{ - static char *buf; - buf = _dl_mmap ((void *) 0, _dl_pagesize, 0x1 | 0x2, 0x02 | 0x20, -1, 0); -} diff --git a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/torture/sh-torture.exp b/gcc-4.8.1/gcc/testsuite/gcc.target/sh/torture/sh-torture.exp deleted file mode 100644 index 6e3d0981f..000000000 --- a/gcc-4.8.1/gcc/testsuite/gcc.target/sh/torture/sh-torture.exp +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2012-2013 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 SH target. -if { ![istarget sh*-*-*] } 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 - -# Main loop. -gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] $DEFAULT_CFLAGS - -# All done. -dg-finish |