[cfe-commits] r58447 - /cfe/trunk/test/Analysis/stack-addr-ps.c

Ted Kremenek kremenek at apple.com
Thu Oct 30 11:46:50 PDT 2008


Author: kremenek
Date: Thu Oct 30 13:46:50 2008
New Revision: 58447

URL: http://llvm.org/viewvc/llvm-project?rev=58447&view=rev
Log:
Improve 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=58447&r1=58446&r2=58447&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/stack-addr-ps.c (original)
+++ cfe/trunk/test/Analysis/stack-addr-ps.c Thu Oct 30 13:46:50 2008
@@ -18,7 +18,11 @@
   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 });
 }
 





More information about the cfe-commits mailing list