mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 05:06:06 +00:00
[clang-extdef-mapping] register necessary targest for ms-style asm block
Without targets registered gives: "error: MS-style inline assembly is not available: Unable to find target for this triple (no targets are registered)" Differential Revision: https://reviews.llvm.org/D154983
This commit is contained in:
parent
e953669872
commit
2c651184a2
7
clang/test/Tooling/ms-asm-clang-extdef-mapping.c
Normal file
7
clang/test/Tooling/ms-asm-clang-extdef-mapping.c
Normal file
@ -0,0 +1,7 @@
|
||||
// RUN: clang-extdef-mapping "%s" -- -fasm-blocks 2>&1 | FileCheck %s
|
||||
|
||||
void Break() {
|
||||
__asm { int 3 }
|
||||
}
|
||||
|
||||
// CHECK: {{c:@F@Break .*}}
|
@ -1,5 +1,8 @@
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
${LLVM_TARGETS_TO_BUILD}
|
||||
AllTargetsAsmParsers
|
||||
AllTargetsDescs
|
||||
AllTargetsInfos
|
||||
support
|
||||
)
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "clang/Tooling/Tooling.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/Signals.h"
|
||||
#include "llvm/Support/TargetSelect.h"
|
||||
#include <optional>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@ -214,6 +215,10 @@ int main(int argc, const char **argv) {
|
||||
}
|
||||
CommonOptionsParser &OptionsParser = ExpectedParser.get();
|
||||
|
||||
llvm::InitializeAllTargetInfos();
|
||||
llvm::InitializeAllTargetMCs();
|
||||
llvm::InitializeAllAsmParsers();
|
||||
|
||||
return HandleFiles(OptionsParser.getSourcePathList(),
|
||||
OptionsParser.getCompilations());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user