Skip to content

release/19.x: [builtins] Fix missing main() function in float16/bfloat16 support checks (#104478) #106843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions compiler-rt/lib/builtins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,12 @@ else ()
endif()
endif()
endif()
check_c_source_compiles("_Float16 foo(_Float16 x) { return x; }"
check_c_source_compiles("_Float16 foo(_Float16 x) { return x; }
int main(void) { return 0; }"
COMPILER_RT_HAS_${arch}_FLOAT16)
append_list_if(COMPILER_RT_HAS_${arch}_FLOAT16 -DCOMPILER_RT_HAS_FLOAT16 BUILTIN_CFLAGS_${arch})
check_c_source_compiles("__bf16 foo(__bf16 x) { return x; }"
check_c_source_compiles("__bf16 foo(__bf16 x) { return x; }
int main(void) { return 0; }"
COMPILER_RT_HAS_${arch}_BFLOAT16)
# Build BF16 files only when "__bf16" is available.
if(COMPILER_RT_HAS_${arch}_BFLOAT16)
Expand Down
Loading