brintos

brintos / llvm-project-archived public Read only

0
0
Text · 701 B · e47e150 Raw
30 lines · c
1// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.DumpTraversal %s | FileCheck %s2// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.DumpTraversal -DUSE_EXPR %s | FileCheck %s3 4int a(void);5int b(void);6int c(void);7 8#ifdef USE_EXPR9#define CHECK(x) ((x) & 1)10#else11#define CHECK(x) (x)12#endif13 14// CHECK: --BEGIN FUNCTION--15void testRemoveDeadBindings(void) {16  int i = a();17  if (CHECK(i))18    a();19  else20    b();21 22  // At this point the symbol bound to 'i' is dead.23  // The effects of a() and b() are identical (they both invalidate globals).24  // We should unify the two paths here and only get one end-of-path node.25  c();26}27 28// CHECK: --END FUNCTION--29// CHECK-NOT: --END FUNCTION--30