mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 09:36:05 +00:00

than GCC 4.2 here when building 32-bit (where GCC will allow allocation of an array for which we can't get a valid past-the-end pointer), and emulate its odd behavior in 64-bit where it only allows 63 bits worth of storage in the array. The former is a correctness issue; the latter is harmless in practice (you wouldn't be able to use such an array anyway) and helps us pass a GCC DejaGNU test. Fixes <rdar://problem/8212293>. llvm-svn: 111338
11 lines
373 B
C
11 lines
373 B
C
// RUN: %clang_cc1 -triple i686-apple-darwin -verify %s
|
|
|
|
void f() {
|
|
int x0[1073741824]; // expected-error{{array is too large}}
|
|
int x1[1073741824 + 1]; // expected-error{{array is too large}}
|
|
int x2[(unsigned)1073741824]; // expected-error{{array is too large}}
|
|
int x3[(unsigned)1073741824 + 1]; // expected-error{{array is too large}}
|
|
int x4[1073741824 - 1];
|
|
}
|
|
|