aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/object-size.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-02-17 19:36:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-02-17 19:36:19 +0000
commiteb2854521a26d3f186018f1b119761ca7bb90dc2 (patch)
tree8cb7e2fc50b6c6580827cc26dc7c9a5921b4bdb2 /test/CodeGen/object-size.c
parent3bae5253046bf2859f76e3d0d22f47a5fc0844c7 (diff)
downloadsrc-eb2854521a26d3f186018f1b119761ca7bb90dc2.tar.gz
src-eb2854521a26d3f186018f1b119761ca7bb90dc2.zip
Vendor import of clang release_40 branch r295380:vendor/clang/clang-release_40-r295380
Notes
Notes: svn path=/vendor/clang/dist/; revision=313883 svn path=/vendor/clang/clang-release_40-r295380/; revision=313884; tag=vendor/clang/clang-release_40-r295380
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 fe4c1859a272..a824f554b5f4 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);
+}