summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr81015.c
blob: 92e53f1989f34af3a3eba565056bb2765c33899b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do run } */
/* { dg-options "-O2 -mlzcnt" } */
/* { dg-require-effective-target lzcnt } */

#include "lzcnt-check.h"

int
__attribute__ ((noinline, noclone))
foo (unsigned short a)
{
  return __builtin_clz (a);
}

static void
lzcnt_test ()
{
  int res = foo (1);

  if (res != 31)
    abort ();
}