blob: c8d1191674c83ea5042791aa29e0f9f9c511e0b1 [file] [log] [blame]
Benjamin Kramerae611512013-04-02 13:38:48 +00001// PR15642
NAKAMURA Takumi01477e52015-05-14 04:25:54 +00002// 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 Robinsond101ca22015-04-27 19:40:04 +00004// RUN: %clang -M -MG -MV %s | FileCheck -strict-whitespace %s --check-prefix=NMAKE
Benjamin Kramerae611512013-04-02 13:38:48 +00005
6// CHECK: \ \ \ \ .h
7// CHECK: $$$$.h
8// CHECK: \#\#.h
Paul Robinsond101ca22015-04-27 19:40:04 +00009// NMAKE: " .h"
10// NMAKE: "$$.h"
11// NMAKE: "##.h"
12// NMAKE-NOT: "
13// NMAKE: normal.h
14// NMAKE-NOT: "
Benjamin Kramerae611512013-04-02 13:38:48 +000015
16#include " .h"
17#include "$$.h"
18#include "##.h"
Paul Robinsond7214a72015-04-27 18:14:32 +000019#include "normal.h"
Paul Robinson64441de2015-05-13 21:18:15 +000020
Paul Robinsonfcdf3e92015-05-13 22:33:50 +000021// 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 Takumi01477e52015-05-14 04:25:54 +000024// 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 Takumi55deb262015-05-14 07:37:35 +000027// SEP5C: a{{[/\\]}}b{{[/\\]}}\#c{{/|\\\\}}\ d.h
Paul Robinson64441de2015-05-13 21:18:15 +000028// These combinations are just another case for NMAKE.
NAKAMURA Takumi01477e52015-05-14 04:25:54 +000029// NMAKE: "a{{[/\\]}}b{{[/\\]}}#c{{[/\\]}} d.h"
Paul Robinson64441de2015-05-13 21:18:15 +000030
31#include "a\b\#c\ d.h"