Skip to content

Commit e2c534c

Browse files
authored
Merge pull request #192 from goblint/test-gnu11
Use `gnu11` standard for most tests
2 parents d5490ca + e7a49b2 commit e2c534c

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

test/Makefile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ endif
130130
# Disable GCC 14 new warnings as errors because some tests contain them
131131
CFLAGS += -Wno-error=implicit-int -Wno-error=implicit-function-declaration -Wno-error=int-conversion -Wno-error=incompatible-pointer-types
132132

133+
# TODO: Force gnu11 because we're not ready for c23 yet
134+
CFLAGS += -std=gnu11
135+
133136
# sm: this will make gcc warnings into errors; it's almost never
134137
# what we want, but for a particular testcase (combine_copyptrs)
135138
# I need it to show the difference between something which works
@@ -176,7 +179,7 @@ SMALL1 := $(TESTDIR)/small1
176179

177180
test/% : $(SMALL1)/%.c
178181
cd $(SMALL1); $(CILLY) --nomerge --commPrintLn \
179-
$(CONLY) -std=gnu90 $(CFLAGS) $(ASMONLY)$*.s $*.c
182+
$(CONLY) $(CFLAGS) -std=gnu90 $(ASMONLY)$*.s $*.c
180183
echo SUCCESS
181184

182185
testobj/% : $(SMALL1)/%.c
@@ -383,22 +386,22 @@ MYSAFECC := $(CILLY)
383386
comb: $(TESTDIR)/small2/comb1.c $(TESTDIR)/small2/comb2.c
384387
rm -f $(TESTDIR)/small2/comb.exe
385388
cd $(TESTDIR)/small2; \
386-
$(MYSAFECC) -fcommon comb1.c $(CONLY) $(OBJOUT) comb1.o; \
387-
$(MYSAFECC) -fcommon comb2.c $(CONLY) $(OBJOUT) comb2.o; \
388-
$(MYSAFECC) -fcommon comb3.c $(CONLY) $(OBJOUT) comb3.o; \
389-
$(MYSAFECC) -fcommon comb4.c $(CONLY) $(OBJOUT) comb4.o; \
390-
$(MYSAFECC) -fcommon comb1.o comb2.o comb3.o comb4.o $(EXEOUT)comb.exe
389+
$(MYSAFECC) -std=gnu11 -fcommon comb1.c $(CONLY) $(OBJOUT) comb1.o; \
390+
$(MYSAFECC) -std=gnu11 -fcommon comb2.c $(CONLY) $(OBJOUT) comb2.o; \
391+
$(MYSAFECC) -std=gnu11 -fcommon comb3.c $(CONLY) $(OBJOUT) comb3.o; \
392+
$(MYSAFECC) -std=gnu11 -fcommon comb4.c $(CONLY) $(OBJOUT) comb4.o; \
393+
$(MYSAFECC) -std=gnu11 -fcommon comb1.o comb2.o comb3.o comb4.o $(EXEOUT)comb.exe
391394
$(TESTDIR)/small2/comb.exe
392395

393396
#call cilly on a .c file, a .i file, a .s file, and a .o file.
394397
#Of course, only the first two are merged.
395398
mixedcomb: $(TESTDIR)/small2/comb1.c $(TESTDIR)/small2/comb2.c
396399
rm -f $(TESTDIR)/small2/comb.exe
397400
cd $(TESTDIR)/small2; \
398-
gcc -fcommon -E -o comb2.i comb2.c; \
399-
gcc -fcommon -S -o comb3.s comb3.c; \
400-
gcc -fcommon -c -o comb4.o comb4.c; \
401-
$(MYSAFECC) -fcommon comb1.c comb2.i comb3.s comb4.o $(EXEOUT)comb.exe
401+
gcc -std=gnu11 -fcommon -E -o comb2.i comb2.c; \
402+
gcc -std=gnu11 -fcommon -S -o comb3.s comb3.c; \
403+
gcc -std=gnu11 -fcommon -c -o comb4.o comb4.c; \
404+
$(MYSAFECC) -std=gnu11 -fcommon comb1.c comb2.i comb3.s comb4.o $(EXEOUT)comb.exe
402405
$(TESTDIR)/small2/comb.exe
403406

404407
# sm: another merger test

0 commit comments

Comments
 (0)