Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / c-c++-common / asan / rlimit-mmap-test-1.c
blob9dbbc85f4f30b5ccbf4bd7bb83a73001de1786c2
1 /* Check that we properly report mmap failure. */
3 /* { dg-do run { target setrlimit } } */
4 /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
5 /* { dg-require-effective-target hw } */
6 /* { dg-shouldfail "asan" } */
8 #include <stdlib.h>
9 #include <assert.h>
10 #include <sys/time.h>
11 #include <sys/resource.h>
13 static volatile void *x;
15 int main(int argc, char **argv) {
16 struct rlimit mmap_resource_limit = { 0, 0 };
17 if (setrlimit(RLIMIT_AS, &mmap_resource_limit)) return 1;
18 x = malloc(10000000);
19 return 0;
22 /* { dg-output "ERROR: Failed to mmap" } */