aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-10-30 18:46:50 +0000
committerTed Kremenek <kremenek@apple.com>2008-10-30 18:46:50 +0000
commitd4a07988c8ba6b214e8d93c3a4048357484ba771 (patch)
tree4436c7e2b63a78da4e6db66583db5c4b5747b23f
parent4456da5c596693195f440126c52ebc096ad1820d (diff)
Improve compound literal test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58447 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/stack-addr-ps.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/Analysis/stack-addr-ps.c b/test/Analysis/stack-addr-ps.c
index d0294aa9d3..9bf8954110 100644
--- a/test/Analysis/stack-addr-ps.c
+++ b/test/Analysis/stack-addr-ps.c
@@ -18,7 +18,11 @@ int* f3(int x, int *y) {
return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}}
}
-unsigned short* compound_literal() {
- return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}}
+void* compound_literal(int x) {
+ if (x)
+ return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}}
+
+ struct s { int z; double y; int w; };
+ return &((struct s){ 2, 0.4, 5 * 8 });
}