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] Run real 10 test on x86 only (NFC) #73911

Merged
merged 7 commits into from
Dec 5, 2023
Merged

Conversation

madanial0
Copy link
Contributor

Remove real 10 tests for powerpc

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

llvmbot commented Nov 30, 2023

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

@llvm/pr-subscribers-flang-semantics

Author: None (madanial0)

Changes

Remove real 10 tests for powerpc


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

1 Files Affected:

  • (modified) flang/unittests/Evaluate/real.cpp (+4)
diff --git a/flang/unittests/Evaluate/real.cpp b/flang/unittests/Evaluate/real.cpp
index 9701082898388be..6c37c28d913c7ff 100644
--- a/flang/unittests/Evaluate/real.cpp
+++ b/flang/unittests/Evaluate/real.cpp
@@ -14,7 +14,9 @@ using Real2 = Scalar<Type<TypeCategory::Real, 2>>;
 using Real3 = Scalar<Type<TypeCategory::Real, 3>>;
 using Real4 = Scalar<Type<TypeCategory::Real, 4>>;
 using Real8 = Scalar<Type<TypeCategory::Real, 8>>;
+#ifndef __PPC__
 using Real10 = Scalar<Type<TypeCategory::Real, 10>>;
+#endif
 using Real16 = Scalar<Type<TypeCategory::Real, 16>>;
 using Integer4 = Scalar<Type<TypeCategory::Integer, 4>>;
 using Integer8 = Scalar<Type<TypeCategory::Integer, 8>>;
@@ -538,7 +540,9 @@ void roundTest(int rm, Rounding rounding, std::uint32_t opds) {
   basicTests<Real3>(rm, rounding);
   basicTests<Real4>(rm, rounding);
   basicTests<Real8>(rm, rounding);
+  #ifndef __PPC__
   basicTests<Real10>(rm, rounding);
+  #endif
   basicTests<Real16>(rm, rounding);
   ScopedHostFloatingPointEnvironment::SetRounding(rounding);
   subsetTests<std::uint32_t, float, Real4>(rm, rounding, opds);

Copy link

github-actions bot commented Nov 30, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

@banach-space
Copy link
Contributor

I don't really contribute to this area, so removing myself from the list of reviewers.

@kiranchandramohan
Copy link
Contributor

It is not supported on AArch64 as well.

@madanial0
Copy link
Contributor Author

It is not supported on AArch64 as well.

Would you like me to add AArch64 macro to that test case as well?

@kiranchandramohan
Copy link
Contributor

It is not supported on AArch64 as well.

Would you like me to add AArch64 macro to that test case as well?

Yes, that would be great. Does it fail currently or give a warning?

@madanial0 madanial0 changed the title [Flang] remove real 10 test for ppc (NFC) [flang] Run real 10 test on x86 only (NFC) Dec 4, 2023
@madanial0
Copy link
Contributor Author

Added changes to flang/test/Lower/assignment.f90, as it covers the same issue

@madanial0
Copy link
Contributor Author

The macro approach does not seem to be working in the fortran files resulting in a failure will remove the flang/test/Lower/assignment.f90 test case from this PR

@clementval
Copy link
Contributor

The macro approach does not seem to be working in the fortran files resulting in a failure will remove the flang/test/Lower/assignment.f90 test case from this PR

Which macro are you using? It might be that the flang driver is not defining them properly.

@jeanPerier
Copy link
Contributor

Which macro are you using? It might be that the flang driver is not defining them properly.

The test is using bbc that is a simple test driver that is not defining macros. For this use case, you could try to change bbc into %flang_fc1 (you can replace the -hlfir=false by -flang-deprecated-no-hlfir).

@madanial0
Copy link
Contributor Author

The macro approach does not seem to be working in the fortran files resulting in a failure will remove the flang/test/Lower/assignment.f90 test case from this PR

Which macro are you using? It might be that the flang driver is not defining them properly.

I am using __x86_64__ but it seems not to be picked up by either bbc or flang-new

@madanial0
Copy link
Contributor Author

Which macro are you using? It might be that the flang driver is not defining them properly.

The test is using bbc that is a simple test driver that is not defining macros. For this use case, you could try to change bbc into %flang_fc1 (you can replace the -hlfir=false by -flang-deprecated-no-hlfir).

I tried the above still did not work with the __x86_64__ macro, did I miss something?

@kiranchandramohan
Copy link
Contributor

x86_64

The macros are added in the following location.

fortranOptions.predefinitions.emplace_back("__x86_64__", "1");

@luporl
Copy link
Contributor

luporl commented Dec 5, 2023

It seems the -cpp flag is needed for this to work.

Copy link
Contributor

@kiranchandramohan kiranchandramohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG.

@madanial0 madanial0 merged commit 58b5149 into llvm:main Dec 5, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:driver flang:fir-hlfir flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants