From 9fcc3e548358d6b1397e18fa2756c157a9877c71 Mon Sep 17 00:00:00 2001 From: rth Date: Thu, 20 Jun 2002 07:30:04 +0000 Subject: * c-common.c (c_common_get_alias_set): Correctly handle characters. Rearrange order of expressions; don't handle vectors here. * alias.c (get_alias_set): Let vectors match their components. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54821 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.c-torture/execute/20020619-1.c | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/execute/20020619-1.c (limited to 'gcc/testsuite/gcc.c-torture') diff --git a/gcc/testsuite/gcc.c-torture/execute/20020619-1.c b/gcc/testsuite/gcc.c-torture/execute/20020619-1.c new file mode 100644 index 00000000000..5ed4d00b01d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20020619-1.c @@ -0,0 +1,32 @@ +static int ref(void) +{ + union { + char c[5]; + int i; + } u; + + __builtin_memset (&u, 0, sizeof(u)); + u.c[0] = 1; + u.c[1] = 2; + u.c[2] = 3; + u.c[3] = 4; + + return u.i; +} + +#define MAX(a,b) (a < b ? b : a) + +static int test(void) +{ + char c[MAX(5, sizeof(int))] __attribute__((aligned)) = { 1, 2, 3, 4 }; + return *(int *)c; +} + +int main() +{ + int a = test(); + int b = ref(); + if (a != b) + abort (); + return 0; +} -- cgit v1.2.1