xref: /llvm-project/flang/test/Lower/HLFIR/constant-character.f90 (revision fd389f46deb0252a7f7412ef4b0809d7dc2d7072)
1! Test that character literals of different types do not clash.
2! RUN: bbc -emit-hlfir %s -o - | FileCheck %s
3
4subroutine repro(c1, c4)
5  character(kind=1,len=*) :: c1
6  character(kind=4,len=*) :: c4
7  print *, ""
8  print *, 4_""
9end subroutine
10!CHECK-LABEL: func.func @_QPrepro
11!CHECK:    fir.address_of(@_QQclX) : !fir.ref<!fir.char<1,0>>
12!CHECK:    fir.call @_FortranAioOutputAscii
13!CHECK:    fir.address_of(@_QQcl4X) : !fir.ref<!fir.char<4,0>>
14!CHECK:    fir.call @_FortranAioOutputDescriptor(
15
16!CHECK-DAG:  fir.global linkonce @_QQclX constant : !fir.char<1,0>
17!CHECK-DAG:  fir.global linkonce @_QQcl4X constant : !fir.char<4,0>
18