xref: /llvm-project/clang/test/CodeGen/builtin_Float16.c (revision 52818fd97f0f2b13d12e66de9f06b9f4cbc0be07)
1 // RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-linux-pc -target-feature +avx512fp16 %s | FileCheck %s
2 // RUN: %clang_cc1 -emit-llvm -o - -triple spir-unknown-unknown %s | FileCheck %s
3 // RUN: %clang_cc1 -emit-llvm -o - -triple armv7a--none-eabi %s | FileCheck %s
4 // RUN: %clang_cc1 -emit-llvm -o - -triple aarch64-linux-gnu %s | FileCheck %s
5 
test_float16_builtins(void)6 void test_float16_builtins(void) {
7   volatile _Float16 res;
8 
9   // CHECK: store volatile half 0xH7C00, ptr %res, align 2
10   res = __builtin_huge_valf16();
11   // CHECK: store volatile half 0xH7C00, ptr %res, align 2
12   res = __builtin_inff16();
13   // CHECK: store volatile half 0xH7E00, ptr %res, align 2
14   res = __builtin_nanf16("");
15   // CHECK: store volatile half 0xH7D00, ptr %res, align 2
16   res = __builtin_nansf16("");
17 }
18