aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-01-29 18:46:23 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-01-29 18:46:23 +0100
commit6ff3de985a79fcb38ba57a9e8e08f7ef690d85f4 (patch)
tree0398e641dddc55c64f0f7c7c9e9aa8da353855ef /test
parent734a3fee9a6bc591533ccab8c72c6cd8f72ee817 (diff)
parent0a693ac9dd3b181ba42566996531438ef205815c (diff)
downloadcompcert-kvx-6ff3de985a79fcb38ba57a9e8e08f7ef690d85f4.tar.gz
compcert-kvx-6ff3de985a79fcb38ba57a9e8e08f7ef690d85f4.zip
Merge branch 'mppa_postpass' of gricad-gitlab.univ-grenoble-alpes.fr:sixcy/CompCert into mppa_postpass
Diffstat (limited to 'test')
-rw-r--r--test/mppa/instr/indirect_call.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/mppa/instr/indirect_call.c b/test/mppa/instr/indirect_call.c
new file mode 100644
index 00000000..3a45ce52
--- /dev/null
+++ b/test/mppa/instr/indirect_call.c
@@ -0,0 +1,33 @@
+#include "framework.h"
+
+long long sum(long long a, long long b){
+ return a+b;
+}
+
+long long diff(long long a, long long b){
+ return a-b;
+}
+
+long long mul(long long a, long long b){
+ return a*b;
+}
+
+long long make(long long a){
+ return a;
+}
+
+BEGIN_TEST(long long)
+{
+ long long d = 3;
+ long long (*op)(long long, long long);
+
+ if (a % d == 0)
+ op = sum;
+ else if (a % d == 1)
+ op = diff;
+ else
+ op = mul;
+
+ c += op(make(a), make(b));
+}
+END_TEST()