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

Packit b40e2e
/* e_vargs.c: Error of variable arguments macro */
Packit b40e2e
Packit b40e2e
/* { dg-do preprocess } */
Packit b40e2e
/* { dg-options "-std=c99 -pedantic-errors" } */
Packit b40e2e
Packit b40e2e
/* e_vargs1:    Erroneous usage of __VA_ARGS__  */
Packit b40e2e
Packit b40e2e
/* __VA_ARGS__ should not be defined.   */
Packit b40e2e
    #define __VA_ARGS__ (x, y, z)
Packit b40e2e
/* { dg-error "__VA_ARGS__| shouldn't be defined" "" { target *-*-* } 9 } */
Packit b40e2e
Packit b40e2e
/*
Packit b40e2e
 * __VA_ARGS__ should be the parameter name in replacement list
Packit b40e2e
 * corresponding to '...'.
Packit b40e2e
 */
Packit b40e2e
    #define wrong_macro( a, b, __VA_ARGS__) (a + b - __VA_ARGS__)
Packit b40e2e
/* { dg-error "variadic macro\n\[\^ \]*( error:|) __VA_ARGS__| reserved name `__VA_ARGS__'| Illegal parameter" "" { target *-*-* } 16 } */
Packit b40e2e
Packit b40e2e
/* e_vargs2:    Erroneous macro invocation of variable arguments    */
Packit b40e2e
    /* No argument to correspond __VA_ARGS__    */
Packit b40e2e
    #define debug( ...) fprintf( stderr, __VA_ARGS__)
Packit b40e2e
    debug();
Packit b40e2e
/* { dg-warning "Empty argument" "" { target *-*-* } 22 } */
Packit b40e2e
/* dg-warning, not dg-error to avoid a problem of GCC 4.3 testsuite */