diff options
-rw-r--r-- | lib/CodeGen/CGValue.h | 2 | ||||
-rw-r--r-- | test/CodeGen/align-global-large.c | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/CodeGen/CGValue.h b/lib/CodeGen/CGValue.h index a46f313f1f..c2b8e4da82 100644 --- a/lib/CodeGen/CGValue.h +++ b/lib/CodeGen/CGValue.h @@ -128,7 +128,7 @@ class LValue { // 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; diff --git a/test/CodeGen/align-global-large.c b/test/CodeGen/align-global-large.c new file mode 100644 index 0000000000..fcbe758a82 --- /dev/null +++ b/test/CodeGen/align-global-large.c @@ -0,0 +1,18 @@ +// PR13606 - Clang crashes with large alignment attribute +// RUN: %clang -S -emit-llvm %s -o - | FileCheck %s + +// CHECK: x +// CHECK: align +// CHECK: 1048576 +volatile char x[4000] __attribute__((aligned(0x100000))); + +int +main (int argc, char ** argv) { + // CHECK: y + // CHECK: align + // CHECK: 1048576 + volatile char y[4000] __attribute__((aligned(0x100000))); + + return y[argc]; +} + |