Blame test-c/n_6.c

Packit Service 8bf002
/* n_6.c:   #include directive. */
Packit Service 8bf002
Packit Service 8bf002
#include    "defs.h"
Packit Service 8bf002
/* 6.1: Header-name quoted by " and " as well as by < and > can include
Packit Service 8bf002
        standard headers.   */
Packit Service 8bf002
/* Note: Standard headers can be included any times.    */
Packit Service 8bf002
#include    "ctype.h"
Packit Service 8bf002
#include    <ctype.h>
Packit Service 8bf002
Packit Service 8bf002
main( void)
Packit Service 8bf002
{
Packit Service 8bf002
    int     abc = 3;
Packit Service 8bf002
Packit Service 8bf002
    fputs( "started\n", stderr);
Packit Service 8bf002
Packit Service 8bf002
    assert( isalpha( 'a'));
Packit Service 8bf002
Packit Service 8bf002
/* 6.2: Macro is allowed in #include line.  */
Packit Service 8bf002
#define HEADER  "header.h"
Packit Service 8bf002
#include    HEADER
Packit Service 8bf002
    assert( MACRO_abc == 3);
Packit Service 8bf002
Packit Service 8bf002
/* 6.3: With macro nonsence but legal.  */
Packit Service 8bf002
#undef  MACRO_abc
Packit Service 8bf002
#define ZERO_TOKEN
Packit Service 8bf002
#include    ZERO_TOKEN HEADER ZERO_TOKEN
Packit Service 8bf002
    assert( MACRO_abc == 3);
Packit Service 8bf002
Packit Service 8bf002
    fputs( "success\n", stderr);
Packit Service 8bf002
    return  0;
Packit Service 8bf002
}
Packit Service 8bf002