38 lines · c
1// RUN: %clang_analyze_cc1 -triple i686-pc-linux-gnu %s -verify \2// RUN: -analyzer-checker=security.insecureAPI \3// RUN: -analyzer-checker=security.FloatLoopCounter4 5// expected-no-diagnostics6 7// This file complements 'security-syntax-checks.m', but tests that we omit8// specific checks on platforms where they don't make sense.9 10// Omit the 'rand' check since 'arc4random' is not available on Linux.11int rand(void);12double drand48(void);13double erand48(unsigned short[3]);14long jrand48(unsigned short[3]);15void lcong48(unsigned short[7]);16long lrand48(void);17long mrand48(void);18long nrand48(unsigned short[3]);19long random(void);20int rand_r(unsigned *);21 22void test_rand(void)23{24 unsigned short a[7];25 unsigned b;26 27 rand(); // no-warning28 drand48(); // no-warning29 erand48(a); // no-warning30 jrand48(a); // no-warning31 lcong48(a); // no-warning32 lrand48(); // no-warning33 mrand48(); // no-warning34 nrand48(a); // no-warning35 rand_r(&b); // no-warning36 random(); // no-warning37}38