summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-20 07:30:04 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-20 07:30:04 +0000
commit9fcc3e548358d6b1397e18fa2756c157a9877c71 (patch)
tree0c4e881b9c304c27324e19124ed29268823cef27 /gcc/testsuite/gcc.c-torture
parentb01de2c1ed8167a1480f9ba9fc84735d440640ab (diff)
downloadgcc-9fcc3e548358d6b1397e18fa2756c157a9877c71.tar.gz
* 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
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20020619-1.c32
1 files changed, 32 insertions, 0 deletions
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;
+}