aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/offsetof.c
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-10-17 05:48:07 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-10-17 05:48:07 +0000
commitd82e5d30930f80a92c1270e270fdb475e3718d25 (patch)
treeee59e066c80fb979c212049b6b88c0af05125b0b /test/Sema/offsetof.c
parent909c5553afb68743cf793dd7d5d82bdf5fa0bba7 (diff)
Perform an lvalue-to-rvalue conversion on an array index in a __builtin_offsetof expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142179 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/offsetof.c')
-rw-r--r--test/Sema/offsetof.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/offsetof.c b/test/Sema/offsetof.c
index 5026193943..46fb515c7f 100644
--- a/test/Sema/offsetof.c
+++ b/test/Sema/offsetof.c
@@ -65,3 +65,7 @@ int test3 = __builtin_offsetof(struct has_bitfields, j); // expected-error{{cann
typedef struct Array { int array[1]; } Array;
int test4 = __builtin_offsetof(Array, array);
+
+int test5() {
+ return __builtin_offsetof(Array, array[*(int*)0]); // expected-warning{{indirection of non-volatile null pointer}} expected-note{{__builtin_trap}}
+}