mirror of
https://github.com/dlang/dmd.git
synced 2025-04-29 14:40:12 +03:00
add tests for overflow, fix bugs encountered
This commit is contained in:
parent
9e3a734360
commit
31e27cb150
3 changed files with 40 additions and 3 deletions
24
test/fail_compilation/staticarrayoverflow.d
Normal file
24
test/fail_compilation/staticarrayoverflow.d
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
REQUIRED_ARGS: -m64
|
||||
PERMUTE_ARGS:
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/staticarrayoverflow.d(21): Error: static array S[1879048192] size overflowed to 7516192768000
|
||||
fail_compilation/staticarrayoverflow.d(21): Error: variable staticarrayoverflow.y size overflow
|
||||
fail_compilation/staticarrayoverflow.d(22): Error: variable staticarrayoverflow.z size of x1000ae0 exceeds max allowed size 0x100_0000
|
||||
fail_compilation/staticarrayoverflow.d(23): Error: static array S[8070450532247928832] size overflowed to 0
|
||||
fail_compilation/staticarrayoverflow.d(23): Error: variable staticarrayoverflow.a size overflow
|
||||
---
|
||||
*/
|
||||
|
||||
|
||||
|
||||
struct S
|
||||
{
|
||||
int[1000] x;
|
||||
}
|
||||
|
||||
S[0x7000_0000] y;
|
||||
S[0x100_0000/(4*1000 - 1)] z;
|
||||
S[0x7000_0000_0000_0000] a;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue