llvm-project/flang/test/Lower/global-format-strings.f90
Valentin Clement e539faced8
[flang][NFC] Add global lowering tests
This patch adds some lowering tests for globals.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-23 17:02:15 +01:00

15 lines
465 B
Fortran

! RUN: bbc -emit-fir -o - %s | FileCheck %s
! Test checks whether the text of the format statement is hashconed into a
! global similar to a CHARACTER literal and then referenced.
program other
write(10, 1008)
! CHECK: fir.address_of(@{{.*}}) :
1008 format('ok')
end
! CHECK-LABEL: fir.global linkonce @_QQcl.28276F6B2729 constant
! CHECK: %[[lit:.*]] = fir.string_lit "('ok')"(6) : !fir.char<1,6>
! CHECK: fir.has_value %[[lit]] : !fir.char<1,6>
! CHECK: }