1 /*===-- targets.c - tool for testing libLLVM and llvm-c API ---------------===*\
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
8 |*===----------------------------------------------------------------------===*|
10 |* This file implements the --targets command in llvm-c-test. *|
12 \*===----------------------------------------------------------------------===*/
14 #include "llvm-c/TargetMachine.h"
17 int llvm_targets_list(void) {
19 LLVMInitializeAllTargetInfos();
20 LLVMInitializeAllTargets();
22 for (t
= LLVMGetFirstTarget(); t
; t
= LLVMGetNextTarget(t
)) {
23 printf("%s", LLVMGetTargetName(t
));
24 if (LLVMTargetHasJIT(t
))
26 printf("\n - %s\n", LLVMGetTargetDescription(t
));