diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-02-07 13:38:31 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-02-07 13:38:31 +0000 |
commit | 2594c23c95d22f838952b0b335231ba81a657b0d (patch) | |
tree | 5e964de0b29e7f2906c453aa4690a01086c08a3f /test | |
parent | 25b9b003178002360d666919f2e49e7f5f4a36e2 (diff) | |
download | compcert-kvx-2594c23c95d22f838952b0b335231ba81a657b0d.tar.gz compcert-kvx-2594c23c95d22f838952b0b335231ba81a657b0d.zip |
Initializers: handle By_copy accesses (e.g. for &(glob.field))
C2C: insert the correct Evalof for structs; clean up unused memcpy stuff
test/regression: run with interpreter
test/regression: add test cas &(glob.field) to initializers.c
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1815 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test')
-rw-r--r-- | test/c/sha1.c | 2 | ||||
-rw-r--r-- | test/regression/Makefile | 12 | ||||
-rw-r--r-- | test/regression/Results/initializers | 1 | ||||
-rw-r--r-- | test/regression/initializers.c | 6 |
4 files changed, 21 insertions, 0 deletions
diff --git a/test/c/sha1.c b/test/c/sha1.c index 7ea413a7..84d0072c 100644 --- a/test/c/sha1.c +++ b/test/c/sha1.c @@ -210,7 +210,9 @@ static void do_bench(int nblocks) struct SHA1Context ctx; unsigned char output[20]; unsigned char data[64]; + int i; + for (i = 0; i < 64; i++) data[i] = i; SHA1_init(&ctx); for (; nblocks > 0; nblocks--) SHA1_add_data(&ctx, data, 64); diff --git a/test/regression/Makefile b/test/regression/Makefile index e9d0318e..186bddd8 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -44,4 +44,16 @@ test: fi; \ done +interp: + @for i in $(TESTS); do \ + if $(CCOMP) -fall -interp 2>/dev/null $$i.c > _cinterp.log; then \ + if cmp -s _cinterp.log Results/$$i; \ + then echo "$$i: interpreter passed"; \ + else echo "$$i: interpreter FAILED"; \ + fi; \ + else \ + echo "$$i: interpreter undefined behavior"; \ + fi; \ + done + bench: diff --git a/test/regression/Results/initializers b/test/regression/Results/initializers index 67460cc4..d3fc91a5 100644 --- a/test/regression/Results/initializers +++ b/test/regression/Results/initializers @@ -19,3 +19,4 @@ x18 = "Hello!" x19 = { "Hello", "world!" } x20 = { 'H', 'e', 'l', } x21 = { 'H', 'e', 'l', 'l', 'o', '!', 0, 0, 0, 0, } +x22 ok diff --git a/test/regression/initializers.c b/test/regression/initializers.c index a0913fda..f831c672 100644 --- a/test/regression/initializers.c +++ b/test/regression/initializers.c @@ -50,6 +50,8 @@ char x20[3] = "Hello!"; char x21[10] = "Hello!"; +char * x22 = &(x10.u.y); + static void print_chars(char * s, int sz) { int i; @@ -106,6 +108,10 @@ int main() printf("x21 = { "); print_chars(x21, sizeof(x21)); printf("}\n"); + if (x22 == &(x10.u.y)) + printf("x22 ok\n"); + else + printf("x22 error\n"); return 0; } |