mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-14 09:56:33 +00:00

Fix __has_builtin to return 1 only if the requested target features of a builtin are enabled by refactoring the code for checking required target features of a builtin and use it in evaluation of __has_builtin. Reviewed by: Artem Belevich Differential Revision: https://reviews.llvm.org/D125829
12 lines
292 B
C++
12 lines
292 B
C++
// RUN: %clang_cc1 -triple amdgcn -target-cpu gfx906 -E %s -o - | FileCheck %s
|
|
|
|
// CHECK: has_s_memtime_inst
|
|
#if __has_builtin(__builtin_amdgcn_s_memtime)
|
|
int has_s_memtime_inst;
|
|
#endif
|
|
|
|
// CHECK-NOT: has_gfx10_inst
|
|
#if __has_builtin(__builtin_amdgcn_mov_dpp8)
|
|
int has_gfx10_inst;
|
|
#endif
|