Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / RISCV / __fp16-convert.c
blob36c746df7d34056b25423dfb0b9a8a37c5fae08a
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple riscv64 -emit-llvm %s -o - \
3 // RUN: | FileCheck %s
5 __fp16 y;
6 short z;
7 // CHECK-LABEL: @bar1(
8 // CHECK-NEXT: entry:
9 // CHECK-NEXT: [[TMP0:%.*]] = load half, ptr @y, align 2
10 // CHECK-NEXT: [[CONV:%.*]] = fpext half [[TMP0]] to float
11 // CHECK-NEXT: [[CONV1:%.*]] = fptosi float [[CONV]] to i16
12 // CHECK-NEXT: store i16 [[CONV1]], ptr @z, align 2
13 // CHECK-NEXT: ret void
15 void bar1(){
16 z = y;
18 // CHECK-LABEL: @bar2(
19 // CHECK-NEXT: entry:
20 // CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr @z, align 2
21 // CHECK-NEXT: [[CONV:%.*]] = sitofp i16 [[TMP0]] to float
22 // CHECK-NEXT: [[CONV1:%.*]] = fptrunc float [[CONV]] to half
23 // CHECK-NEXT: store half [[CONV1]], ptr @y, align 2
24 // CHECK-NEXT: ret void
26 void bar2(){
27 y = z;