summaryrefslogtreecommitdiff
path: root/regress/gnu/egcs/gcc-bounds/Makefile
blob: 1302bca8ae14dd2b193f528329f248e8a016f8d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# $OpenBSD: Makefile,v 1.10 2006/07/11 11:59:53 avsm Exp $

C_MODULES?=	strlcpy strlcat getcwd memcpy fread memcpy declare \
		sscanf vararray md builtins
CPP_MODULES?=	snprintf sscanf

C_STRLCPY=	1 2 3 4 5 6
C_STRLCAT=	1 2 3 4 5 6
C_GETCWD=	1 2 3 4
C_MEMCPY=	1 2 3 4 5 6
C_FREAD=	1 2 3 4
C_DECLARE=	1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
C_SSCANF=	1 2 3 4 5 6
C_VARARRAY=	1 2 3
C_MD=		1 2 3 4 5 6
C_BUILTINS=	1

CPP_SNPRINTF=	1 2 3 4 5
CPP_SSCANF=	1

TCC=		gcc
TCFLAGS=	-Wbounded -Wformat -pedantic
TCXX=		g++
TCXXFLAGS=	${TCFLAGS}
REGRESS_TARGETS= ${C_TARGETS} ${CPP_TARGETS}

.for i in ${C_MODULES}
.  for j in ${C_${i:U}}
C_TARGETS+= c-${i}-${j} 
c-${i}-${j}:
	${TCC} ${TCFLAGS} -o /dev/null ${i}-${j}.c 2>&1 | diff -u - ${.CURDIR}/${i}-${j}.c${EXP}
.  endfor
.endfor

.for i in ${CPP_MODULES}
.  for j in ${CPP_${i:U}}
CPP_TARGETS+= cpp-${i}-${j}
cpp-${i}-${j}:
	${TCXX} ${TCXXFLAGS} -o /dev/null ${i}-${j}.cpp 2>&1 | grep -v 'misused' | diff -u - ${.CURDIR}/${i}-${j}.cpp${EXP}
.  endfor
.endfor

generate:
.for i in ${C_TARGETS}
	-${TCC} ${TCFLAGS} -o /dev/null ${i:C/^c-//g}.c >${i:C/^c-//g}.c${EXP} 2>&1
.endfor
.for i in ${CPP_TARGETS}
	-${TCXX} ${TCXXFLAGS} -o /dev/null ${i:C/^cpp-//g}.cpp >${i:C/^cpp-//g}.cpp${EXP} 2>&1
.endfor

.PHONY:	${REGRESS_TARGETS} generate regress

NOOBJ= Yes

.include <bsd.regress.mk>
.if ${USE_GCC3:L:Myes}
EXP=		.exp.gcc3
.else
EXP=		.exp
.endif