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
diff --git a/test/Sema/offsetof.c b/test/Sema/offsetof.c
index 5026193..46fb515 100644
--- a/test/Sema/offsetof.c
+++ b/test/Sema/offsetof.c
@@ -65,3 +65,7 @@
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}}
+}