From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.target/frv/fr405-builtins-2.c | 69 +++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 gcc/testsuite/gcc.target/frv/fr405-builtins-2.c (limited to 'gcc/testsuite/gcc.target/frv/fr405-builtins-2.c') diff --git a/gcc/testsuite/gcc.target/frv/fr405-builtins-2.c b/gcc/testsuite/gcc.target/frv/fr405-builtins-2.c new file mode 100644 index 000000000..778547c4d --- /dev/null +++ b/gcc/testsuite/gcc.target/frv/fr405-builtins-2.c @@ -0,0 +1,69 @@ +/* Test the SCUTSS instruction. */ +/* { dg-options "-mcpu=fr405" } */ +/* { dg-do run } */ +extern void abort (void); +extern void exit (int); + +int main () +{ + struct { + long long value; + int cut_point; + int result; + } values[] = { + /* Non-saturating values */ + + { +0x0000000000001234LL, 44, +0x01234000 }, + { ~0x0000000000001234LL, 44, ~0x01234fff }, + + { +0x0000011223300fffLL, 20, +0x11223301 }, + { ~0x0000011223300fffLL, 20, ~0x11223300 }, + { +0x0000011223300800LL, 20, +0x11223301 }, + { ~0x0000011223300800LL, 20, ~0x11223300 }, + { +0x00000112233007ffLL, 20, +0x11223300 }, + { ~0x00000112233007ffLL, 20, ~0x112232ff }, + { +0x0000011223300000LL, 20, +0x11223300 }, + { ~0x0000011223300000LL, 20, ~0x112232ff }, + + { +0x1234567fffffffffLL, -4, +0x01234568 }, + { ~0x1234567fffffffffLL, -4, ~0x01234567 }, + { +0x1234567800000000LL, -4, +0x01234568 }, + { ~0x1234567800000000LL, -4, ~0x01234567 }, + { +0x12345677ffffffffLL, -4, +0x01234567 }, + { ~0x12345677ffffffffLL, -4, ~0x01234566 }, + { +0x1234567000000000LL, -4, +0x01234567 }, + { ~0x1234567000000000LL, -4, ~0x01234566 }, + + /* Saturation tests */ + + { +0x4000000000000000LL, 44, +0x7fffffff }, + { ~0x4000000000000000LL, 44, ~0x7fffffff }, + { +0x0000000000080000LL, 44, +0x7fffffff }, + { ~0x0000000000080000LL, 44, ~0x7fffffff }, + { +0x000000000007ffffLL, 44, +0x7ffff000 }, + { ~0x000000000007ffffLL, 44, ~0x7fffffff }, + { +0x000000000007fffeLL, 44, +0x7fffe000 }, + { ~0x000000000007fffeLL, 44, ~0x7fffefff }, + + { +0x4000000000000000LL, 20, +0x7fffffff }, + { ~0x4000000000000000LL, 20, ~0x7fffffff }, + { +0x0000080000000000LL, 20, +0x7fffffff }, + { ~0x0000080000000000LL, 20, ~0x7fffffff }, + { +0x000007ffffffffffLL, 20, +0x7fffffff }, + { ~0x000007ffffffffffLL, 20, ~0x7fffffff }, + { +0x000007fffffff000LL, 20, +0x7fffffff }, + { ~0x000007fffffff000LL, 20, ~0x7ffffffe }, + { +0x000007ffffffe000LL, 20, +0x7ffffffe }, + { ~0x000007ffffffefffLL, 20, ~0x7ffffffe } + }; + + unsigned int i; + + for (i = 0; i < sizeof (values) / sizeof (values[0]); i++) + { + __IACCsetll (0, values[i].value); + if (__SCUTSS (values[i].cut_point) != values[i].result) + abort (); + } + exit (0); +} -- cgit v1.2.3