Skip to content

Commit

Permalink
Upstream test for wide character literals.
Browse files Browse the repository at this point in the history
Reviewed By: vdonaldson

Differential Revision: https://reviews.llvm.org/D124488
  • Loading branch information
schweitzpgi committed Apr 27, 2022
1 parent 6beb2db commit 8dc8e59
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions 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>
}

0 comments on commit 8dc8e59

Please sign in to comment.