Blame cpp-test/test-t/warn_2.c

Packit b40e2e
/* warn_2.c */
Packit b40e2e
Packit b40e2e
/*
Packit b40e2e
 *   The following texts are legal but suspicious ones.  Good preprocessor
Packit b40e2e
 * will warn at these texts.
Packit b40e2e
 */
Packit b40e2e
Packit b40e2e
/* { dg-do preprocess } */
Packit b40e2e
/* { dg-options "-ansi -pedantic -Wall" }   */
Packit b40e2e
Packit b40e2e
/* w.2.1:   Negative number converted to positive in #if expression.    */
Packit b40e2e
#if     -1 < 0U     /* { dg-warning "changes sign when promoted| converted to positive" }   */
Packit b40e2e
#endif
Packit b40e2e
Packit b40e2e
/* w.2.2:   Out of range of unsigned type (wraps around and never overflow)
Packit b40e2e
        in #if expression.  */
Packit b40e2e
#if     0U - 1      /* { dg-warning "out of range" }    */
Packit b40e2e
#endif
Packit b40e2e