From: Anna Zaks Date: Wed, 4 Jan 2012 23:54:04 +0000 (+0000) Subject: [analyzer] Add another tests to taint tester. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=273c3a3a3f009e26349ad9dfe67eaaa12db43af4;p=clang [analyzer] Add another tests to taint tester. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147570 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/taint-tester.c b/test/Analysis/taint-tester.c index 4aa170ce21..1f97fbab0f 100644 --- a/test/Analysis/taint-tester.c +++ b/test/Analysis/taint-tester.c @@ -151,6 +151,15 @@ void stdinTest3() { int jjj = iii;// expected-warning + {{tainted}} } +// Test that stdin does not get invalidated by calls. +void foo(); +void stdinTest4() { + int i; + fscanf(stdin, "%d", &i); + foo(); + int j = i; // expected-warning + {{tainted}} +} + // Test propagation functions - the ones that propagate taint from arguments to // return value, ptr arguments.