diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-10-07 18:12:44 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-10-07 18:12:44 +0000 |
commit | 4cb057bd29b66597f6c3cfe931db4d65ae94ed2a (patch) | |
tree | e4cdd86d7f0ef072ed6b0a2cf4a6a23f54bed7bb /regress/usr.bin/pcc | |
parent | c4bf53740e619039da8d2facd10b2473c2f9cae3 (diff) |
and reorg this tree as well
Diffstat (limited to 'regress/usr.bin/pcc')
34 files changed, 175 insertions, 25 deletions
diff --git a/regress/usr.bin/pcc/Makefile b/regress/usr.bin/pcc/Makefile index 8822e25cda1..299d9b5e6ac 100644 --- a/regress/usr.bin/pcc/Makefile +++ b/regress/usr.bin/pcc/Makefile @@ -1,5 +1,5 @@ -# $OpenBSD: Makefile,v 1.1 2007/10/05 16:49:37 otto Exp $ +# $OpenBSD: Makefile,v 1.2 2007/10/07 18:12:43 otto Exp $ -SUBDIR= cc +SUBDIR= cpp ccom .include <bsd.subdir.mk> diff --git a/regress/usr.bin/pcc/cc/Makefile b/regress/usr.bin/pcc/cc/Makefile deleted file mode 100644 index 24454317768..00000000000 --- a/regress/usr.bin/pcc/cc/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $OpenBSD: Makefile,v 1.1 2007/10/05 16:49:37 otto Exp $ - -SUBDIR= cpp ccom - -.include <bsd.subdir.mk> diff --git a/regress/usr.bin/pcc/cc/cpp/skip001.out b/regress/usr.bin/pcc/cc/cpp/skip001.out deleted file mode 100644 index be1d0e0d1af..00000000000 --- a/regress/usr.bin/pcc/cc/cpp/skip001.out +++ /dev/null @@ -1,16 +0,0 @@ -# 1 "/usr/src/regress/usr.bin/pcc/cc/cpp/skip001.c" - - - - - - - - -# 1 "/usr/src/regress/usr.bin/pcc/cc/cpp/skip001.c" - - -# 1 "/usr/src/regress/usr.bin/pcc/cc/cpp/subdir/include.h" -line from include.h -# 3 "/usr/src/regress/usr.bin/pcc/cc/cpp/skip001.c" - diff --git a/regress/usr.bin/pcc/cc/ccom/Makefile b/regress/usr.bin/pcc/ccom/Makefile index b72dcea4fa6..b40629c2b3e 100644 --- a/regress/usr.bin/pcc/cc/ccom/Makefile +++ b/regress/usr.bin/pcc/ccom/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.2 2007/10/05 17:28:47 otto Exp $ +# $OpenBSD: Makefile,v 1.1 2007/10/07 18:12:43 otto Exp $ CC=/usr/local/bin/cc diff --git a/regress/usr.bin/pcc/cc/ccom/const001.c b/regress/usr.bin/pcc/ccom/const001.c index 5bb68f6e1c5..5bb68f6e1c5 100644 --- a/regress/usr.bin/pcc/cc/ccom/const001.c +++ b/regress/usr.bin/pcc/ccom/const001.c diff --git a/regress/usr.bin/pcc/cc/ccom/darray001.c b/regress/usr.bin/pcc/ccom/darray001.c index 973371b7401..973371b7401 100644 --- a/regress/usr.bin/pcc/cc/ccom/darray001.c +++ b/regress/usr.bin/pcc/ccom/darray001.c diff --git a/regress/usr.bin/pcc/cc/ccom/enum001.c b/regress/usr.bin/pcc/ccom/enum001.c index debeb7a77d2..debeb7a77d2 100644 --- a/regress/usr.bin/pcc/cc/ccom/enum001.c +++ b/regress/usr.bin/pcc/ccom/enum001.c diff --git a/regress/usr.bin/pcc/cc/ccom/init001.c b/regress/usr.bin/pcc/ccom/init001.c index 70bb3826f8f..70bb3826f8f 100644 --- a/regress/usr.bin/pcc/cc/ccom/init001.c +++ b/regress/usr.bin/pcc/ccom/init001.c diff --git a/regress/usr.bin/pcc/cc/ccom/init002.c b/regress/usr.bin/pcc/ccom/init002.c index 79d94a220a3..79d94a220a3 100644 --- a/regress/usr.bin/pcc/cc/ccom/init002.c +++ b/regress/usr.bin/pcc/ccom/init002.c diff --git a/regress/usr.bin/pcc/cc/ccom/init003.c b/regress/usr.bin/pcc/ccom/init003.c index d477b96a044..d477b96a044 100644 --- a/regress/usr.bin/pcc/cc/ccom/init003.c +++ b/regress/usr.bin/pcc/ccom/init003.c diff --git a/regress/usr.bin/pcc/cc/ccom/init004.c b/regress/usr.bin/pcc/ccom/init004.c index 9dba1c64757..9dba1c64757 100644 --- a/regress/usr.bin/pcc/cc/ccom/init004.c +++ b/regress/usr.bin/pcc/ccom/init004.c diff --git a/regress/usr.bin/pcc/cc/ccom/tmpalloc001.c b/regress/usr.bin/pcc/ccom/tmpalloc001.c index 87679108b2b..87679108b2b 100644 --- a/regress/usr.bin/pcc/cc/ccom/tmpalloc001.c +++ b/regress/usr.bin/pcc/ccom/tmpalloc001.c diff --git a/regress/usr.bin/pcc/cc/cpp/Makefile b/regress/usr.bin/pcc/cpp/Makefile index a0b07fed5d8..36d74871b02 100644 --- a/regress/usr.bin/pcc/cc/cpp/Makefile +++ b/regress/usr.bin/pcc/cpp/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2007/10/05 17:28:47 otto Exp $ +# $OpenBSD: Makefile,v 1.1 2007/10/07 18:12:43 otto Exp $ CC=/usr/local/bin/cc diff --git a/regress/usr.bin/pcc/cpp/res1 b/regress/usr.bin/pcc/cpp/res1 new file mode 100644 index 00000000000..c0bb48019f3 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/res1 @@ -0,0 +1,7 @@ +# 1 "<stdin>" + + + + +char p[] = "x ## y"; + diff --git a/regress/usr.bin/pcc/cpp/res2 b/regress/usr.bin/pcc/cpp/res2 new file mode 100644 index 00000000000..1eb808aac47 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/res2 @@ -0,0 +1,26 @@ +# 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 new file mode 100644 index 00000000000..4219319ddff --- /dev/null +++ b/regress/usr.bin/pcc/cpp/res3 @@ -0,0 +1,16 @@ +# 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 new file mode 100644 index 00000000000..d7046a01507 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/res4 @@ -0,0 +1,5 @@ +# 1 "<stdin>" + + + +(1) diff --git a/regress/usr.bin/pcc/cpp/res5 b/regress/usr.bin/pcc/cpp/res5 new file mode 100644 index 00000000000..291405dcfee --- /dev/null +++ b/regress/usr.bin/pcc/cpp/res5 @@ -0,0 +1,4 @@ +# 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 new file mode 100644 index 00000000000..0bb0f9a1dbf --- /dev/null +++ b/regress/usr.bin/pcc/cpp/res6 @@ -0,0 +1,6 @@ +# 1 "<stdin>" + + + + +foo diff --git a/regress/usr.bin/pcc/cpp/res7 b/regress/usr.bin/pcc/cpp/res7 new file mode 100644 index 00000000000..18c492bda72 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/res7 @@ -0,0 +1,5 @@ +# 1 "<stdin>" + + + +a YES diff --git a/regress/usr.bin/pcc/cpp/res8 b/regress/usr.bin/pcc/cpp/res8 new file mode 100644 index 00000000000..e7de0945f47 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/res8 @@ -0,0 +1,8 @@ +# 1 "<stdin>" + + + + + +(hej.s_s.s_pos) + diff --git a/regress/usr.bin/pcc/cpp/res9 b/regress/usr.bin/pcc/cpp/res9 new file mode 100644 index 00000000000..aea239fc9aa --- /dev/null +++ b/regress/usr.bin/pcc/cpp/res9 @@ -0,0 +1,5 @@ +# 1 "<stdin>" + + + +ao diff --git a/regress/usr.bin/pcc/cc/cpp/skip001.c b/regress/usr.bin/pcc/cpp/skip001.c index 2b6b4c440b5..2b6b4c440b5 100644 --- a/regress/usr.bin/pcc/cc/cpp/skip001.c +++ b/regress/usr.bin/pcc/cpp/skip001.c diff --git a/regress/usr.bin/pcc/cpp/skip001.out b/regress/usr.bin/pcc/cpp/skip001.out new file mode 100644 index 00000000000..0fd118a035d --- /dev/null +++ b/regress/usr.bin/pcc/cpp/skip001.out @@ -0,0 +1,16 @@ +# 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/cc/cpp/subdir/include.h b/regress/usr.bin/pcc/cpp/subdir/include.h index da14e47f9f1..da14e47f9f1 100644 --- a/regress/usr.bin/pcc/cc/cpp/subdir/include.h +++ b/regress/usr.bin/pcc/cpp/subdir/include.h diff --git a/regress/usr.bin/pcc/cpp/test1 b/regress/usr.bin/pcc/cpp/test1 new file mode 100644 index 00000000000..79a3c5dc5d4 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/test1 @@ -0,0 +1,6 @@ +#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 new file mode 100644 index 00000000000..283d4fbc1f0 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/test2 @@ -0,0 +1,25 @@ +#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 new file mode 100644 index 00000000000..a659245ecbc --- /dev/null +++ b/regress/usr.bin/pcc/cpp/test3 @@ -0,0 +1,15 @@ +#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 new file mode 100644 index 00000000000..0068f3751b8 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/test4 @@ -0,0 +1,4 @@ +#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 new file mode 100644 index 00000000000..3ca0bb6c9c0 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/test5 @@ -0,0 +1,3 @@ +#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 new file mode 100644 index 00000000000..28cfddece68 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/test6 @@ -0,0 +1,5 @@ +#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 new file mode 100644 index 00000000000..b22b22bbcc9 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/test7 @@ -0,0 +1,4 @@ +#define a() YES +#define b() a +b() +b()() diff --git a/regress/usr.bin/pcc/cpp/test8 b/regress/usr.bin/pcc/cpp/test8 new file mode 100644 index 00000000000..c5d2f9a1449 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/test8 @@ -0,0 +1,7 @@ +// 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 new file mode 100644 index 00000000000..4d4368d5663 --- /dev/null +++ b/regress/usr.bin/pcc/cpp/test9 @@ -0,0 +1,4 @@ +#define C(a,b,c) a##b##c +#define N(x,y) C(x,_,y) +#define A_O ao +N(A,O) |