BSD 4_1c_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Tue, 14 Dec 1982 19:37:07 +0000 (11:37 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Tue, 14 Dec 1982 19:37:07 +0000 (11:37 -0800)
Work on file usr/src/ucb/dbx/test/t.c
Work on file usr/src/ucb/dbx/test/struct.c
Work on file usr/src/ucb/dbx/test/reg.c
Work on file usr/src/ucb/dbx/test/bf.c
Work on file usr/src/ucb/dbx/test/x
Work on file usr/src/ucb/dbx/test/float.c
Work on file usr/src/ucb/dbx/test/own.c
Work on file usr/src/ucb/dbx/test/t1.c
Work on file usr/src/ucb/dbx/test/bug.c
Work on file usr/src/ucb/dbx/test/enum.c

Synthesized-from: CSRG/cd1/4.1c.2

usr/src/ucb/dbx/test/bf.c [new file with mode: 0644]
usr/src/ucb/dbx/test/bug.c [new file with mode: 0644]
usr/src/ucb/dbx/test/enum.c [new file with mode: 0644]
usr/src/ucb/dbx/test/float.c [new file with mode: 0644]
usr/src/ucb/dbx/test/own.c [new file with mode: 0644]
usr/src/ucb/dbx/test/reg.c [new file with mode: 0644]
usr/src/ucb/dbx/test/struct.c [new file with mode: 0644]
usr/src/ucb/dbx/test/t.c [new file with mode: 0644]
usr/src/ucb/dbx/test/t1.c [new file with mode: 0644]
usr/src/ucb/dbx/test/x [new file with mode: 0644]

diff --git a/usr/src/ucb/dbx/test/bf.c b/usr/src/ucb/dbx/test/bf.c
new file mode 100644 (file)
index 0000000..64115cc
--- /dev/null
@@ -0,0 +1,14 @@
+main()
+{
+    struct {
+       int first;
+       int second;
+       int a : 8;
+       int b : 8;
+       int c;
+    } x;
+
+    x.a = 2;
+    x.b = 10;
+    x.c = 1;
+}
diff --git a/usr/src/ucb/dbx/test/bug.c b/usr/src/ucb/dbx/test/bug.c
new file mode 100644 (file)
index 0000000..e33dc56
--- /dev/null
@@ -0,0 +1,24 @@
+typedef struct blah *Blah;
+typedef struct List *List;
+
+struct List {
+    int b;
+    char c;
+};
+
+struct blah {
+    int a;
+    List p;
+};
+
+main()
+{
+    struct blah b, *p;
+    struct List list;
+
+    p = &b;
+    b.a = 3;
+    b.p = &list;
+    b.p->b = 4;
+    b.p->c = 'c';
+}
diff --git a/usr/src/ucb/dbx/test/enum.c b/usr/src/ucb/dbx/test/enum.c
new file mode 100644 (file)
index 0000000..e957b7b
--- /dev/null
@@ -0,0 +1,15 @@
+typedef enum { RED, GREEN, BLUE } Color;
+
+main()
+{
+    Color c;
+
+    c = BLUE;
+    f(RED);
+}
+
+f(c)
+Color c;
+{
+    printf("c = %d\n", c);
+}
diff --git a/usr/src/ucb/dbx/test/float.c b/usr/src/ucb/dbx/test/float.c
new file mode 100644 (file)
index 0000000..a0385d0
--- /dev/null
@@ -0,0 +1,12 @@
+double f(x)
+double x;
+{
+    return 3.14*x;
+}
+
+main()
+{
+    double x;
+
+    x = f(3.0);
+}
diff --git a/usr/src/ucb/dbx/test/own.c b/usr/src/ucb/dbx/test/own.c
new file mode 100644 (file)
index 0000000..12721ab
--- /dev/null
@@ -0,0 +1,13 @@
+main()
+{
+    f(3);
+    f(4);
+}
+
+f(x)
+int x;
+{
+    static int ownx;
+
+    ownx = x;
+}
diff --git a/usr/src/ucb/dbx/test/reg.c b/usr/src/ucb/dbx/test/reg.c
new file mode 100644 (file)
index 0000000..52c4897
--- /dev/null
@@ -0,0 +1,30 @@
+struct blah {
+    int x;
+    int y;
+};
+
+main()
+{
+    register int i;
+    register struct blah *p;
+    register char *s;
+    struct blah b;
+    int j;
+
+    s = "this is a test";
+    s += 5;
+    j = 0;
+    p = &b;
+    p->x = 3;
+    p->y = 4;
+    for (i = 0; i < 2; i++) {
+       j = i;
+       put(i);
+    }
+}
+
+static put(i)
+register int i;
+{
+    printf("%d ", i);
+}
diff --git a/usr/src/ucb/dbx/test/struct.c b/usr/src/ucb/dbx/test/struct.c
new file mode 100644 (file)
index 0000000..84b4728
--- /dev/null
@@ -0,0 +1,24 @@
+struct blah {
+    int a;
+    struct {
+       int b;
+    } c;
+};
+
+struct blah f(x)
+int x;
+{
+    struct blah r;
+
+    r.a = x;
+    return r;
+}
+
+main()
+{
+    struct blah x;
+    struct blah *y;
+
+    x = f(3);
+    y = &x;
+}
diff --git a/usr/src/ucb/dbx/test/t.c b/usr/src/ucb/dbx/test/t.c
new file mode 100644 (file)
index 0000000..96f924d
--- /dev/null
@@ -0,0 +1,39 @@
+#include <stdio.h>
+
+typedef struct Blah *Blah;
+
+struct recursive {
+    int val;
+    struct recursive *next;
+    struct nest {
+       int a;
+    } n;
+} r;
+
+typedef int Integer;
+
+struct blah { int x, y; } z;
+int array[10];
+int i = 3;
+
+main(argc, argv)
+int argc;
+char **argv;
+{
+    struct blah p;
+    int a, b;
+    typedef enum color { RED, GREEN, BLUE } Color;
+    Color c;
+    double x;
+    float y;
+
+    printf("testing %s", argv[0]);
+    if (argc > 1) {
+       printf(" %s", argv[1]);
+    }
+    putchar('\n');
+    c = BLUE;
+    x = 3.5;
+    y = 4.6;
+    abort();
+}
diff --git a/usr/src/ucb/dbx/test/t1.c b/usr/src/ucb/dbx/test/t1.c
new file mode 100644 (file)
index 0000000..58a7ca5
--- /dev/null
@@ -0,0 +1,10 @@
+typedef struct Blah *Blah;
+
+Blah f();
+
+main()
+{
+    Blah x;
+
+    x = f();
+}
diff --git a/usr/src/ucb/dbx/test/x b/usr/src/ucb/dbx/test/x
new file mode 100644 (file)
index 0000000..587be6b
--- /dev/null
@@ -0,0 +1 @@
+x