view gcc/testsuite/gcc.target/cris/pr93372-31.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

/* Check that eliminable compare-instructions are eliminated. */
/* { dg-do compile } */
/* { dg-skip-if "" { "*-*-*" } { "-march=v0" } { "" } } */
/* { dg-options "-O2" { target march_option } } */
/* { dg-options "-O2 -march=v10" { target { ! march_option } } } */
/* { dg-final { scan-assembler-not "\tcmp|\ttest" } } */

#ifndef t
#define t int
#endif
#ifndef t2
#define t2 t
#endif
#ifndef t3
#define t3 t
#endif
#ifndef op
#define op(xx) __builtin_clz(xx)
#endif

extern t3 x;

t2 f(t a, t2 *b, t2 *d)
{
  t2 c = op(a);

  *b = c;

  if (c != 0)
    *d = c;

  return c;
}