diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/test/Analysis/null-deref-ps.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Analysis/null-deref-ps.c b/clang/test/Analysis/null-deref-ps.c index c3bf4444207..3d912dcd088 100644 --- a/clang/test/Analysis/null-deref-ps.c +++ b/clang/test/Analysis/null-deref-ps.c @@ -65,6 +65,15 @@ int f6(int *p) { : bar(p, 0); // no-warning } +int bar2(int* p, int q) __attribute__((nonnull(1))); + +int f6b(int *p) { + return !p ? bar2(p, 1) // expected-warning {{Null pointer passed as an argument to a 'nonnull' parameter}} + : bar2(p, 0); // no-warning +} + + + int* qux(); int f7(int x) { |

