add testcase for union cast
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 1 Sep 2008 00:21:05 +0000 (00:21 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 1 Sep 2008 00:21:05 +0000 (00:21 +0000)
[r21611]

parsetest/gnu99/union_cast.c [new file with mode: 0644]

diff --git a/parsetest/gnu99/union_cast.c b/parsetest/gnu99/union_cast.c
new file mode 100644 (file)
index 0000000..088aa48
--- /dev/null
@@ -0,0 +1,16 @@
+union foo { int i; double d; };
+int x;
+double y;
+
+union foo u;
+
+void hack (union foo p) {
+       y = p.d;
+}
+
+int main(int argc, char *argv[]) {
+       u = (union foo) x;
+
+       hack ((union foo) x);
+       return 0;
+}