aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-01-04 23:54:04 +0000
committerAnna Zaks <ganna@apple.com>2012-01-04 23:54:04 +0000
commit273c3a3a3f009e26349ad9dfe67eaaa12db43af4 (patch)
tree8b6e2b0c473566869330cd31c3e448f47b34ab02
parenteb31a76d1cdaaf8874c549dc6bd964ff270d3822 (diff)
[analyzer] Add another tests to taint tester.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147570 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/taint-tester.c9
1 files changed, 9 insertions, 0 deletions
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.