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/extasm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/regression/extasm.c') 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