diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-02-26 19:44:38 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-02-26 19:44:38 +0000 |
commit | 4238f41d484729aca260140fbbc53a68769bf60a (patch) | |
tree | b985488d66c1d4f0305a3d2bde872977fb7e2b5e /test/Analysis/conditional-operator-path-notes.c | |
parent | 9016bb771265a10f188c76342254badecc695253 (diff) |
[analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is a VarRegion.
Fixes PR15358 and <rdar://problem/13295437>.
Along the way, shorten path diagnostics that say "Variable 'x'" to just
be "'x'". By the context, it is obvious that we have a variable,
and so this just consumes text space.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/conditional-operator-path-notes.c')
-rw-r--r-- | test/Analysis/conditional-operator-path-notes.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/Analysis/conditional-operator-path-notes.c b/test/Analysis/conditional-operator-path-notes.c index d35460e436..c781ddf833 100644 --- a/test/Analysis/conditional-operator-path-notes.c +++ b/test/Analysis/conditional-operator-path-notes.c @@ -6,7 +6,7 @@ void testCondOp(int *p) { int *x = p ? p : p; // expected-note@-1 {{Assuming 'p' is null}} // expected-note@-2 {{'?' condition is false}} - // expected-note@-3 {{Variable 'x' initialized to a null pointer value}} + // expected-note@-3 {{'x' initialized to a null pointer value}} *x = 1; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}} // expected-note@-1 {{Dereference of null pointer (loaded from variable 'x')}} } @@ -40,7 +40,7 @@ void testRHSProblem(int *p) { void testBinaryCondOp(int *p) { int *x = p ?: p; // expected-note@-1 {{'?' condition is false}} - // expected-note@-2 {{Variable 'x' initialized to a null pointer value}} + // expected-note@-2 {{'x' initialized to a null pointer value}} *x = 1; // expected-warning{{Dereference of null pointer (loaded from variable 'x')}} // expected-note@-1 {{Dereference of null pointer (loaded from variable 'x')}} } @@ -216,9 +216,9 @@ void testBinaryLHSProblem(int *p) { // CHECK-NEXT: </array> // CHECK-NEXT: <key>depth</key><integer>0</integer> // CHECK-NEXT: <key>extended_message</key> -// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string> +// CHECK-NEXT: <string>'x' initialized to a null pointer value</string> // CHECK-NEXT: <key>message</key> -// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string> +// CHECK-NEXT: <string>'x' initialized to a null pointer value</string> // CHECK-NEXT: </dict> // CHECK-NEXT: <dict> // CHECK-NEXT: <key>kind</key><string>control</string> @@ -856,9 +856,9 @@ void testBinaryLHSProblem(int *p) { // CHECK-NEXT: </array> // CHECK-NEXT: <key>depth</key><integer>0</integer> // CHECK-NEXT: <key>extended_message</key> -// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string> +// CHECK-NEXT: <string>'x' initialized to a null pointer value</string> // CHECK-NEXT: <key>message</key> -// CHECK-NEXT: <string>Variable 'x' initialized to a null pointer value</string> +// CHECK-NEXT: <string>'x' initialized to a null pointer value</string> // CHECK-NEXT: </dict> // CHECK-NEXT: <dict> // CHECK-NEXT: <key>kind</key><string>control</string> |