xref: /llvm-project/flang/test/Lower/global-format-strings.f90 (revision fd389f46deb0252a7f7412ef4b0809d7dc2d7072)
1e539faceSValentin Clement! RUN: bbc -emit-fir -o - %s | FileCheck %s
2e539faceSValentin Clement
3e539faceSValentin Clement! Test checks whether the text of the format statement is hashconed into a
4e539faceSValentin Clement! global similar to a CHARACTER literal and then referenced.
5e539faceSValentin Clement
6e539faceSValentin Clementprogram other
7e539faceSValentin Clement  write(10, 1008)
8e539faceSValentin Clement  ! CHECK:  fir.address_of(@{{.*}}) :
9e539faceSValentin Clement1008 format('ok')
10e539faceSValentin Clementend
11*fd389f46SFabian Mora! CHECK-LABEL: fir.global linkonce @_QQclX28276F6B2729 constant
12e539faceSValentin Clement! CHECK: %[[lit:.*]] = fir.string_lit "('ok')"(6) : !fir.char<1,6>
13e539faceSValentin Clement! CHECK: fir.has_value %[[lit]] : !fir.char<1,6>
14e539faceSValentin Clement! CHECK: }
15