modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/execute/20100416-1.c (about)

     1  void abort(void);
     2  
     3  int
     4  movegt(int x, int y, long long a)
     5  {
     6    int i;
     7    int ret = 0;
     8    for (i = 0; i < y; i++)
     9      {
    10        if (a >= (long long) 0xf000000000000000LL)
    11  	ret = x;
    12        else
    13  	ret = y;
    14      }
    15    return ret;
    16  }
    17  
    18  struct test
    19  {
    20    long long val;
    21    int ret;
    22  } tests[] = {
    23    { 0xf000000000000000LL, -1 },
    24    { 0xefffffffffffffffLL, 1 },
    25    { 0xf000000000000001LL, -1 },
    26    { 0x0000000000000000LL, -1 },
    27    { 0x8000000000000000LL, 1 },
    28  };
    29  
    30  int
    31  main()
    32  {
    33    int i;
    34    for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
    35      {
    36        if (movegt (-1, 1, tests[i].val) != tests[i].ret)
    37  	abort ();
    38      }
    39    return 0;
    40  }