aboutsummaryrefslogtreecommitdiffstats
path: root/test/Sema/builtin-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/Sema/builtin-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/Sema/builtin-object-size.c')
-rw-r--r--test/Sema/builtin-object-size.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Sema/builtin-object-size.c b/test/Sema/builtin-object-size.c
index 14674c66f3a6..300c739bbd14 100644
--- a/test/Sema/builtin-object-size.c
+++ b/test/Sema/builtin-object-size.c
@@ -76,3 +76,18 @@ int pr28314(void) {
a += __builtin_object_size(p3->b, 0);
return a;
}
+
+int pr31843() {
+ int n = 0;
+
+ struct { int f; } a;
+ int b;
+ n += __builtin_object_size(({&(b ? &a : &a)->f; pr31843;}), 0); // expected-warning{{expression result unused}}
+
+ struct statfs { char f_mntonname[1024];};
+ struct statfs *outStatFSBuf;
+ n += __builtin_object_size(outStatFSBuf->f_mntonname ? "" : "", 1); // expected-warning{{address of array}}
+ n += __builtin_object_size(outStatFSBuf->f_mntonname ?: "", 1);
+
+ return n;
+}