more tests
authorMatthias Braun <matze@braunis.de>
Mon, 14 Jul 2008 14:27:08 +0000 (14:27 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 14 Jul 2008 14:27:08 +0000 (14:27 +0000)
[r20452]

parsetest/bitfield.c [new file with mode: 0644]
parsetest/precedence.c [new file with mode: 0644]

diff --git a/parsetest/bitfield.c b/parsetest/bitfield.c
new file mode 100644 (file)
index 0000000..e418d19
--- /dev/null
@@ -0,0 +1,19 @@
+int printf(const char *str, ...);
+
+int main(void) {
+       struct {
+               int a : 8;
+               int b : 12;
+       } s;
+
+       s.b = 0xff;
+       s.a = 0;
+       s.a += 20;
+       s.a /= 2;
+       s.a %= 4;
+       s.a -= 12;
+       s.a++;
+       s.b--;
+       printf("%d %d\n", s.a, s.b);
+       return 0;
+}
diff --git a/parsetest/precedence.c b/parsetest/precedence.c
new file mode 100644 (file)
index 0000000..61643c1
--- /dev/null
@@ -0,0 +1,10 @@
+int printf(const char *std, ...);
+
+int h(int a, int b) {
+       return 1 << a % b;
+}
+
+int main(void) {
+       printf("%d\n", h(5, 2));
+       return 0;
+}