18 lines · cpp
1// RUN: %clang_analyze_cc1 -analyzer-checker=core %s -ftime-trace=%t.raw.json -ftime-trace-granularity=0 -verify2// RUN: %python -c 'import json, sys; print(json.dumps(json.load(sys.stdin), indent=4))' < %t.raw.json > %t.formatted.json3// RUN: FileCheck --input-file=%t.formatted.json --check-prefix=CHECK %s4 5// The trace file is rather large, but it should contain at least one scope for removeDead:6//7// CHECK: "name": "ExprEngine::removeDead"8 9bool coin();10int f() {11 int x = 0;12 int y = 0;13 while (coin()) {14 x = 1;15 }16 return x / y; // expected-warning{{Division by zero}}17}18