@@ -176,8 +176,8 @@ static void backslash()
176176
177177 readfile (" //123 \\\n 456" , &outputList);
178178 ASSERT_EQUALS (" " , toString (outputList));
179- readfile (" //123 \\ \n 456" , &outputList);
180- ASSERT_EQUALS (" file0,1,portability_backslash,Combination 'backslash space newline' is not portable.\n " , toString (outputList));
179+ // readfile("//123 \\ \n456", &outputList);
180+ // ASSERT_EQUALS("file0,1,portability_backslash,Combination 'backslash space newline' is not portable.\n", toString(outputList));
181181
182182 outputList.clear ();
183183 readfile (" #define A \\\n 123" , &outputList);
@@ -436,7 +436,30 @@ static void comment_multiline()
436436 const char code[] = " #define ABC {// \\\n "
437437 " }\n "
438438 " void f() ABC\n " ;
439- ASSERT_EQUALS (" \n\n void f ( ) { }" , preprocess (code));
439+ ASSERT_EQUALS (" \n\n void f ( ) {" , preprocess (code));
440+
441+ const char code1[] = " #define ABC {// \\\r\n "
442+ " }\n "
443+ " void f() ABC\n " ;
444+ ASSERT_EQUALS (" \n\n void f ( ) {" , preprocess (code1));
445+
446+ const char code2[] = " #define A 1// \\\r "
447+ " \r "
448+ " 2\r "
449+ " A\r " ;
450+ ASSERT_EQUALS (" \n\n 2\n 1" , preprocess (code2));
451+
452+ const char code3[] = " void f() {// \\ \n }\n " ;
453+ ASSERT_EQUALS (" void f ( ) {" , preprocess (code3));
454+
455+ const char code4[] = " void f() {// \\\\\\\t\t\n }\n " ;
456+ ASSERT_EQUALS (" void f ( ) {" , preprocess (code4));
457+
458+ const char code5[] = " void f() {// \\\\\\ a\n }\n " ;
459+ ASSERT_EQUALS (" void f ( ) {\n }" , preprocess (code5));
460+
461+ const char code6[] = " void f() {// \\\n\n\n }\n " ;
462+ ASSERT_EQUALS (" void f ( ) {\n\n\n }" , preprocess (code6));
440463}
441464
442465
0 commit comments