blob: 7759aa73b33b32a2f45158888f3f2abb159b4b3a [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
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Ted Kremenek88c8bc82010-01-15 08:20:31 +00003
4// This file complements 'security-syntax-checks.m', but tests that we omit
5// specific checks on platforms where they don't make sense.
6
7// Omit the 'rand' check since 'arc4random' is not available on Linux.
8int rand(void);
9double drand48(void);
10double erand48(unsigned short[3]);
11long jrand48(unsigned short[3]);
12void lcong48(unsigned short[7]);
13long lrand48(void);
14long mrand48(void);
15long nrand48(unsigned short[3]);
16long random(void);
17int rand_r(unsigned *);
18
19void test_rand()
20{
21 unsigned short a[7];
22 unsigned b;
23
24 rand(); // no-warning
25 drand48(); // no-warning
26 erand48(a); // no-warning
27 jrand48(a); // no-warning
28 lcong48(a); // no-warning
29 lrand48(); // no-warning
30 mrand48(); // no-warning
31 nrand48(a); // no-warning
32 rand_r(&b); // no-warning
33 random(); // no-warning
34}