[all-commits] [llvm/llvm-project] 066b8f: [llvm-rc] Try to fix the Preprocessor/llvm-rc.rc t...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Wed Apr 21 02:47:58 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 066b8f2fc6d584635a017a0a15494ce4460744e3
      https://github.com/llvm/llvm-project/commit/066b8f2fc6d584635a017a0a15494ce4460744e3
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-04-21 (Wed, 21 Apr 2021)

  Changed paths:
    M clang/test/Preprocessor/llvm-rc.rc
    M llvm/tools/llvm-rc/llvm-rc.cpp

  Log Message:
  -----------
  [llvm-rc] Try to fix the Preprocessor/llvm-rc.rc test on non arm/x86 architectures

When llvm-rc invokes clang for preprocessing, it uses a target
triple derived from the default target. The test verifies that
e.g. _WIN32 is defined when preprocessing.

If running clang with e.g. -target ppc64le-windows-msvc, that
particular arch/OS combination isn't hooked up, so _WIN32 doesn't
get defined in that configuration. Therefore, the preprocessing
test fails.

Instead make llvm-rc inspect the architecture of the default target.
If it's one of the known supported architectures, use it as such,
otherwise set a default one (x86_64). (Clang can run preprocessing
with an x86_64 target triple, even if the x86 backend isn't
enabled.)

Also remove superfluous llvm:: specifications on enums in llvm-rc.cpp.




More information about the All-commits mailing list