From 1c6f15d755178e0eccd3a9959565606c3f8045d2 Mon Sep 17 00:00:00 2001 From: Richard Trieu Date: Wed, 15 May 2013 00:44:06 +0000 Subject: [PATCH] Move a test that requires 64-bit mode to a separate test with a triple in the run line. llvm-svn: 181854 --- clang/test/Sema/offsetof-64.c | 15 +++++++++++++++ clang/test/Sema/offsetof.c | 11 ----------- 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 clang/test/Sema/offsetof-64.c diff --git a/clang/test/Sema/offsetof-64.c b/clang/test/Sema/offsetof-64.c new file mode 100644 index 000000000000..1cabec9842f5 --- /dev/null +++ b/clang/test/Sema/offsetof-64.c @@ -0,0 +1,15 @@ +// 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); + diff --git a/clang/test/Sema/offsetof.c b/clang/test/Sema/offsetof.c index 4e7fd7f29e9e..9e876ad5898e 100644 --- a/clang/test/Sema/offsetof.c +++ b/clang/test/Sema/offsetof.c @@ -70,14 +70,3 @@ int test5() { 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);