Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/gcc.dg/cpp/defined-syshdr.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/gcc.dg/cpp/defined-syshdr.c Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,27 @@ +# 1 "defined-syshdr.c" 1 +/* { dg-do preprocess } */ +/* { dg-options "-Wexpansion-to-defined" } */ + +#define defined_outside_sys_hdr defined FOO + +# 36 "some-system-header.h" 1 3 + +#define defined_inside_sys_hdr defined FOO + +/* In a system header, it's acceptable. */ +#if defined_outside_sys_hdr /* { dg-bogus "may not be portable" } */ +#endif + +# 16 "defined-syshdr.c" 2 + +/* Back to _not_ in a system header */ + +#if defined_outside_sys_hdr /* { dg-message "may not be portable" } */ +#endif + +/* Currently we warn about this, but it is probably a good idea not to. */ + +#if defined_inside_sys_hdr /* { dg-bogus "may not be portable" "" { xfail *-*-* } } */ +#endif + +int x;