From 1fa163c79f8addbf1626d3247eef1d8828ee542b Mon Sep 17 00:00:00 2001 From: "benjamin.franksen" <benjamin.franksen@helmholtz-berlin.de> Date: Mon, 7 Oct 2013 23:01:23 +0000 Subject: [PATCH] test: added type_expr.st This compiler test adds a lot of complicated declarations and type expressions. --- test/compiler/Makefile | 1 + test/compiler/snc_test.plt | 1 + test/compiler/type_expr.st | 64 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 test/compiler/type_expr.st diff --git a/test/compiler/Makefile b/test/compiler/Makefile index a09e4d88..40f38f85 100644 --- a/test/compiler/Makefile +++ b/test/compiler/Makefile @@ -20,6 +20,7 @@ TESTSCRIPTS_HOST += snc_test.t #TESTSCRIPTS_HOST += build64_test.t #TESTSCRIPTS_CROSS += build64_test.t +TESTPROD_HOST += type_expr TESTPROD_HOST += funcdef PROD_LIBS += seq pv diff --git a/test/compiler/snc_test.plt b/test/compiler/snc_test.plt index b148d052..7335cc01 100644 --- a/test/compiler/snc_test.plt +++ b/test/compiler/snc_test.plt @@ -14,6 +14,7 @@ my $success = { subscript => 0, sync_not_monitored => 0, syncq_not_monitored => 0, + type_expr => 0, }; my $warning = { diff --git a/test/compiler/type_expr.st b/test/compiler/type_expr.st new file mode 100644 index 00000000..fa2415b0 --- /dev/null +++ b/test/compiler/type_expr.st @@ -0,0 +1,64 @@ +/*************************************************************************\ +Copyright (c) 2013 Helmholtz-Zentrum Berlin f. Materialien + und Energie GmbH, Germany (HZB) +This file is distributed subject to a Software License Agreement found +in the file LICENSE that is included with this distribution. +\*************************************************************************/ +program type_exprTest + +option +r; + +#if 0 + void f( + void *p, + void **pp, + void (*pf1)(void), + void (*pf2)(int x,int), + void (*pf3)(int*), + void (*pf4)(int**), + void (*pf5)(double**,int), + void (*pf6)(double**,int(**)[2]), + double **pd, + double **ppd + ); +#endif + +entry { + long n = 0; + void *p = (void *)n; + void **pp = (void**)n; + void (*pf1)(void) = (void (*)(void))n; + void (*pf2)(int x,int) = (void (*)(int,int))n; + void (*pf3)(int*) = (void (*)(int*))n; + void (*pf4)(int**) = (void (*)(int**))n; + void (*pf5)(double**,int) = (void (*)(double**,int))n; + void (*pf6)(double**,int(**)[2]) = (void (*)(double**,int(**)[2]))n; + double **pd = (double**)(int*)n; + double **ppd = (double**)(int(*)[3])n; + void (*lf)( + void *p, + void **pp, + void (*pf1)(void), + void (*pf2)(int x,int), + void (*pf3)(int*), + void (*pf4)(int**), + void (*pf5)(double**,int), + void (*pf6)(double**,int(**)[2]), + double **pd, + double **ppd + ) = (void (*)( + void *p, + void **pp, + void (*pf1)(void), + void (*pf2)(int x,int), + void (*pf3)(int*), + void (*pf4)(int**), + void (*pf5)(double**,int), + void (*pf6)(double**,int(**)[2]), + double **pd, + double **ppd + ))n; + lf(p,pp,pf1,pf2,pf3,pf4,pf5,pf6,pd,ppd); +} + +#include "../simple.st" -- GitLab