From b9a6a50546222269bb9445d0d21d948028b2720a Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Mon, 20 Aug 2018 11:02:13 +0200 Subject: 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.) --- test/regression/Makefile | 4 +++- test/regression/extasm.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'test/regression') 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 -- cgit