Benjamin Kramer | ae61151 | 2013-04-02 13:38:48 +0000 | [diff] [blame] | 1 | // PR15642 |
NAKAMURA Takumi | 01477e5 | 2015-05-14 04:25:54 +0000 | [diff] [blame] | 2 | // RUN: %clang -M -MG -fno-ms-compatibility %s | FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=SEP2F |
| 3 | // RUN: %clang -M -MG -fms-compatibility %s | FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=SEP5C |
Paul Robinson | d101ca2 | 2015-04-27 19:40:04 +0000 | [diff] [blame] | 4 | // RUN: %clang -M -MG -MV %s | FileCheck -strict-whitespace %s --check-prefix=NMAKE |
Benjamin Kramer | ae61151 | 2013-04-02 13:38:48 +0000 | [diff] [blame] | 5 | |
| 6 | // CHECK: \ \ \ \ .h |
| 7 | // CHECK: $$$$.h |
| 8 | // CHECK: \#\#.h |
Paul Robinson | d101ca2 | 2015-04-27 19:40:04 +0000 | [diff] [blame] | 9 | // NMAKE: " .h" |
| 10 | // NMAKE: "$$.h" |
| 11 | // NMAKE: "##.h" |
| 12 | // NMAKE-NOT: " |
| 13 | // NMAKE: normal.h |
| 14 | // NMAKE-NOT: " |
Benjamin Kramer | ae61151 | 2013-04-02 13:38:48 +0000 | [diff] [blame] | 15 | |
| 16 | #include " .h" |
| 17 | #include "$$.h" |
| 18 | #include "##.h" |
Paul Robinson | d7214a7 | 2015-04-27 18:14:32 +0000 | [diff] [blame] | 19 | #include "normal.h" |
Paul Robinson | 64441de | 2015-05-13 21:18:15 +0000 | [diff] [blame] | 20 | |
Paul Robinson | fcdf3e9 | 2015-05-13 22:33:50 +0000 | [diff] [blame] | 21 | // Backslash followed by # or space should escape both characters, because |
| 22 | // that's what GNU Make wants. GCC does the right thing with space, but not |
| 23 | // #, so Clang does too. (There should be 3 backslashes before the #.) |
NAKAMURA Takumi | 01477e5 | 2015-05-14 04:25:54 +0000 | [diff] [blame] | 24 | // SEP2F: a\b\\#c\\\ d.h |
| 25 | // With -fms-compatibility, Backslashes in #include are treated as path separators. |
| 26 | // Backslashes are given in the emission for special characters, like 0x20 or 0x23. |
NAKAMURA Takumi | 55deb26 | 2015-05-14 07:37:35 +0000 | [diff] [blame] | 27 | // SEP5C: a{{[/\\]}}b{{[/\\]}}\#c{{/|\\\\}}\ d.h |
Paul Robinson | 64441de | 2015-05-13 21:18:15 +0000 | [diff] [blame] | 28 | // These combinations are just another case for NMAKE. |
NAKAMURA Takumi | 01477e5 | 2015-05-14 04:25:54 +0000 | [diff] [blame] | 29 | // NMAKE: "a{{[/\\]}}b{{[/\\]}}#c{{[/\\]}} d.h" |
Paul Robinson | 64441de | 2015-05-13 21:18:15 +0000 | [diff] [blame] | 30 | |
| 31 | #include "a\b\#c\ d.h" |