Blame test-c/m_36_jis.c

Packit Service 8bf002
/* m_36_jis.c:  Handling of '\\' in ISO-2022-JP multi--byte character.  */
Packit Service 8bf002
Packit Service 8bf002
#include    "defs.h"
Packit Service 8bf002
Packit Service 8bf002
#define     str( a)     # a
Packit Service 8bf002
Packit Service 8bf002
main( void)
Packit Service 8bf002
{
Packit Service 8bf002
    fputs( "started\n", stdout);
Packit Service 8bf002
Packit Service 8bf002
/* 36.1:    0x5c in multi-byte character is not an escape character */
Packit Service 8bf002
Packit Service 8bf002
#pragma __setlocale( "jis")                 /* For MCPP     */
Packit Service 8bf002
#pragma setlocale( "jis")                   /* For MCPP on VC   */
Packit Service 8bf002
Packit Service 8bf002
#if     '字' == '\x3b\x7a' && '移' != '\x30\x5c'
Packit Service 8bf002
    fputs( "Bad handling of '\\' in multi-byte character", stdout);
Packit Service 8bf002
    exit( 1);
Packit Service 8bf002
#endif
Packit Service 8bf002
Packit Service 8bf002
/* 36.2:    # operater should not insert '\\' before 0x5c, 0x22 or 0x27
Packit Service 8bf002
        in multi-byte character */
Packit Service 8bf002
    assert( strcmp( str( "移動"), "\"移動\"") == 0);
Packit Service 8bf002
    assert( strcmp( str( "陰陽"), "\"陰陽\"") == 0);
Packit Service 8bf002
    assert( strcmp( str( "宇宙"), "\"宇宙\"") == 0);
Packit Service 8bf002
Packit Service 8bf002
    fputs( "移動" "\"移動\"\n", stdout);
Packit Service 8bf002
    fputs( "陰陽" "\"陰陽\"\n", stdout);
Packit Service 8bf002
    fputs( "宇宙" "\"宇宙\"\n", stdout);
Packit Service 8bf002
    fputs( "success\n", stdout);
Packit Service 8bf002
    return  0;
Packit Service 8bf002
}
Packit Service 8bf002