]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Thu, 20 Jun 2002 07:35:46 +0000 (07:35 +0000)
committerNo Author <no-author@gcc.gnu.org>
Thu, 20 Jun 2002 07:35:46 +0000 (07:35 +0000)
'gcc-3_1-branch'.

From-SVN: r54822

gcc/testsuite/gcc.c-torture/execute/20020619-1.c [new file with mode: 0644]

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 (file)
index 0000000..5ed4d00
--- /dev/null
@@ -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;
+}