14 lines · c
1// RUN: %check_clang_tidy %s misc-predictable-rand %t2 3extern int rand(void);4int nonrand(void);5 6int cTest(void) {7 int i = rand();8 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: rand() has limited randomness [misc-predictable-rand]9 10 int k = nonrand();11 12 return 0;13}14