view clang/test/Analysis/svalbuilder-logic.c @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children c4bab56944e8
line wrap: on
line source

// RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -Wno-pointer-to-int-cast -verify %s
// expected-no-diagnostics

// Testing core functionality of the SValBuilder.

int SValBuilderLogicNoCrash(int *x) {
  return 3 - (int)(x +3);
}

// http://llvm.org/bugs/show_bug.cgi?id=15863
// Don't crash when mixing 'bool' and 'int' in implicit comparisons to 0.
void pr15863() {
  extern int getBool();
  _Bool a = getBool();
  (void)!a; // no-warning
}