1 //===- lit-cpuid.cpp - Get CPU feature flags for lit exported features ----===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // lit-cpuid obtains the feature list for the currently running CPU, and outputs
10 // those flags that are interesting for LLDB lit tests.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/ADT/StringMap.h"
15 #include "llvm/Support/raw_ostream.h"
16 #include "llvm/TargetParser/Host.h"
20 int main(int argc
, char **argv
) {
21 #if defined(__i386__) || defined(_M_IX86) || \
22 defined(__x86_64__) || defined(_M_X64)
23 StringMap
<bool> features
;
25 if (!sys::getHostCPUFeatures(features
))
32 if (features
["avx512f"])
33 outs() << "avx512f\n";