mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-05 23:52:45 +00:00
5523fefb01
There is a long-standing FIXME in `HeaderSearch.cpp` to use the path separator preferred by the platform instead of forward slash. There was an attempt to fix that (1cf6c28a
) which got reverted (cf385dc8
). I couldn't find an explanation, but my guess is that some tests assuming forward slash started failing. This commit fixes tests with that assumption. This is intended to be NFC, but there are two exceptions to that: * Some diagnostic messages might now contain backslash instead of forward slash. * Arguments to the "-remap-file" option that use forward slash might stop kicking in. Separators between potential includer path and header name need to be replaced by backslash in that case.
33 lines
892 B
C++
33 lines
892 B
C++
// Test macro preservation in C++20 Header Units.
|
|
|
|
// RUN: rm -rf %t
|
|
// RUN: mkdir -p %t
|
|
// RUN: split-file %s %t
|
|
// RUN: cd %t
|
|
|
|
// Produce a pre-processed file.
|
|
// RUN: %clang_cc1 -std=c++20 -E -xc++-user-header hu-01.h -o hu-01.iih
|
|
|
|
// consume that to produce the heder unit.
|
|
// RUN: %clang_cc1 -std=c++20 -emit-header-unit \
|
|
// RUN: -xc++-header-unit-header-cpp-output hu-01.iih -o hu-01.pcm
|
|
|
|
// check that the header unit is named for the original file, not the .iih.
|
|
// RUN: %clang_cc1 -std=c++20 -module-file-info hu-01.pcm | \
|
|
// RUN: FileCheck --check-prefix=CHECK-HU %s -DTDIR=%t
|
|
|
|
//--- hu-01.h
|
|
#ifndef __GUARD
|
|
#define __GUARD
|
|
|
|
int baz(int);
|
|
#define FORTYTWO 42
|
|
|
|
#define SHOULD_NOT_BE_DEFINED -1
|
|
#undef SHOULD_NOT_BE_DEFINED
|
|
|
|
#endif // __GUARD
|
|
|
|
// CHECK-HU: ====== C++20 Module structure ======
|
|
// CHECK-HU-NEXT: Header Unit '.{{/|\\\\?}}hu-01.h' is the Primary Module at index #1
|