]> granicus.if.org Git - clang/commitdiff
Add missing "expected warning".
authorTed Kremenek <kremenek@apple.com>
Thu, 30 Oct 2008 23:17:05 +0000 (23:17 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 30 Oct 2008 23:17:05 +0000 (23:17 +0000)
Add compound literal with empty initializer (just to test the analyzer handles it).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58470 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/stack-addr-ps.c

index 9bf89541107344cdf61f3ce2dd9e8c3fd39d7da3..7eead3bb20dc7612c6e814cb333ade95529e6012 100644 (file)
@@ -21,8 +21,9 @@ int* f3(int x, int *y) {
 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}}
-  
+
+  int* array[] = {};
   struct s { int z; double y; int w; };
-  return &((struct s){ 2, 0.4, 5 * 8 });
+  return &((struct s){ 2, 0.4, 5 * 8 }); // expected-warning{{Address of stack memory}}
 }