Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/errno-1.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-do compile } */ | |
2 /* { dg-options "-O2" } */ | |
3 | |
4 #include <errno.h> | |
5 #include <stdlib.h> | |
6 | |
7 void do_not_optimize_away (); | |
8 | |
9 int main() | |
10 { | |
11 void * volatile p; | |
12 errno = 0; | |
13 /* The malloc call below may cause a -Walloc-size-larger-than warning. */ | |
14 p = malloc (-1); | |
15 if (errno != 0) | |
16 do_not_optimize_away (); | |
17 return 0; | |
18 } | |
19 | |
20 /* { dg-final { scan-assembler "do_not_optimize_away" } } */ | |
21 /* { dg-prune-output "exceeds maximum object size" } */ |