aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/shift.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/shift.c')
-rw-r--r--test/Sema/shift.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/Sema/shift.c b/test/Sema/shift.c
index d35554488513..07c5fe5280ed 100644
--- a/test/Sema/shift.c
+++ b/test/Sema/shift.c
@@ -39,7 +39,8 @@ void test() {
i = 1 << (WORD_BIT - 2);
i = 2 << (WORD_BIT - 1); // expected-warning {{bits to represent, but 'int' only has}}
i = 1 << (WORD_BIT - 1); // expected-warning {{sets the sign bit of the shift expression}}
- i = -1 << (WORD_BIT - 1);
+ i = -1 << (WORD_BIT - 1); // expected-warning {{shifting a negative signed value is undefined}}
+ i = -1 << 0; // expected-warning {{shifting a negative signed value is undefined}}
i = 0 << (WORD_BIT - 1);
i = (char)1 << (WORD_BIT - 2);
@@ -48,7 +49,7 @@ void test() {
u = 5U << (WORD_BIT - 1);
long long int lli;
- lli = INT_MIN << 2; // expected-warning {{bits to represent, but 'int' only has}}
+ lli = INT_MIN << 2; // expected-warning {{shifting a negative signed value is undefined}}
lli = 1LL << (sizeof(long long) * CHAR_BIT - 2);
}