2 /* { dg-do compile { target int32 } } */
3 /* { dg-options "-O -Wno-shift-overflow" } */
4 /* { dg-additional-options "-std=c++11" { target c++ } } */
6 #define INTM1 (sizeof (int) * __CHAR_BIT__ - 1)
7 #define INTM2 (sizeof (int) * __CHAR_BIT__ - 2)
8 #define LLONGM1 (sizeof (long long) * __CHAR_BIT__ - 1)
9 #define LLONGM2 (sizeof (long long) * __CHAR_BIT__ - 2)
11 #define INT_MIN (-__INT_MAX__-1)
12 #define LONG_LONG_MIN (-__LONG_LONG_MAX__-1)
17 int i4
= __INT_MAX__
<< 2;
18 int i5
= __INT_MAX__
<< INTM1
;
21 int i8
= -10 << INTM2
;
22 int i9
= -__INT_MAX__
<< 2;
23 int i10
= -__INT_MAX__
<< INTM1
;
24 int i11
= INT_MIN
<< 1;
29 int r4
= __INT_MAX__
>> 2;
30 int r5
= __INT_MAX__
>> INTM1
;
33 int r8
= -10 >> INTM2
;
34 int r9
= -__INT_MAX__
>> 2;
35 int r10
= -__INT_MAX__
>> INTM1
;
37 unsigned u1
= 1 << INTM1
;
38 unsigned u2
= 9 << INTM1
;
39 unsigned u3
= 2U << INTM1
;
40 unsigned u4
= 9U << INTM1
;
41 unsigned u5
= 10U << INTM2
;
43 long long int l1
= 1LL << LLONGM1
;
44 long long int l2
= 9LL << LLONGM1
;
45 long long int l3
= 10LL << LLONGM2
;
46 long long int l4
= __LONG_LONG_MAX__
<< 2;
47 long long int l5
= __LONG_LONG_MAX__
<< LLONGM1
;
48 long long int l6
= -1LL << LLONGM1
;
49 long long int l7
= -9LL << LLONGM1
;
50 long long int l8
= -10LL << LLONGM2
;
51 long long int l9
= -__LONG_LONG_MAX__
<< 2;
52 long long int l10
= -__LONG_LONG_MAX__
<< LLONGM1
;
53 long long int l11
= LONG_LONG_MIN
<< 1;
59 const __SIZE_TYPE__ b
= INTM1
;