summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-10-05 17:28:48 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-10-05 17:28:48 +0000
commitc485ecd1482c169b6cc97940557e16e2086f7fe2 (patch)
tree2824ed384a44e84e691d4be956fb888b095e3dc2 /regress/usr.bin
parent4b593bea5f0ea96407b6d529849c52c36a3a06f1 (diff)
basic tests now work, including those that should fail
Diffstat (limited to 'regress/usr.bin')
-rw-r--r--regress/usr.bin/pcc/cc/ccom/Makefile25
-rw-r--r--regress/usr.bin/pcc/cc/ccom/enum001.c9
-rw-r--r--regress/usr.bin/pcc/cc/ccom/init004.c7
-rw-r--r--regress/usr.bin/pcc/cc/ccom/tmpalloc001.c6
-rw-r--r--regress/usr.bin/pcc/cc/cpp/Makefile4
5 files changed, 42 insertions, 9 deletions
diff --git a/regress/usr.bin/pcc/cc/ccom/Makefile b/regress/usr.bin/pcc/cc/ccom/Makefile
index 1d59e202d87..b72dcea4fa6 100644
--- a/regress/usr.bin/pcc/cc/ccom/Makefile
+++ b/regress/usr.bin/pcc/cc/ccom/Makefile
@@ -1,3 +1,24 @@
-# $OpenBSD: Makefile,v 1.1 2007/10/05 16:49:37 otto Exp $
+# $OpenBSD: Makefile,v 1.2 2007/10/05 17:28:47 otto Exp $
-regress:
+CC=/usr/local/bin/cc
+
+REGRESS_TARGETS=const001 \
+ darray001 \
+ enum001 \
+ init001 init004 \
+ tmpalloc001 \
+ shouldfail
+
+.c:
+ @echo ${*}
+ ${CC} ${.CURDIR}/${*}.c && ./a.out
+
+shouldfail:
+ @echo ${*}
+ if ${CC} ${.CURDIR}/init002.c; then false; else true; fi
+ if ${CC} ${.CURDIR}/init003.c; then false; else true; fi
+
+clean:
+ rm -f a.out
+
+.include <bsd.regress.mk>
diff --git a/regress/usr.bin/pcc/cc/ccom/enum001.c b/regress/usr.bin/pcc/cc/ccom/enum001.c
index d46065e7434..debeb7a77d2 100644
--- a/regress/usr.bin/pcc/cc/ccom/enum001.c
+++ b/regress/usr.bin/pcc/cc/ccom/enum001.c
@@ -3,8 +3,8 @@
enum foo { bar };
enum footoo { bar1 };
-enum foo f(void);
-double g(void);
+enum foo f(void) { return bar; }
+double g(void) { return 0.0; }
struct baz {
enum foo (*ff)(void);
@@ -19,3 +19,8 @@ static int h(enum foo *arg)
{
return 0;
}
+
+int main()
+{
+ return 0;
+}
diff --git a/regress/usr.bin/pcc/cc/ccom/init004.c b/regress/usr.bin/pcc/cc/ccom/init004.c
index 61b1a6699ed..9dba1c64757 100644
--- a/regress/usr.bin/pcc/cc/ccom/init004.c
+++ b/regress/usr.bin/pcc/cc/ccom/init004.c
@@ -1,7 +1,7 @@
enum foo {aap};
-enum foo eval_table(void);
+enum foo eval_table(void) { return aap; }
static const struct ops {
enum foo (*afrunc)(void);
@@ -9,4 +9,9 @@ static const struct ops {
{ eval_table },
};
+main()
+{
+ return 0;
+}
+
diff --git a/regress/usr.bin/pcc/cc/ccom/tmpalloc001.c b/regress/usr.bin/pcc/cc/ccom/tmpalloc001.c
index 04aaa690ea9..87679108b2b 100644
--- a/regress/usr.bin/pcc/cc/ccom/tmpalloc001.c
+++ b/regress/usr.bin/pcc/cc/ccom/tmpalloc001.c
@@ -12,6 +12,8 @@ int main()
{
int b = 0;
a() + ++b;
- printf("%d\n", b);
- return 0;
+ if (b == 1)
+ exit(0);
+ else
+ exit(1);
}
diff --git a/regress/usr.bin/pcc/cc/cpp/Makefile b/regress/usr.bin/pcc/cc/cpp/Makefile
index f955033a957..a0b07fed5d8 100644
--- a/regress/usr.bin/pcc/cc/cpp/Makefile
+++ b/regress/usr.bin/pcc/cc/cpp/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.3 2007/10/05 16:54:57 otto Exp $
+# $OpenBSD: Makefile,v 1.4 2007/10/05 17:28:47 otto Exp $
CC=/usr/local/bin/cc
@@ -6,4 +6,4 @@ regress:
@echo skip001.c
${CC} -E -I ${.CURDIR}/subdir ${.CURDIR}/skip001.c | cmp - ${.CURDIR}/skip001.out
-.include "bsd.regress.mk"
+.include <bsd.regress.mk>