aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/pr103798-8.c
blob: 0841b18cea44cd15b42df5f300cff4ab9c1a746c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* { dg-do run { target int128 } } */
/* { dg-options "-O2 -fdump-tree-optimized -save-temps" } */

__attribute__ ((weak))
int f(int a)
{
   return  __builtin_memchr ("aEgiHx19ABC", a, 8) != 0;
}

__attribute__ ((weak))
int g(char a)
{
  return (a == 'a' || a == 'E' || a == 'g' || a == 'i' || a == 'H'
	  || a == 'x' || a == '1' || a == '9');
}

int
main ()
{
 for (int i = 0; i < 255; i++)
   if (f (i + 256) != g (i + 256))
     __builtin_abort ();

 return 0;
}

/* { dg-final { scan-assembler-not "memchr" } } */