summaryrefslogtreecommitdiffstats
path: root/test/Analysis/stack-addr-ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/stack-addr-ps.c')
-rw-r--r--test/Analysis/stack-addr-ps.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Analysis/stack-addr-ps.c b/test/Analysis/stack-addr-ps.c
index 2f7a4bd..0d7a703 100644
--- a/test/Analysis/stack-addr-ps.c
+++ b/test/Analysis/stack-addr-ps.c
@@ -41,3 +41,19 @@ void* alloca_test() {
return p; // expected-warning{{Address of stack memory}}
}
+int array_test(int x[2]) {
+ return x[0]; // no-warning
+}
+
+struct baz {
+ int x;
+ int y[2];
+};
+
+int struct_test(struct baz byVal, int flag) {
+ if (flag)
+ return byVal.x; // no-warning
+ else {
+ return byVal.y[0]; // no-warning
+ }
+}
OpenPOWER on IntegriCloud