blob: 21be5e4bd3f4d1daa3f67f01d9a04464ed70437c [file] [log] [blame]
Ted Kremenekcdc3a892012-08-24 20:39:55 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix,osx,alpha.unix,alpha.security.taint -analyzer-store region -verify %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Jordan Rose5ef6e942012-07-10 23:13:01 +00003
4class Evil {
5public:
6 void system(int); // taint checker
7 void malloc(void *); // taint checker, malloc checker
8 void free(); // malloc checker, keychain checker
9 void fopen(); // stream checker
10 void feof(int, int); // stream checker
11 void open(); // unix api checker
12};
13
14void test(Evil &E) {
15 // no warnings, no crashes
16 E.system(0);
17 E.malloc(0);
18 E.free();
19 E.fopen();
20 E.feof(0,1);
21 E.open();
22}