Dear All,

Here's an updated patch with a test case that uses FileCheck.

Should I go ahead and commit?

-- John T.

Index: test/CodeGen/align-global-large.c
===================================================================
--- test/CodeGen/align-global-large.c   (revision 0)
+++ test/CodeGen/align-global-large.c   (revision 0)
@@ -0,0 +1,23 @@
+// PR13606 - Clang crashes with large alignment attribute
+// RUN: %clang -S -emit-llvm %s -o - | FileCheck %s
+
+#include <stdio.h>
+#include <stdlib.h>
+
+// CHECK: x
+// CHECK: align
+// CHECK: 1048576
+char x[4000] __attribute__((aligned(0x100000)));
+
+int
+main (int argc, char ** argv) {
+  // CHECK: y
+  // CHECK: align
+  // CHECK: 1048576
+  char y[4000] __attribute__((aligned(0x100000)));
+  printf("x is %p\n", x);
+  printf("y is %p\n", y);
+
+  return 0;
+}
+
Index: lib/CodeGen/CGValue.h
===================================================================
--- lib/CodeGen/CGValue.h       (revision 161950)
+++ lib/CodeGen/CGValue.h       (working copy)
@@ -128,7 +128,7 @@
 
   // The alignment to use when accessing this lvalue.  (For vector elements,
   // this is the alignment of the whole vector.)
-  unsigned short Alignment;
+  int64_t Alignment;
 
   // objective-c's ivar
   bool Ivar:1;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to