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

Packit Service 8bf002
/* n_13_5.c:    Arithmetic conversion in #if expressions.   */
Packit Service 8bf002
Packit Service 8bf002
/* 13.5:    The usual arithmetic conversion is not performed on bit shift.  */
Packit Service 8bf002
#if     -1 << 3U > 0
Packit Service 8bf002
#error  Bad conversion of bit shift operands.
Packit Service 8bf002
#endif
Packit Service 8bf002
Packit Service 8bf002
/* 13.6:    Usual arithmetic conversions.   */
Packit Service 8bf002
#if     -1 <= 0U        /* -1 is converted to unsigned long.    */
Packit Service 8bf002
#error  Bad arithmetic conversion.
Packit Service 8bf002
#endif
Packit Service 8bf002
Packit Service 8bf002
#if     -1 * 1U <= 0
Packit Service 8bf002
#error  Bad arithmetic conversion.
Packit Service 8bf002
#endif
Packit Service 8bf002
Packit Service 8bf002
/* Second and third operands of conditional operator are converted to the
Packit Service 8bf002
#error      same type, thus -1 is converted to unsigned long.    */
Packit Service 8bf002
#if     (1 ? -1 : 0U) <= 0
Packit Service 8bf002
#error  Bad arithmetic conversion.
Packit Service 8bf002
#endif
Packit Service 8bf002
Packit Service 8bf002
/* { dg-do preprocess }
Packit Service 8bf002
   { dg-options "-ansi -w" }
Packit Service 8bf002
 */