diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-02-04 19:14:14 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-02-04 19:14:14 +0000 |
commit | 25b9b003178002360d666919f2e49e7f5f4a36e2 (patch) | |
tree | d5f7fb317f34f3a7ac9383c21b0eb143317c30f8 /test | |
parent | 145b32ec504541e98f73b2c87ff2d8181b5e7968 (diff) |
Merge of the "volatile" branch:
- native treatment of volatile accesses in CompCert C's semantics
- translation of volatile accesses to built-ins in SimplExpr
- native treatment of struct assignment and passing struct parameter by value
- only passing struct result by value remains emulated
- in cparser, remove emulations that are no longer used
- added C99's type _Bool and used it to express || and && more efficiently.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1814 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test')
-rw-r--r-- | test/raytracer/Makefile | 2 | ||||
-rw-r--r-- | test/regression/Makefile | 2 | ||||
-rw-r--r-- | test/regression/Results/bool | 9 | ||||
-rw-r--r-- | test/regression/bool.c | 29 | ||||
-rw-r--r-- | test/spass/Makefile | 2 |
5 files changed, 41 insertions, 3 deletions
diff --git a/test/raytracer/Makefile b/test/raytracer/Makefile index db359b1..a4b8894 100644 --- a/test/raytracer/Makefile +++ b/test/raytracer/Makefile @@ -1,7 +1,7 @@ include ../../Makefile.config CC=../../ccomp -CFLAGS=-stdlib ../../runtime -dparse -dclight -dasm -fstruct-passing -fstruct-assign +CFLAGS=-stdlib ../../runtime -dparse -dclight -dasm -fstruct-return LIBS=$(LIBMATH) TIME=xtime -mintime 2.0 diff --git a/test/regression/Makefile b/test/regression/Makefile index f3dcf4d..e9d0318 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -12,7 +12,7 @@ TESTS=attribs1 bitfields1 bitfields2 bitfields3 bitfields4 \ expr1 expr6 initializers volatile1 volatile2 volatile3 \ funct3 expr5 struct7 struct8 struct11 casts1 casts2 char1 \ sizeof1 sizeof2 packedstruct1 packedstruct2 \ - instrsel + instrsel bool # Other tests: should compile to .s without errors (but expect warnings) EXTRAS=annot1 commaprec expr2 expr3 expr4 extern1 funct2 funptr1 init1 \ diff --git a/test/regression/Results/bool b/test/regression/Results/bool new file mode 100644 index 0000000..923c6e2 --- /dev/null +++ b/test/regression/Results/bool @@ -0,0 +1,9 @@ +a = 1 +b = 0 +c = 1 +d = 0 +e = 1 +f = 0 +g = 1 +h = 1 +i = 0 diff --git a/test/regression/bool.c b/test/regression/bool.c new file mode 100644 index 0000000..d2b3857 --- /dev/null +++ b/test/regression/bool.c @@ -0,0 +1,29 @@ +/* Testing _Bool type support */ + +#include <stdio.h> + +int x = 42; + +int main() +{ + _Bool a, b, c, d, e, f, g, h, i; + a = x; + b = x >= 100; + c = &x; + d = a && b; + e = a || b; + f = a & b; + g = a | b; + h = 3.14; + i = 0.0; + printf("a = %d\n", a); + printf("b = %d\n", b); + printf("c = %d\n", c); + printf("d = %d\n", d); + printf("e = %d\n", e); + printf("f = %d\n", f); + printf("g = %d\n", g); + printf("h = %d\n", h); + printf("i = %d\n", i); + return 0; +} diff --git a/test/spass/Makefile b/test/spass/Makefile index 536488b..6797475 100644 --- a/test/spass/Makefile +++ b/test/spass/Makefile @@ -1,7 +1,7 @@ include ../../Makefile.config CC=../../ccomp -CFLAGS=-stdlib ../../runtime -dparse -dclight -dasm -fstruct-passing -fstruct-assign +CFLAGS=-stdlib ../../runtime -dparse -dclight -dasm -fstruct-return SRCS=analyze.c clause.c clock.c closure.c cnf.c component.c \ condensing.c context.c defs.c dfgparser.c dfgscanner.c doc-proof.c \ |