aboutsummaryrefslogtreecommitdiffstats
path: root/test/FrontendC/2007-05-29-UnionCopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/FrontendC/2007-05-29-UnionCopy.c')
-rw-r--r--test/FrontendC/2007-05-29-UnionCopy.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/FrontendC/2007-05-29-UnionCopy.c b/test/FrontendC/2007-05-29-UnionCopy.c
new file mode 100644
index 0000000..ded67d4
--- /dev/null
+++ b/test/FrontendC/2007-05-29-UnionCopy.c
@@ -0,0 +1,18 @@
+// RUN: %llvmgcc -S -o - -emit-llvm %s | grep memcpy
+// PR1421
+
+struct A {
+ char c;
+ int i;
+};
+
+struct B {
+ int c;
+ unsigned char x;
+};
+
+union U { struct A a; struct B b; };
+
+void check(union U *u, union U *v) {
+ *u = *v;
+}