view gcc/testsuite/gcc.dg/analyzer/params.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
line wrap: on
line source

#include "analyzer-decls.h"

static int called_function(int j)
{
  int k;

  __analyzer_eval (j > 4); /* { dg-warning "TRUE" } */

  k = j - 1;

  __analyzer_eval (k > 3); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
  /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
  /* TODO(xfail): we're not then updating based on the assignment.  */

  return k;
}

void test(int i)
{
  __analyzer_eval (i > 4); /* { dg-warning "UNKNOWN" } */

  if (i > 4) {

    __analyzer_eval (i > 4); /* { dg-warning "TRUE" } */

    i = called_function(i);

    __analyzer_eval (i > 3); /* { dg-warning "TRUE" "desired" { xfail *-*-* } } */
    /* { dg-warning "UNKNOWN" "status quo" { target *-*-* } .-1 } */
    /* TODO(xfail): we're not updating from the returned value.  */
  }

  __analyzer_eval (i > 3); /* { dg-warning "UNKNOWN" } */
}