From 3fdd243182b1cb2fb7667ecfffe6692b6fce4ddf Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 30 May 2007 05:37:18 +0000 Subject: [PATCH] new testcase for PR1421 llvm-svn: 37356 --- test/CFrontend/2007-05-29-UnionCopy.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/CFrontend/2007-05-29-UnionCopy.c diff --git a/test/CFrontend/2007-05-29-UnionCopy.c b/test/CFrontend/2007-05-29-UnionCopy.c new file mode 100644 index 00000000000..ded67d4d6b2 --- /dev/null +++ b/test/CFrontend/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; +}