Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Change global initialization for equivalence on AIX (NFC) #74614

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

madanial0
Copy link
Contributor

default initialization for equivalence on AIX results in a different value due to endianness, changing the testcase to account for that.

@madanial0 madanial0 added the flang Flang issues not falling into any other category label Dec 6, 2023
@madanial0 madanial0 self-assigned this Dec 6, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Dec 6, 2023

@llvm/pr-subscribers-flang-fir-hlfir

Author: None (madanial0)

Changes

default initialization for equivalence on AIX results in a different value due to endianness, changing the testcase to account for that.


Full diff: https://github.com/llvm/llvm-project/pull/74614.diff

1 Files Affected:

  • (modified) flang/test/Lower/default-initialization-globals.f90 (+4-2)
diff --git a/flang/test/Lower/default-initialization-globals.f90 b/flang/test/Lower/default-initialization-globals.f90
index aa923f49170c1..384d1cb763ad6 100644
--- a/flang/test/Lower/default-initialization-globals.f90
+++ b/flang/test/Lower/default-initialization-globals.f90
@@ -1,5 +1,6 @@
 ! Test default initialization of global variables (static init)
-! RUN: bbc -hlfir=false %s -o - | FileCheck %s
+! RUN: bbc -hlfir=false %s -o - | FileCheck %s --check-prefixes=%if system-aix %{"CHECK","CHECK-BE"%} \
+! RUN:                                         %else %{"CHECK","CHECK-LE"%}
 
 module tinit
   real, target :: ziel(100)
@@ -191,7 +192,8 @@ subroutine eqv_same_default_init()
   type(tseq), save :: somet1(2), somet2
   equivalence (somet1(1), somet2)
 ! CHECK-LABEL: fir.global internal @_QFeqv_same_default_initEsomet1 : !fir.array<2xi64> {
-  ! CHECK: %[[VAL_62:.*]] = arith.constant 12884901890 : i64
+  ! CHECK-LE: %[[VAL_62:.*]] = arith.constant 12884901890 : i64
+  ! CHECK-BE: %[[VAL_62:.*]] = arith.constant 8589934595 : i64
   ! CHECK: %[[VAL_63:.*]] = fir.undefined !fir.array<2xi64>
   ! CHECK: %[[VAL_64:.*]] = fir.insert_on_range %[[VAL_63]], %[[VAL_62]] from (0) to (1) : (!fir.array<2xi64>, i64) -> !fir.array<2xi64>
   ! CHECK: fir.has_value %[[VAL_64]] : !fir.array<2xi64>

@madanial0 madanial0 merged commit cd83180 into llvm:main Dec 6, 2023
6 checks passed
@madanial0
Copy link
Contributor Author

Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:fir-hlfir flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants