diff options
author | Hans Wennborg <hans@hanshq.net> | 2017-02-14 19:03:31 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2017-02-14 19:03:31 +0000 |
commit | 77a08a4030acb0db81ed9bc123792ef54db75088 (patch) | |
tree | 92c8d6f42c88489a5a798c0e8012398336247c45 /test/CodeGen/object-size.c | |
parent | bf0d36c617910427a28bf90911b398437841bd51 (diff) |
Merging r294800:
------------------------------------------------------------------------
r294800 | gbiv | 2017-02-10 14:52:29 -0800 (Fri, 10 Feb 2017) | 10 lines
Don't let EvaluationModes dictate whether an invalid base is OK
What we want to actually control this behavior is something more local
than an EvalutationMode. Please see the linked revision for more
discussion on why/etc.
This fixes PR31843.
Differential Revision: https://reviews.llvm.org/D29469
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@295087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/object-size.c')
-rw-r--r-- | test/CodeGen/object-size.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/object-size.c b/test/CodeGen/object-size.c index fe4c1859a2..a824f554b5 100644 --- a/test/CodeGen/object-size.c +++ b/test/CodeGen/object-size.c @@ -549,3 +549,22 @@ int incomplete_and_function_types() { // CHECK: store i32 0 gi = __builtin_object_size(incomplete_char_array, 3); } + +// Flips between the pointer and lvalue evaluator a lot. +void deeply_nested() { + struct { + struct { + struct { + struct { + int e[2]; + char f; // Inhibit our writing-off-the-end check + } d[2]; + } c[2]; + } b[2]; + } *a; + + // CHECK: store i32 4 + gi = __builtin_object_size(&a->b[1].c[1].d[1].e[1], 1); + // CHECK: store i32 4 + gi = __builtin_object_size(&a->b[1].c[1].d[1].e[1], 3); +} |