summaryrefslogtreecommitdiff
path: root/test/Sema/integer-overflow.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-01-13 20:00:46 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-01-13 20:00:46 +0000
commit0414e226b73ef7952be3ef346c1c802e7f036f54 (patch)
treeff0114c0524108a01707e4101f3224db0d7fd01f /test/Sema/integer-overflow.c
parent97b17066aaac3f1590a809d79abe98fde03821ec (diff)
Notes
Diffstat (limited to 'test/Sema/integer-overflow.c')
-rw-r--r--test/Sema/integer-overflow.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Sema/integer-overflow.c b/test/Sema/integer-overflow.c
index 44fbcd4c818e..db5c1f4c7118 100644
--- a/test/Sema/integer-overflow.c
+++ b/test/Sema/integer-overflow.c
@@ -145,3 +145,11 @@ uint64_t check_integer_overflows(int i) {
// expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}}
return ((4608 * 1024 * 1024) + ((uint64_t)(4608 * 1024 * 1024)));
}
+
+struct s {
+ unsigned x;
+ unsigned y;
+} s = {
+ .y = 5,
+ .x = 4 * 1024 * 1024 * 1024 // expected-warning {{overflow in expression; result is 0 with type 'int'}}
+};