summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/object-size.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/object-size.c')
-rw-r--r--test/CodeGen/object-size.c19
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);
+}