blob: ec098ff5515a33bfef3fdd6a3784a9886df38f1f (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/* PR c/37924 */
extern void abort (void);
signed char a;
unsigned char b;
int
test1 (void)
{
int c = -1;
return ((unsigned int) (a ^ c)) >> 9;
}
int
test2 (void)
{
int c = -1;
return ((unsigned int) (b ^ c)) >> 9;
}
int
main (void)
{
a = 0;
if (test1 () != (-1U >> 9))
abort ();
a = 0x40;
if (test1 () != (-1U >> 9))
abort ();
a = 0x80;
if (test1 () != (a < 0) ? 0 : (-1U >> 9))
abort ();
a = 0xff;
if (test1 () != (a < 0) ? 0 : (-1U >> 9))
abort ();
b = 0;
if (test2 () != (-1U >> 9))
abort ();
b = 0x40;
if (test2 () != (-1U >> 9))
abort ();
b = 0x80;
if (test2 () != (-1U >> 9))
abort ();
b = 0xff;
if (test2 () != (-1U >> 9))
abort ();
return 0;
}
|