summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/frv/fr550-builtins-4.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.target/frv/fr550-builtins-4.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'gcc/testsuite/gcc.target/frv/fr550-builtins-4.c')
-rw-r--r--gcc/testsuite/gcc.target/frv/fr550-builtins-4.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/frv/fr550-builtins-4.c b/gcc/testsuite/gcc.target/frv/fr550-builtins-4.c
new file mode 100644
index 000000000..801dfee20
--- /dev/null
+++ b/gcc/testsuite/gcc.target/frv/fr550-builtins-4.c
@@ -0,0 +1,48 @@
+/* Test the __M{,D}{ADD,SUB}ACC functions. */
+/* { dg-do run } */
+extern void abort (void);
+extern void exit (int);
+
+int
+main ()
+{
+ __MWTACC (6, 10);
+ __MWTACC (7, 25);
+ __MADDACCS (5, 6);
+ if (__MRDACC (5) != 35)
+ abort ();
+ __MSUBACCS (4, 6);
+ if (__MRDACC (4) != -15)
+ abort ();
+ __MASACCS (4, 6);
+ if (__MRDACC (4) != 35 || __MRDACC (5) != -15)
+ abort ();
+
+ __MWTACC (0, 100);
+ __MWTACC (1, 150);
+ __MWTACC (2, 1000);
+ __MWTACC (3, 1500);
+ __MDADDACCS (2, 0);
+ if (__MRDACC (2) != 250 || __MRDACC (3) != 2500)
+ abort ();
+
+ __MWTACC (0, 100);
+ __MWTACC (1, 150);
+ __MWTACC (2, 1000);
+ __MWTACC (3, 1500);
+ __MDSUBACCS (2, 0);
+ if (__MRDACC (2) != -50 || __MRDACC (3) != -500)
+ abort ();
+
+ __MWTACC (0, 100);
+ __MWTACC (1, 150);
+ __MWTACC (2, 1000);
+ __MWTACC (3, 1500);
+ __MDASACCS (0, 0);
+ if (__MRDACC (0) != 250 || __MRDACC (1) != -50)
+ abort ();
+ if (__MRDACC (2) != 2500 || __MRDACC (3) != -500)
+ abort ();
+
+ exit (0);
+}