blob: c2869cabae99b76804dc027d36821a0c5f304425 [file] [log] [blame]
Ted Kremenek76a54242012-01-20 01:44:29 +00001// RUN: %clang_cc1 -triple i686-pc-linux-gnu -analyze -analyzer-checker=security.insecureAPI,security.FloatLoopCounter %s -verify
Ted Kremenek88c8bc82010-01-15 08:20:31 +00002
3// This file complements 'security-syntax-checks.m', but tests that we omit
4// specific checks on platforms where they don't make sense.
5
6// Omit the 'rand' check since 'arc4random' is not available on Linux.
7int rand(void);
8double drand48(void);
9double erand48(unsigned short[3]);
10long jrand48(unsigned short[3]);
11void lcong48(unsigned short[7]);
12long lrand48(void);
13long mrand48(void);
14long nrand48(unsigned short[3]);
15long random(void);
16int rand_r(unsigned *);
17
18void test_rand()
19{
20 unsigned short a[7];
21 unsigned b;
22
23 rand(); // no-warning
24 drand48(); // no-warning
25 erand48(a); // no-warning
26 jrand48(a); // no-warning
27 lcong48(a); // no-warning
28 lrand48(); // no-warning
29 mrand48(); // no-warning
30 nrand48(a); // no-warning
31 rand_r(&b); // no-warning
32 random(); // no-warning
33}