[flang-commits] [flang] 8dc8e59 - Upstream test for wide character literals.

Eric Schweitz via flang-commits flang-commits at lists.llvm.org
Tue Apr 26 18:25:33 PDT 2022


Author: Eric Schweitz
Date: 2022-04-26T18:25:13-07:00
New Revision: 8dc8e59eba4930980fa42232dbcafa969f79477a

URL: https://github.com/llvm/llvm-project/commit/8dc8e59eba4930980fa42232dbcafa969f79477a
DIFF: https://github.com/llvm/llvm-project/commit/8dc8e59eba4930980fa42232dbcafa969f79477a.diff

LOG: Upstream test for wide character literals.

Reviewed By: vdonaldson

Differential Revision: https://reviews.llvm.org/D124488

Added: 
    flang/test/Fir/widechar.fir

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/flang/test/Fir/widechar.fir b/flang/test/Fir/widechar.fir
new file mode 100644
index 0000000000000..80aedcc2d0067
--- /dev/null
+++ b/flang/test/Fir/widechar.fir
@@ -0,0 +1,22 @@
+// RUN: tco %s | FileCheck %s
+
+// CHECK-LABEL: @character_literal1
+func @character_literal1() -> !fir.char<1,13> {
+  %0 = fir.string_lit "Hello, World!"(13) : !fir.char<1,13>
+  // CHECK: ret [13 x i8] c"Hello, World!"
+  return %0 : !fir.char<1,13>
+}
+
+// CHECK-LABEL: @character_literal2
+func @character_literal2() -> !fir.char<2,2> {
+  %0 = fir.string_lit [234, 456](2) : !fir.char<2,2>
+  // CHECK: ret [2 x i16] [i16 234, i16 456]
+  return %0 : !fir.char<2,2>
+}
+
+// CHECK-LABEL: @character_literal4
+func @character_literal4() -> !fir.char<4,3> {
+  %0 = fir.string_lit [89123, 999256, 4](3) : !fir.char<4,3>
+  // CHECK: ret [3 x i32] [i32 89123, i32 999256, i32 4]
+  return %0 : !fir.char<4,3>
+}


        


More information about the flang-commits mailing list