the run line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181854
91177308-0d34-0410-b5e6-
96231b3b80d8
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -verify %s -triple x86_64-linux-gnu
+// expected-no-diagnostics
+
+// PR15216
+// Don't crash when taking computing the offset of structs with large arrays.
+const unsigned long Size = (1l << 62);
+
+struct Chunk {
+ char padding[Size];
+ char more_padding[1][Size];
+ char data;
+};
+
+int test1 = __builtin_offsetof(struct Chunk, data);
+
return __builtin_offsetof(Array, array[*(int*)0]); // expected-warning{{indirection of non-volatile null pointer}} expected-note{{__builtin_trap}}
}
-// PR15216
-// Don't crash when taking computing the offset of structs with large arrays.
-const unsigned long Size = (1l << 62);
-
-struct Chunk {
- char padding[Size];
- char more_padding[1][Size];
- char data;
-};
-
-int test6 = __builtin_offsetof(struct Chunk, data);