aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr81814.c
blob: 16868c922fc36820845acaae5a09831383fcbd8b (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
28
29
30
31
32
33
34
35
36
/* PR middle-end/81814 */
/* { dg-do run { target int32plus } } */

int
main ()
{
  int i = 0x01000000;
  int a;

  a = ((signed char) i) != 0 ? 0 : (unsigned long long int) i;
  if (a != 0x01000000)
    __builtin_abort ();
  a = ((signed short int) i) != 0 ? 0 : (unsigned long long int) i;
  if (a != 0x01000000)
    __builtin_abort ();
  a = ((unsigned short int) i) != 0 ? 0 : (unsigned long long int) i;
  if (a != 0x01000000)
    __builtin_abort ();
  a = ((unsigned char) i) != 0 ? 0 : (unsigned long long int) i;
  if (a != 0x01000000)
    __builtin_abort ();
  a = ((signed char) i) == 0 ? (unsigned long long int) i : 0;
  if (a != 0x01000000)
    __builtin_abort ();
  a = ((signed short int) i) == 0 ? (unsigned long long int) i : 0;
  if (a != 0x01000000)
    __builtin_abort ();
  a = ((unsigned short int) i) == 0 ? (unsigned long long int) i : 0;
  if (a != 0x01000000)
    __builtin_abort ();
  a = ((unsigned char) i) == 0 ? (unsigned long long int) i : 0;
  if (a != 0x01000000)
    __builtin_abort ();

  return 0;
}