[cfe-commits] r58480 - /cfe/trunk/test/Analysis/stack-addr-ps.c
Ted Kremenek
kremenek at apple.com
Thu Oct 30 17:19:42 PDT 2008
Author: kremenek
Date: Thu Oct 30 19:19:42 2008
New Revision: 58480
URL: http://llvm.org/viewvc/llvm-project?rev=58480&view=rev
Log:
Enhance compound literal test case.
Modified:
cfe/trunk/test/Analysis/stack-addr-ps.c
Modified: cfe/trunk/test/Analysis/stack-addr-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/stack-addr-ps.c?rev=58480&r1=58479&r2=58480&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/stack-addr-ps.c (original)
+++ cfe/trunk/test/Analysis/stack-addr-ps.c Thu Oct 30 19:19:42 2008
@@ -18,12 +18,18 @@
return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}}
}
-void* compound_literal(int x) {
+void* compound_literal(int x, int y) {
if (x)
return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}}
int* array[] = {};
struct s { int z; double y; int w; };
- return &((struct s){ 2, 0.4, 5 * 8 }); // expected-warning{{Address of stack memory}}
+
+ if (y)
+ return &((struct s){ 2, 0.4, 5 * 8 }); // expected-warning{{Address of stack memory}}
+
+
+ void* p = &((struct s){ 42, 0.4, x ? 42 : 0 });
+ return p;
}
More information about the cfe-commits
mailing list