[PATCH] D124510: [RISCV] Precommit test for D124509

Kito Cheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 29 20:09:25 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG02c7de3a4c32: [RISCV] Precommit test for D124509 (authored by kito-cheng).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124510/new/

https://reviews.llvm.org/D124510

Files:
  clang/test/CodeGen/RISCV/__fp16-convert.c


Index: clang/test/CodeGen/RISCV/__fp16-convert.c
===================================================================
--- /dev/null
+++ clang/test/CodeGen/RISCV/__fp16-convert.c
@@ -0,0 +1,26 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+// RUN: %clang_cc1 -triple riscv64 -emit-llvm %s -o - \
+// RUN:   | FileCheck %s
+
+__fp16 y;
+short z;
+// CHECK-LABEL: @bar1(
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:    [[TMP0:%.*]] = load i16, ptr @y, align 2
+// CHECK-NEXT:    [[TMP1:%.*]] = call float @llvm.convert.from.fp16.f32(i16 [[TMP0]])
+// CHECK-NEXT:    [[CONV:%.*]] = fptosi float [[TMP1]] to i16
+// CHECK-NEXT:    store i16 [[CONV]], ptr @z, align 2
+// CHECK-NEXT:    ret void
+//
+void bar1(){
+    z = y;
+}
+// CHECK-LABEL: @bar2(
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:    [[TMP0:%.*]] = load i16, ptr @z, align 2
+// CHECK-NEXT:    store i16 [[TMP0]], ptr @y, align 2
+// CHECK-NEXT:    ret void
+//
+void bar2(){
+    y = z;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124510.426206.patch
Type: text/x-patch
Size: 977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220430/774341f1/attachment.bin>


More information about the cfe-commits mailing list