aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/abs-1.c
blob: d6ce8d6afad9aa9fc3e5d9c552c589fbc1ecf87d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "analyzer-decls.h"

extern long int labs (long int x)
  __attribute__ ((__nothrow__ , __leaf__))
  __attribute__ ((__const__));

long int test_1 (long int x)
{
  return labs (x);
}

static long __attribute__((noinline))
hide_long (long x)
{
  return x;
}
  
long int test_2 (long int x)
{
  __analyzer_eval (labs (hide_long (42)) == 42); /* { dg-warning "TRUE" } */
  __analyzer_eval (labs (hide_long (-17)) == 17); /* { dg-warning "TRUE" } */
}