[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Lower / constant-literal-mangling.f90
blobabb2754bc2f95860d71e421af7a504eb65eca1ca
1 ! Test the names created for globals holding constant literal values
2 ! RUN: bbc -emit-fir -o - %s | FileCheck %s
4 type someType
5 integer :: i
6 end type
8 print *, [42, 42]
9 ! CHECK: fir.address_of(@_QQro.2xi4.53fa91e04725d4ee6f22cf1e2d38428a)
11 print *, reshape([42, 42, 42, 42, 42, 42], [2,3])
12 ! CHECK: fir.address_of(@_QQro.2x3xi4.9af8c8182bab45c4e7888ec3623db3b6)
14 print *, [42_8, 42_8]
15 ! CHECK: fir.address_of(@_QQro.2xi8.3b1356831516d19b976038974b2673ac)
17 print *, [0.42, 0.42]
18 ! CHECK: fir.address_of(@_QQro.2xr4.3c5becae2e4426ad1615e253139ceff8)
20 print *, [0.42_8, 0.42_8]
21 ! CHECK: fir.address_of(@_QQro.2xr8.ebefec8f7537fbf54acc4530e75084e6)
23 print *, [.true.]
24 ! CHECK: fir.address_of(@_QQro.1xl4.4352d88a78aa39750bf70cd6f27bcaa5)
26 print *, [.true._8]
27 ! CHECK: fir.address_of(@_QQro.1xl8.33cdeccccebe80329f1fdbee7f5874cb)
29 print *, [(1., -1.), (-1., 1)]
30 ! CHECK: fir.address_of(@_QQro.2xz4.ac09ecb1abceb4f9cad4b1a50000074e)
32 print *, [(1._8, -1._8), (-1._8, 1._8)]
33 ! CHECK: fir.address_of(@_QQro.2xz8.a3652db37055e37d2cae8198ae4cd959)
35 print *, [someType(42), someType(43)]
36 ! CHECK: fir.address_of(@_QQro.2x_QFTsometype.
37 ! Note: the hash for derived types cannot clash with other constant in the same
38 ! compilation unit, but is unstable because it hashes some noise contained in
39 ! unused std::vector storage.
40 end