diff options
Diffstat (limited to 'regress/usr.bin/pcc')
39 files changed, 0 insertions, 417 deletions
diff --git a/regress/usr.bin/pcc/Makefile b/regress/usr.bin/pcc/Makefile deleted file mode 100644 index 299d9b5e6ac..00000000000 --- a/regress/usr.bin/pcc/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 2007/10/07 18:12:43 otto Exp $ - -SUBDIR= cpp ccom - -.include <bsd.subdir.mk> diff --git a/regress/usr.bin/pcc/ccom/Makefile b/regress/usr.bin/pcc/ccom/Makefile deleted file mode 100644 index 0ebf3d9148b..00000000000 --- a/regress/usr.bin/pcc/ccom/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# $OpenBSD: Makefile,v 1.5 2008/01/24 18:16:47 stefan Exp $ - -CC=/usr/local/bin/cc - -REGRESS_TARGETS=\ - arith001 \ - const001 \ - darray001 \ - enum001 \ - init001 init004 \ - mustpass0000 mustpass0001 \ - switch003 \ - tmpalloc001 \ - shouldfail - -.c: - @echo ${*} - ${CC} ${.CURDIR}/${*}.c -o ${*}.out && ${.CURDIR}/${*}.out - -shouldfail: - @echo ${*} - if ${CC} ${.CURDIR}/init002.c; then false; else true; fi - if ${CC} ${.CURDIR}/init003.c; then false; else true; fi - if ${CC} ${.CURDIR}/switch001.c; then false; else true; fi - if ${CC} ${.CURDIR}/switch002.c; then false; else true; fi - if ${CC} ${.CURDIR}/mustfail0000.c; then false; else true; fi - -clean: - rm -f *.out - -.include <bsd.regress.mk> diff --git a/regress/usr.bin/pcc/ccom/arith001.c b/regress/usr.bin/pcc/ccom/arith001.c deleted file mode 100644 index 2310882ade2..00000000000 --- a/regress/usr.bin/pcc/ccom/arith001.c +++ /dev/null @@ -1,14 +0,0 @@ -main() -{ - long long foo = 10; - unsigned int d = 0xffffffffUL; - - if (foo + d != 0x100000009LL) - return 1; - - foo += d; - if (foo != 0x100000009LL) - return 1; - return 0; -} - diff --git a/regress/usr.bin/pcc/ccom/const001.c b/regress/usr.bin/pcc/ccom/const001.c deleted file mode 100644 index 5bb68f6e1c5..00000000000 --- a/regress/usr.bin/pcc/ccom/const001.c +++ /dev/null @@ -1,23 +0,0 @@ -main() -{ - char c = 0x7f; - short s = 0x7fff; - int i = 0x7fffffff; - long long ll = 0x7fffffffffffffffLL; - - if (c > i) - exit(1); - if (s > i) - exit(1); - if (i > ll) - exit(1); - - if (c > 0x7fff) - exit(1); - if (s > 0x7fffffff) - exit(1); - if (i > 0x7fffffffffffffffLL) - exit(1); - exit(0); -} - diff --git a/regress/usr.bin/pcc/ccom/darray001.c b/regress/usr.bin/pcc/ccom/darray001.c deleted file mode 100644 index 973371b7401..00000000000 --- a/regress/usr.bin/pcc/ccom/darray001.c +++ /dev/null @@ -1,9 +0,0 @@ -/* should not issue: darray001.c, line 6: compiler error: bad conversion */ -/* From TAKAHASHI Tamotsu */ -int main(void) { - int n=1; - int a[1][n]; - a[0][0]=1; /* this line */ - return 0; -} - diff --git a/regress/usr.bin/pcc/ccom/enum001.c b/regress/usr.bin/pcc/ccom/enum001.c deleted file mode 100644 index debeb7a77d2..00000000000 --- a/regress/usr.bin/pcc/ccom/enum001.c +++ /dev/null @@ -1,26 +0,0 @@ -/* code should produce exactly one warning */ - -enum foo { bar }; -enum footoo { bar1 }; - -enum foo f(void) { return bar; } -double g(void) { return 0.0; } - -struct baz { - enum foo (*ff)(void); -}; - -struct baz a[] = { {f}, - {g} }; - - -static int h(enum foo *); -static int h(enum foo *arg) -{ - return 0; -} - -int main() -{ - return 0; -} diff --git a/regress/usr.bin/pcc/ccom/init001.c b/regress/usr.bin/pcc/ccom/init001.c deleted file mode 100644 index 70bb3826f8f..00000000000 --- a/regress/usr.bin/pcc/ccom/init001.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Based on OpenBSD PR 5586 from TAKAHASHI Tamotsu */ - -struct s { - int f; - int g[1][1]; -}; - -struct s v = { 0x99, {{0x100}} }; - -int -main() -{ - if (v.f != 0x99) - errx(1, "wrong"); - return 0; -} diff --git a/regress/usr.bin/pcc/ccom/init002.c b/regress/usr.bin/pcc/ccom/init002.c deleted file mode 100644 index 79d94a220a3..00000000000 --- a/regress/usr.bin/pcc/ccom/init002.c +++ /dev/null @@ -1,6 +0,0 @@ -/* should not compile, but should not crash pcc either */ -struct a { - struct x { - int b; - } c[2]; -} p[2] = { { { 1 }, { 2 } } }; diff --git a/regress/usr.bin/pcc/ccom/init003.c b/regress/usr.bin/pcc/ccom/init003.c deleted file mode 100644 index d477b96a044..00000000000 --- a/regress/usr.bin/pcc/ccom/init003.c +++ /dev/null @@ -1,4 +0,0 @@ -/* extra braces, should not cause internal compiler error */ -struct a { - int i; -} *p = { { 0 } }; diff --git a/regress/usr.bin/pcc/ccom/init004.c b/regress/usr.bin/pcc/ccom/init004.c deleted file mode 100644 index 9dba1c64757..00000000000 --- a/regress/usr.bin/pcc/ccom/init004.c +++ /dev/null @@ -1,17 +0,0 @@ - -enum foo {aap}; - -enum foo eval_table(void) { return aap; } - -static const struct ops { - enum foo (*afrunc)(void); -} eval_ops[] = { - { eval_table }, -}; - -main() -{ - return 0; -} - - diff --git a/regress/usr.bin/pcc/ccom/mustfail0000.c b/regress/usr.bin/pcc/ccom/mustfail0000.c deleted file mode 100644 index b9f223478c8..00000000000 --- a/regress/usr.bin/pcc/ccom/mustfail0000.c +++ /dev/null @@ -1,6 +0,0 @@ -int a(typedef int a); -int b(extern int b); -int c(auto int c); -int d(static int d); - -int main(void) { return 1; } diff --git a/regress/usr.bin/pcc/ccom/mustpass0000.c b/regress/usr.bin/pcc/ccom/mustpass0000.c deleted file mode 100644 index e7ff1688dfb..00000000000 --- a/regress/usr.bin/pcc/ccom/mustpass0000.c +++ /dev/null @@ -1,10 +0,0 @@ -typedef int a; -typedef int b; - -int -main(void) -{ - enum a { a = 1, b = a + 2, c = a + b + 3 }; - - return 0; -} diff --git a/regress/usr.bin/pcc/ccom/mustpass0001.c b/regress/usr.bin/pcc/ccom/mustpass0001.c deleted file mode 100644 index 01383ca23b0..00000000000 --- a/regress/usr.bin/pcc/ccom/mustpass0001.c +++ /dev/null @@ -1,9 +0,0 @@ -typedef int a; - -int -main(void) -{ - struct x { int a; } a; - - return 0; -} diff --git a/regress/usr.bin/pcc/ccom/switch001.c b/regress/usr.bin/pcc/ccom/switch001.c deleted file mode 100644 index dfa75eaa125..00000000000 --- a/regress/usr.bin/pcc/ccom/switch001.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Should not compile. */ -int -main(int argc, char **argv) -{ - double d = 0.0; - - switch (d) { - } - - return 0; -} diff --git a/regress/usr.bin/pcc/ccom/switch002.c b/regress/usr.bin/pcc/ccom/switch002.c deleted file mode 100644 index b0c9037f04f..00000000000 --- a/regress/usr.bin/pcc/ccom/switch002.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Should not compile. */ -int -main(int argc, char **argv) -{ - int *p = 0; - - switch (p) { - } - - return 0; -} diff --git a/regress/usr.bin/pcc/ccom/switch003.c b/regress/usr.bin/pcc/ccom/switch003.c deleted file mode 100644 index c6bcf90cfe7..00000000000 --- a/regress/usr.bin/pcc/ccom/switch003.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Returns 1 if sizeof(unsigned long) < sizeof(unsigned long long), but - * should return 0. - */ -int -main(int argc, char **argv) -{ - unsigned long long i = (unsigned long)~0 + (unsigned long long)2; - - switch (i) { - case 1: - return 1; - } - - return 0; -} diff --git a/regress/usr.bin/pcc/ccom/tmpalloc001.c b/regress/usr.bin/pcc/ccom/tmpalloc001.c deleted file mode 100644 index 87679108b2b..00000000000 --- a/regress/usr.bin/pcc/ccom/tmpalloc001.c +++ /dev/null @@ -1,19 +0,0 @@ -/* From Ted Unangst */ -int a() { return 1; } - -int f() -{ - int b = 0; - a() + ++b; - return 0; -} - -int main() -{ - int b = 0; - a() + ++b; - if (b == 1) - exit(0); - else - exit(1); -} diff --git a/regress/usr.bin/pcc/cpp/Makefile b/regress/usr.bin/pcc/cpp/Makefile deleted file mode 100644 index 36d74871b02..00000000000 --- a/regress/usr.bin/pcc/cpp/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $OpenBSD: Makefile,v 1.1 2007/10/07 18:12:43 otto Exp $ - -CC=/usr/local/bin/cc - -regress: - @echo skip001.c - ${CC} -E -I ${.CURDIR}/subdir ${.CURDIR}/skip001.c | cmp - ${.CURDIR}/skip001.out - -.include <bsd.regress.mk> diff --git a/regress/usr.bin/pcc/cpp/res1 b/regress/usr.bin/pcc/cpp/res1 deleted file mode 100644 index c0bb48019f3..00000000000 --- a/regress/usr.bin/pcc/cpp/res1 +++ /dev/null @@ -1,7 +0,0 @@ -# 1 "<stdin>" - - - - -char p[] = "x ## y"; - diff --git a/regress/usr.bin/pcc/cpp/res2 b/regress/usr.bin/pcc/cpp/res2 deleted file mode 100644 index 1eb808aac47..00000000000 --- a/regress/usr.bin/pcc/cpp/res2 +++ /dev/null @@ -1,26 +0,0 @@ -# 1 "<stdin>" - - - - - - - - - - - - - - -f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t (1); -f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & -f(2 * (0,1))^m (0,1); -int i[] = { 1, 23, 4, 5, }; -char c[2][6] = { "hello", "" }; - - - - - - diff --git a/regress/usr.bin/pcc/cpp/res3 b/regress/usr.bin/pcc/cpp/res3 deleted file mode 100644 index 4219319ddff..00000000000 --- a/regress/usr.bin/pcc/cpp/res3 +++ /dev/null @@ -1,16 +0,0 @@ -# 1 "<stdin>" - - - - - - - - - -printf("x" "1" "= %d, x" "2" "= %s", x1, x2); -fputs( -"strncmp(\"abc\\0d\", \"abc\", '\\4') == 0" ": @\n", s); -\#include "vers2.h" -"hello"; -"hello" ", world" diff --git a/regress/usr.bin/pcc/cpp/res4 b/regress/usr.bin/pcc/cpp/res4 deleted file mode 100644 index d7046a01507..00000000000 --- a/regress/usr.bin/pcc/cpp/res4 +++ /dev/null @@ -1,5 +0,0 @@ -# 1 "<stdin>" - - - -(1) diff --git a/regress/usr.bin/pcc/cpp/res5 b/regress/usr.bin/pcc/cpp/res5 deleted file mode 100644 index 291405dcfee..00000000000 --- a/regress/usr.bin/pcc/cpp/res5 +++ /dev/null @@ -1,4 +0,0 @@ -# 1 "<stdin>" - -int j[] = { 123, 45, 67, 89, - 10, 11, 12, }; diff --git a/regress/usr.bin/pcc/cpp/res6 b/regress/usr.bin/pcc/cpp/res6 deleted file mode 100644 index 0bb0f9a1dbf..00000000000 --- a/regress/usr.bin/pcc/cpp/res6 +++ /dev/null @@ -1,6 +0,0 @@ -# 1 "<stdin>" - - - - -foo diff --git a/regress/usr.bin/pcc/cpp/res7 b/regress/usr.bin/pcc/cpp/res7 deleted file mode 100644 index 18c492bda72..00000000000 --- a/regress/usr.bin/pcc/cpp/res7 +++ /dev/null @@ -1,5 +0,0 @@ -# 1 "<stdin>" - - - -a YES diff --git a/regress/usr.bin/pcc/cpp/res8 b/regress/usr.bin/pcc/cpp/res8 deleted file mode 100644 index e7de0945f47..00000000000 --- a/regress/usr.bin/pcc/cpp/res8 +++ /dev/null @@ -1,8 +0,0 @@ -# 1 "<stdin>" - - - - - -(hej.s_s.s_pos) - diff --git a/regress/usr.bin/pcc/cpp/res9 b/regress/usr.bin/pcc/cpp/res9 deleted file mode 100644 index aea239fc9aa..00000000000 --- a/regress/usr.bin/pcc/cpp/res9 +++ /dev/null @@ -1,5 +0,0 @@ -# 1 "<stdin>" - - - -ao diff --git a/regress/usr.bin/pcc/cpp/skip001.c b/regress/usr.bin/pcc/cpp/skip001.c deleted file mode 100644 index 2b6b4c440b5..00000000000 --- a/regress/usr.bin/pcc/cpp/skip001.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "include.h" /* line which is bound to trash -yytext */ - diff --git a/regress/usr.bin/pcc/cpp/skip001.out b/regress/usr.bin/pcc/cpp/skip001.out deleted file mode 100644 index 0fd118a035d..00000000000 --- a/regress/usr.bin/pcc/cpp/skip001.out +++ /dev/null @@ -1,16 +0,0 @@ -# 1 "/usr/src/regress/usr.bin/pcc/cpp/skip001.c" - - - - - - - - -# 1 "/usr/src/regress/usr.bin/pcc/cpp/skip001.c" - - -# 1 "/usr/src/regress/usr.bin/pcc/cpp/subdir/include.h" -line from include.h -# 3 "/usr/src/regress/usr.bin/pcc/cpp/skip001.c" - diff --git a/regress/usr.bin/pcc/cpp/subdir/include.h b/regress/usr.bin/pcc/cpp/subdir/include.h deleted file mode 100644 index da14e47f9f1..00000000000 --- a/regress/usr.bin/pcc/cpp/subdir/include.h +++ /dev/null @@ -1 +0,0 @@ -line from include.h diff --git a/regress/usr.bin/pcc/cpp/test1 b/regress/usr.bin/pcc/cpp/test1 deleted file mode 100644 index 79a3c5dc5d4..00000000000 --- a/regress/usr.bin/pcc/cpp/test1 +++ /dev/null @@ -1,6 +0,0 @@ -#define hash_hash # ## # -#define mkstr(a) # a -#define in_between(a) mkstr(a) -#define join(c, d) in_between(c hash_hash d) -char p[] = join(x, y); // equivalent to - // char p[] = "x ## y"; diff --git a/regress/usr.bin/pcc/cpp/test2 b/regress/usr.bin/pcc/cpp/test2 deleted file mode 100644 index 283d4fbc1f0..00000000000 --- a/regress/usr.bin/pcc/cpp/test2 +++ /dev/null @@ -1,25 +0,0 @@ -#define x 3 -#define f(a) f(x * (a)) -#undef x -#define x 2 -#define g f -#define z z[0] -#define h g(~ -#define m(a) a(w) -#define w 0,1 -#define t(a) a -#define p() int -#define q(x) x -#define r(x,y) x ## y -#define str(x) # x -f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); -g(x+(3,4)-w) | h 5) & m -(f)^m(m); -p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) }; -char c[2][6] = { str(hello), str() }; -/* - * f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); - * f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1); - * int i[] = { 1, 23, 4, 5, }; - * char c[2][6] = { "hello", "" }; - */ diff --git a/regress/usr.bin/pcc/cpp/test3 b/regress/usr.bin/pcc/cpp/test3 deleted file mode 100644 index a659245ecbc..00000000000 --- a/regress/usr.bin/pcc/cpp/test3 +++ /dev/null @@ -1,15 +0,0 @@ -#define str(s) # s -#define xstr(s) str(s) -#define debug(s, t) printf("x" # s "= %d, x" # t "= %s", \ - x ## s, x ## t) -#define INCFILE(n) vers ## n -#define glue(a, b) a ## b -#define xglue(a, b) glue(a, b) -#define HIGHLOW "hello" -#define LOW LOW ", world" -debug(1, 2); -fputs(str(strncmp("abc\0d", "abc", '\4') // this goes away - == 0) str(: @\n), s); -\#include xstr(INCFILE(2).h) -glue(HIGH, LOW); -xglue(HIGH, LOW) diff --git a/regress/usr.bin/pcc/cpp/test4 b/regress/usr.bin/pcc/cpp/test4 deleted file mode 100644 index 0068f3751b8..00000000000 --- a/regress/usr.bin/pcc/cpp/test4 +++ /dev/null @@ -1,4 +0,0 @@ -#define foobar 1 -#define C(x,y) x##y -#define D(x) (C(x,bar)) -D(foo) diff --git a/regress/usr.bin/pcc/cpp/test5 b/regress/usr.bin/pcc/cpp/test5 deleted file mode 100644 index 3ca0bb6c9c0..00000000000 --- a/regress/usr.bin/pcc/cpp/test5 +++ /dev/null @@ -1,3 +0,0 @@ -#define t(x,y,z) x ## y ## z -int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), - t(10,,), t(,11,), t(,,12), t(,,) }; diff --git a/regress/usr.bin/pcc/cpp/test6 b/regress/usr.bin/pcc/cpp/test6 deleted file mode 100644 index 28cfddece68..00000000000 --- a/regress/usr.bin/pcc/cpp/test6 +++ /dev/null @@ -1,5 +0,0 @@ -#define X(a,b, \ - c,d) \ - foo - -X(1,2,3,4) diff --git a/regress/usr.bin/pcc/cpp/test7 b/regress/usr.bin/pcc/cpp/test7 deleted file mode 100644 index b22b22bbcc9..00000000000 --- a/regress/usr.bin/pcc/cpp/test7 +++ /dev/null @@ -1,4 +0,0 @@ -#define a() YES -#define b() a -b() -b()() diff --git a/regress/usr.bin/pcc/cpp/test8 b/regress/usr.bin/pcc/cpp/test8 deleted file mode 100644 index c5d2f9a1449..00000000000 --- a/regress/usr.bin/pcc/cpp/test8 +++ /dev/null @@ -1,7 +0,0 @@ -// test macro expansion in arguments -#define s_pos s_s.s_pos -#define foo(x) (x) - -//hej.s_pos -foo(hej.s_pos) - diff --git a/regress/usr.bin/pcc/cpp/test9 b/regress/usr.bin/pcc/cpp/test9 deleted file mode 100644 index 4d4368d5663..00000000000 --- a/regress/usr.bin/pcc/cpp/test9 +++ /dev/null @@ -1,4 +0,0 @@ -#define C(a,b,c) a##b##c -#define N(x,y) C(x,_,y) -#define A_O ao -N(A,O) |