aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
blob: ada3ac984451420c4477b29a6e9d6b0820ef12f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do run } */
/* { dg-require-effective-target int32 } */
/* { dg-options "-O2" } */

#include <stdint.h>

int8_t b[1];
int8_t *d = b;
int32_t c;

int main() {
  b[0] = -40;
  uint16_t t = (uint16_t)d[0];

  c = (t < 0xFFF6 ? t : 0xFFF6) + 9;

  if (c != 65505)
    __builtin_abort ();
}