diff options
Diffstat (limited to 'regress/usr.bin/pcc')
-rw-r--r-- | regress/usr.bin/pcc/cc/ccom/init001.c | 16 | ||||
-rw-r--r-- | regress/usr.bin/pcc/cc/ccom/tmpalloc001.c | 10 |
2 files changed, 26 insertions, 0 deletions
diff --git a/regress/usr.bin/pcc/cc/ccom/init001.c b/regress/usr.bin/pcc/cc/ccom/init001.c new file mode 100644 index 00000000000..70bb3826f8f --- /dev/null +++ b/regress/usr.bin/pcc/cc/ccom/init001.c @@ -0,0 +1,16 @@ +/* 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/cc/ccom/tmpalloc001.c b/regress/usr.bin/pcc/cc/ccom/tmpalloc001.c new file mode 100644 index 00000000000..0fef7fe865a --- /dev/null +++ b/regress/usr.bin/pcc/cc/ccom/tmpalloc001.c @@ -0,0 +1,10 @@ +/* From Ted Unangst */ +int a() { return 1; } + +int main() +{ + int b = 0; + a() + ++b; + printf("b %d\n", b); + return 0; +} |