aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr101145inf.c
blob: 70aea94b6e0ba1c0de928f1ffeb9579ed7065684 (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
/* { dg-require-effective-target alarm } */
/* { dg-require-effective-target signal } */
/* { dg-additional-options "-O3" } */
#include <limits.h>
#include "pr101145inf.inc"

__attribute__ ((noinline))
unsigned foo(unsigned val, unsigned start)
{
  unsigned cnt = 0;
  for (unsigned i = start; val <= i; i+=16)
    cnt++;
  return cnt;
}

void test_finite ()
{
  unsigned n = foo (16, UINT_MAX - 32);
  if (n != 3)
    __builtin_abort ();
}

void test_infinite ()
{
 foo (15, UINT_MAX - 32);
}