diff options
Diffstat (limited to 'test/Analysis/simple-stream-checks.c')
-rw-r--r-- | test/Analysis/simple-stream-checks.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Analysis/simple-stream-checks.c b/test/Analysis/simple-stream-checks.c index ca1c781575470..f37a7039f5e3b 100644 --- a/test/Analysis/simple-stream-checks.c +++ b/test/Analysis/simple-stream-checks.c @@ -89,3 +89,8 @@ void testPassToSystemHeaderFunctionIndirectly() { fs.p = fopen("myfile.txt", "w"); fakeSystemHeaderCall(&fs); // invalidates fs, making fs.p unreachable } // no-warning + +void testOverwrite() { + FILE *fp = fopen("myfile.txt", "w"); + fp = 0; +} // expected-warning {{Opened file is never closed; potential resource leak}} |