diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2018-08-20 11:02:13 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2018-08-20 11:04:17 +0200 |
commit | b9a6a50546222269bb9445d0d21d948028b2720a (patch) | |
tree | 10c9e6d41ae2baf91b80841cc161ec884aea9f8e | |
parent | e9b5632617b1477603883aab543994e2a1c464ce (diff) | |
download | compcert-b9a6a50546222269bb9445d0d21d948028b2720a.tar.gz compcert-b9a6a50546222269bb9445d0d21d948028b2720a.zip |
Harden the extasm.c test
Pass more info from CompCert's configuration as #define on command line.
Use this info to improve the "64 bit" detection in extasm.c.
(Before it fails with powerpc-ppc64, which has 64-bit int regs but
couldn't be detected with #ifdefs.)
-rw-r--r-- | test/regression/Makefile | 4 | ||||
-rw-r--r-- | test/regression/extasm.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile index 48e2b7b3..5d9dda14 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -1,7 +1,9 @@ include ../../Makefile.config CCOMP=../../ccomp -CCOMPFLAGS=$(CCOMPOPTS) -stdlib ../../runtime -dparse -dc -dclight -dasm -fall +CCOMPFLAGS=$(CCOMPOPTS) -stdlib ../../runtime \ + -dparse -dc -dclight -dasm -fall \ + -DCOMPCERT_ARCH=$(ARCH) -DCOMPCERT_MODEL=$(MODEL) INTERPFLAGS=-stdlib ../../runtime -interp -quiet -fall LIBS=$(LIBMATH) diff --git a/test/regression/extasm.c b/test/regression/extasm.c index a41c4202..03b03157 100644 --- a/test/regression/extasm.c +++ b/test/regression/extasm.c @@ -18,7 +18,10 @@ int clobbers(int x, int z) return y + z; } -#if defined(__x86_64__) || __riscv_xlen == 64 +#if (COMPCERT_ARCH==x86 && COMPCERT_MODEL==64) \ + || (COMPCERT_ARCH==riscV && COMPCERT_MODEL==64) \ + || (COMPCERT_ARCH==powerpc && COMPCERT_MODEL==ppc64) \ + || (COMPCERT_ARCH==powerpc && COMPCERT_MODEL==e5500) #define SIXTYFOUR #else #undef SIXTYFOUR |