brintos

brintos / llvm-project-archived public Read only

0
0
Text · 499 B · 8f8a803 Raw
20 lines · c
1// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-config suppress-null-return-paths=true -analyzer-output=text -verify %s2// expected-no-diagnostics3 4int *returnNull(void) { return 0; }5int coin(void);6 7// Use a float parameter to ensure that the value is unknown. This will create8// a cycle in the generated ExplodedGraph.9void testCycle(float i) {10  int *x = returnNull();11  int y; 12  while (i > 0) {13    x = returnNull();14    y = 2;15    i -= 1;16  }17  *x = 1; // no-warning18  y += 1;19}20