Skip to content

Commit 5aafcd2

Browse files
author
grischka
committed
tcctest: restore & combine
Revert 199369b - generating test.ref with tcc makes little sense. - combine riscv_asm & conversion tests into only two files. (too many files are bad ...)
1 parent 6daf161 commit 5aafcd2

28 files changed

Lines changed: 510 additions & 570 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ FORCE:
336336
# some versions of gnu-make do not recognize 'command' as a shell builtin
337337
WHICH = sh -c 'command -v $1'
338338

339-
run-if = $(if $(shell $(call WHICH,$1)),$S $1 $2,@echo "(skipping $@ - no $1)")
339+
run-if = $(if $(shell $(call WHICH,$1x)),$S $1 $2,@true||echo "(skipping $@ - no $1)")
340340
S = $(if $(findstring yes,$(SILENT)),@$(info * $@))
341341

342342
# --------------------------------------------------------------------------

tccelf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ ST_FUNC void tccelf_new(TCCState *s)
114114
#ifndef ELF_OBJ_ONLY
115115
if (NULL == s->elfint && s1->output_type != TCC_OUTPUT_OBJ) {
116116
const char *p = CONFIG_TCC_ELFINTERP;
117-
#ifdef TCC_TARGET_ARM
117+
#if defined TCC_TARGET_ARM && defined CONFIG_TCC_ELFINTERP_ARMHF
118118
if (s->float_abi == ARM_HARD_FLOAT)
119119
p = CONFIG_TCC_ELFINTERP_ARMHF;
120120
#endif

tests/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ libtcc_test_mt$(EXESUF): libtcc_test_mt.c
110110

111111
# test.ref - generate using cc
112112
test.ref: tcctest.c
113-
$(TCC) $(TCCFLAGS) -w -o tcctest.tcc$(EXESUF) $<
114-
./tcctest.tcc$(EXESUF) > $@
113+
$(CC) -o tcctest.gcc$(EXESUF) $< $(CFLAGS) -w -O0 -std=gnu99 -fno-omit-frame-pointer
114+
./tcctest.gcc$(EXESUF) > $@
115115

116116
# auto test
117117
test1 test1b: tcctest.c test.ref

tests/tcctest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ void char_short_test()
11751175
var4 = 0x11223344aa998877ULL;
11761176
printf("promote char/short assign VA %d %d\n", var3 = var1 + 1, var3 = var4 + 1);
11771177
printf("promote char/short cast VA %d %d\n", (signed char)(var1 + 1), (signed char)(var4 + 1));
1178-
#if !defined(__arm__)
1178+
#if !defined __arm__ && !defined __riscv
11791179
/* We can't really express GCC behaviour of return type promotion in
11801180
the presence of undefined behaviour (like __csf is). */
11811181
var1 = csf(unsigned char,0x89898989);

tests/tests2/138_narrow_return_promotion.c

Lines changed: 0 additions & 52 deletions
This file was deleted.

tests/tests2/138_narrow_return_promotion.expect

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/tests2/139_narrow_type_conversion.c

Lines changed: 0 additions & 42 deletions
This file was deleted.

tests/tests2/139_narrow_type_conversion.expect

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/tests2/140_int_sign_extension.c

Lines changed: 0 additions & 43 deletions
This file was deleted.

tests/tests2/140_int_sign_extension.expect

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)