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