Skip to content

[flang] Modify lto testcase for AIX #74496

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

Merged
merged 2 commits into from
Dec 11, 2023
Merged

[flang] Modify lto testcase for AIX #74496

merged 2 commits into from
Dec 11, 2023

Conversation

madanial0
Copy link
Contributor

Change the lto-flags test case to check for -bdbg:thinlto on AIX

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

llvmbot commented Dec 5, 2023

@llvm/pr-subscribers-flang-driver

Author: None (madanial0)

Changes

Change the lto-flags test case to check for -bdbg:thinlto on AIX


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

1 Files Affected:

  • (modified) flang/test/Driver/lto-flags.f90 (+2-1)
diff --git a/flang/test/Driver/lto-flags.f90 b/flang/test/Driver/lto-flags.f90
index 2b3b08fbcc711..d0eeca2cdc711 100644
--- a/flang/test/Driver/lto-flags.f90
+++ b/flang/test/Driver/lto-flags.f90
@@ -11,7 +11,7 @@
 
 ! Also check linker plugin opt for Thin LTO
 ! RUN: %flang -### -flto=thin %s 2>&1 | FileCheck %s \
-! RUN:        --check-prefixes=%if system-darwin %{THIN-LTO-ALL%} \
+! RUN:        --check-prefixes=%if system-darwin %{THIN-LTO-ALL%}%if system-aix %{THIN-LTO-ALL,THIN-LTO-LINKER-PLUGIN-AIX%} \
 ! RUN:        %else %{THIN-LTO-ALL,THIN-LTO-LINKER-PLUGIN%}
 
 ! RUN: not %flang -### -S -flto=somelto %s 2>&1 | FileCheck %s --check-prefix=ERROR
@@ -31,5 +31,6 @@
 ! THIN-LTO-ALL: "-fc1"
 ! THIN-LTO-ALL-SAME: "-flto=thin"
 ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto"
+! THIN-LTO-LINKER-PLUGIN-AIX: "-bdbg:thinlto"
 
 ! ERROR: error: unsupported argument 'somelto' to option '-flto=

Copy link
Contributor

@luporl luporl left a comment

Choose a reason for hiding this comment

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

This patch breaks the lto-flags test on Darwin. Please check the suggested change.
Also note that I have tested the change on Darwin only.

Comment on lines 14 to 15
! RUN: --check-prefixes=%if system-darwin %{THIN-LTO-ALL%}%if system-aix %{THIN-LTO-ALL,THIN-LTO-LINKER-PLUGIN-AIX%} \
! RUN: %else %{THIN-LTO-ALL,THIN-LTO-LINKER-PLUGIN%}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
! RUN: --check-prefixes=%if system-darwin %{THIN-LTO-ALL%}%if system-aix %{THIN-LTO-ALL,THIN-LTO-LINKER-PLUGIN-AIX%} \
! RUN: %else %{THIN-LTO-ALL,THIN-LTO-LINKER-PLUGIN%}
! RUN: --check-prefixes=THIN-LTO-ALL%if system-aix %{,THIN-LTO-LINKER-PLUGIN-AIX%} \
! RUN: %else %{ %if !system-darwin %{,THIN-LTO-LINKER-PLUGIN%} %}

Copy link
Contributor

@banach-space banach-space Dec 5, 2023

Choose a reason for hiding this comment

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

Why not write separate RUN lines for different triples with different prefixes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, it would be better. It would avoid the nested %ifs and make it possible to test all targets on the same machine.
But wouldn't it require all tested targets to be built in clang/flang, and tested with a REQUIRES: line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that avoiding the nested %if is better, I added a new RUN line for powerpc aix to check -bdbg:thinlto

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems -### doesn't require the tested targets to be built in llvm, because no code is generated, so this is fine.

Copy link
Contributor

@luporl luporl left a comment

Choose a reason for hiding this comment

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

LGTM and works correctly on Darwin now. Please wait for @banach-space.

@madanial0
Copy link
Contributor Author

LGTM and works correctly on Darwin now. Please wait for @banach-space.

Thanks for the review!

Copy link
Contributor

@banach-space banach-space left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@madanial0 madanial0 merged commit e9b2a07 into llvm:main Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:driver flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants