• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // canonicalize to == or !=
cmp_ltu_eq0(unsigned int x)2 int cmp_ltu_eq0(unsigned int x) { return (x <  1) == (x == 0); }
cmp_geu_ne0(unsigned int x)3 int cmp_geu_ne0(unsigned int x) { return (x >= 1) == (x != 0); }
4 
5 // canonicalize to the smaller value
cmp_ltu(unsigned int x)6 int cmp_ltu(unsigned int x) { return (x <  256) == (x <= 255); }
cmp_geu(unsigned int x)7 int cmp_geu(unsigned int x) { return (x >= 256) == (x >  255); }
8 
9 /*
10  * check-name: canonical-cmpu
11  * check-command: test-linearize -Wno-decl $file
12  *
13  * check-output-ignore
14  * check-output-returns: 1
15  */
16