Skip to content

Commit cd83180

Browse files
authored
[flang] Change global initialization for equivalence on AIX (NFC) (#74614)
default initialization for equivalence on AIX results in a different value due to endianness, changing the testcase to account for that. Co-authored-by: Mark Danial <[email protected]>
1 parent c37573e commit cd83180

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

flang/test/Lower/default-initialization-globals.f90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
! Test default initialization of global variables (static init)
2-
! RUN: bbc -hlfir=false %s -o - | FileCheck %s
2+
! RUN: bbc -hlfir=false %s -o - | FileCheck %s --check-prefixes=%if system-aix %{"CHECK","CHECK-BE"%} \
3+
! RUN: %else %{"CHECK","CHECK-LE"%}
34

45
module tinit
56
real, target :: ziel(100)
@@ -191,7 +192,8 @@ subroutine eqv_same_default_init()
191192
type(tseq), save :: somet1(2), somet2
192193
equivalence (somet1(1), somet2)
193194
! CHECK-LABEL: fir.global internal @_QFeqv_same_default_initEsomet1 : !fir.array<2xi64> {
194-
! CHECK: %[[VAL_62:.*]] = arith.constant 12884901890 : i64
195+
! CHECK-LE: %[[VAL_62:.*]] = arith.constant 12884901890 : i64
196+
! CHECK-BE: %[[VAL_62:.*]] = arith.constant 8589934595 : i64
195197
! CHECK: %[[VAL_63:.*]] = fir.undefined !fir.array<2xi64>
196198
! CHECK: %[[VAL_64:.*]] = fir.insert_on_range %[[VAL_63]], %[[VAL_62]] from (0) to (1) : (!fir.array<2xi64>, i64) -> !fir.array<2xi64>
197199
! CHECK: fir.has_value %[[VAL_64]] : !fir.array<2xi64>

0 commit comments

Comments
 (0)