1 ! Test lowering of derived type descriptors builtin data
2 ! RUN: bbc -emit-fir %s -o - | FileCheck %s
3 ! RUN: %flang_fc1 -emit-fir %s -o - | FileCheck %s
6 real, save, target
:: init_values(10, 10)
9 real, pointer :: values(:, :) => init_values
11 type(sometype
), allocatable
, save :: x(:)
14 ! CHECK-LABEL: fir.global linkonce_odr @_QFfooE.n.num constant target : !fir.char<1,3> {
15 ! CHECK: %[[res:.*]] = fir.string_lit "num"(3) : !fir.char<1,3>
16 ! CHECK: fir.has_value %[[res]] : !fir.char<1,3>
17 ! CHECK-LABEL: fir.global linkonce_odr @_QFfooE.di.sometype.num constant target : i32
18 ! CHECK-LABEL: fir.global linkonce_odr @_QFfooE.n.values constant target : !fir.char<1,6> {
19 ! CHECK: %[[res:.*]] = fir.string_lit "values"(6) : !fir.char<1,6>
20 ! CHECK: fir.has_value %[[res]] : !fir.char<1,6>
21 ! CHECK-LABEL: fir.global linkonce_odr @_QFfooE.n.sometype constant target : !fir.char<1,8> {
22 ! CHECK: %[[res:.*]] = fir.string_lit "sometype"(8) : !fir.char<1,8>
23 ! CHECK: fir.has_value %[[res]] : !fir.char<1,8>
25 ! CHECK-LABEL: fir.global linkonce_odr @_QFfooE.di.sometype.values constant target : !fir.type<_QFfooT.dp.sometype.values{values:!fir.box<!fir.ptr<!fir.array<?x?xf32>>>}> {
26 ! CHECK: fir.address_of(@_QFfooEinit_values)
29 ! CHECK-LABEL: fir.global linkonce_odr @_QFfooE.dt.sometype constant target {{.*}} {
30 !CHECK: fir.address_of(@_QFfooE.n.sometype)
31 !CHECK: fir.address_of(@_QFfooE.c.sometype)
34 ! CHECK-LABEL: fir.global linkonce_odr @_QFfooE.c.sometype constant {{.*}} {
35 ! CHECK: fir.address_of(@_QFfooE.n.num)
36 ! CHECK: fir.address_of(@_QFfooE.di.sometype.num) : !fir.ref<i32>
37 ! CHECK: fir.address_of(@_QFfooE.n.values)
38 ! CHECK: fir.address_of(@_QFfooE.di.sometype.values)
41 subroutine char_comp_init()
44 character(8) :: name
='Empty'
49 ! CHECK-LABEL: fir.global linkonce_odr @_QFchar_comp_initE.di.t.name constant target : !fir.char<1,8> {
50 ! CHECK: %[[res:.*]] = fir.string_lit "Empty "(8) : !fir.char<1,8>
51 ! CHECK: fir.has_value %[[res]] : !fir.char<1,8>
53 ! CHECK-LABEL: fir.global linkonce_odr @_QFchar_comp_initE.c.t constant target : {{.*}} {
54 ! CHECK: fir.address_of(@_QFchar_comp_initE.di.t.name) : !fir.ref<!fir.char<1,8>>