-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[win][aarch64] Enable the llvm/test/CodeGen/WinEH tests for AArch64 #147860
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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-backend-aarch64 @llvm/pr-subscribers-platform-windows Author: Daniel Paoliello (dpaoliello) ChangesEnabled AArch64 runs for these tests where it made sense. Also removed the "temporary" suffixes filter that was added over 10 years ago, I believe the "misched-copy.s output file" has been cleaned from the runners by now... Full diff: https://github.com/llvm/llvm-project/pull/147860.diff 7 Files Affected:
diff --git a/llvm/test/CodeGen/WinEH/lit.local.cfg b/llvm/test/CodeGen/WinEH/lit.local.cfg
index b39ce3299f7e9..14f88dfa6474b 100644
--- a/llvm/test/CodeGen/WinEH/lit.local.cfg
+++ b/llvm/test/CodeGen/WinEH/lit.local.cfg
@@ -1,11 +1,5 @@
-# FIXME: For now, override suffixes to exclude any .s tests, because some of the
-# buildbots have a stray misched-copy.s output file lying around that causes
-# failures. See misched-copy.s where we try and clean up that file.
-#
-# It should be possible to remove this override once all the bots have cycled
-# cleanly.
-config.suffixes = [".ll", ".test", ".txt"]
-
-# FIXME: Add Windows on ARM support to these tests.
-if not "X86" in config.root.targets:
+if not (
+ ("X86" in config.root.targets)
+ | ("AArch64" in config.root.targets)
+):
config.unsupported = True
diff --git a/llvm/test/CodeGen/WinEH/wineh-cloning.ll b/llvm/test/CodeGen/WinEH/wineh-cloning.ll
index 5df2eb26ead96..df5ebbe491828 100644
--- a/llvm/test/CodeGen/WinEH/wineh-cloning.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-cloning.ll
@@ -1,5 +1,7 @@
; RUN: opt -mtriple=x86_64-pc-windows-msvc -S -win-eh-prepare < %s | FileCheck %s
; RUN: opt -mtriple=x86_64-pc-windows-msvc -S -passes=win-eh-prepare < %s | FileCheck %s
+; RUN: opt -mtriple=aarch64-pc-windows-msvc -S -win-eh-prepare < %s | FileCheck %s
+; RUN: opt -mtriple=aarch64-pc-windows-msvc -S -passes=win-eh-prepare < %s | FileCheck %s
declare i32 @__CxxFrameHandler3(...)
declare i32 @__C_specific_handler(...)
diff --git a/llvm/test/CodeGen/WinEH/wineh-demotion.ll b/llvm/test/CodeGen/WinEH/wineh-demotion.ll
index 36a21e29f9c38..33adab55d00c6 100644
--- a/llvm/test/CodeGen/WinEH/wineh-demotion.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-demotion.ll
@@ -1,5 +1,7 @@
; RUN: opt -mtriple=x86_64-pc-windows-msvc -S -win-eh-prepare < %s | FileCheck %s
; RUN: opt -mtriple=x86_64-pc-windows-msvc -S -passes=win-eh-prepare < %s | FileCheck %s
+; RUN: opt -mtriple=aarch64-pc-windows-msvc -S -win-eh-prepare < %s | FileCheck %s
+; RUN: opt -mtriple=aarch64-pc-windows-msvc -S -passes=win-eh-prepare < %s | FileCheck %s
declare i32 @__CxxFrameHandler3(...)
diff --git a/llvm/test/CodeGen/WinEH/wineh-empty-seh-scope.ll b/llvm/test/CodeGen/WinEH/wineh-empty-seh-scope.ll
index 5f382f10f180b..11b2c1c6f7e8d 100644
--- a/llvm/test/CodeGen/WinEH/wineh-empty-seh-scope.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-empty-seh-scope.ll
@@ -1,10 +1,12 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
-; RUN: llc -mtriple=x86_64-pc-windows-msvc19.41.34120 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-pc-windows-msvc < %s | FileCheck %s --check-prefixes=CHECK,X64
+; RUN: llc -mtriple=aarch64-pc-windows-msvc < %s | FileCheck %s --check-prefixes=CHECK,AARCH64
define void @foo() personality ptr @__CxxFrameHandler3 {
; CHECK-LABEL: foo:
-; CHECK: # %bb.0:
-; CHECK-NEXT: nop # avoids zero-length function
+; CHECK: %bb.0:
+; X64-NEXT: nop # avoids zero-length function
+; AARCH64: brk #0x1
call void @llvm.seh.scope.begin()
unreachable
}
diff --git a/llvm/test/CodeGen/WinEH/wineh-nested-unwind.ll b/llvm/test/CodeGen/WinEH/wineh-nested-unwind.ll
index bde6d60dca3cd..40a98323b1215 100644
--- a/llvm/test/CodeGen/WinEH/wineh-nested-unwind.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-nested-unwind.ll
@@ -1,6 +1,5 @@
-; RUN: llc < %s | FileCheck %s
-target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-pc-windows-msvc18.0.0"
+; RUN: llc -mtriple=x86_64-pc-windows-msvc < %s | FileCheck %s
+; RUN: llc -mtriple=aarch64-pc-windows-msvc < %s | FileCheck %s
; Function Attrs: uwtable
define void @f() #0 personality ptr @__CxxFrameHandler3 {
diff --git a/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll b/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll
index d4667db97cc14..11388fb535964 100644
--- a/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-no-demotion.ll
@@ -1,5 +1,7 @@
; RUN: opt -mtriple=x86_64-pc-windows-msvc -S -win-eh-prepare -disable-demotion -disable-cleanups < %s | FileCheck %s
; RUN: opt -mtriple=x86_64-pc-windows-msvc -S -passes=win-eh-prepare -disable-demotion -disable-cleanups < %s | FileCheck %s
+; RUN: opt -mtriple=aarch64-pc-windows-msvc -S -win-eh-prepare -disable-demotion -disable-cleanups < %s | FileCheck %s
+; RUN: opt -mtriple=aarch64-pc-windows-msvc -S -passes=win-eh-prepare -disable-demotion -disable-cleanups < %s | FileCheck %s
declare i32 @__CxxFrameHandler3(...)
diff --git a/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll b/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
index e42b005cf64bd..08042868f9971 100644
--- a/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
@@ -1,5 +1,7 @@
-; RUN: sed -e s/.Cxx:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefix=CXX
-; RUN: sed -e s/.Seh:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefix=SEH
+; RUN: sed -e s/.Cxx:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefixes=CXX,X64CXX
+; RUN: sed -e s/.Seh:// %s | llc -mtriple=x86_64-pc-windows-msvc | FileCheck %s --check-prefixes=SEH
+; RUN: sed -e s/.Cxx:// %s | llc -mtriple=aarch64-pc-windows-msvc | FileCheck %s --check-prefix=CXX
+; RUN: sed -e s/.Seh:// %s | llc -mtriple=aarch64-pc-windows-msvc | FileCheck %s --check-prefix=SEH
declare i32 @__CxxFrameHandler3(...)
declare i32 @__C_specific_handler(...)
@@ -44,37 +46,44 @@ catch.body.2:
; CXX-LABEL: test:
; CXX-LABEL: $ip2state$test:
-; CXX-NEXT: .long .Lfunc_begin0@IMGREL
-; CXX-NEXT: .long -1
-; CXX-NEXT: .long .Ltmp0@IMGREL+1
-; CXX-NEXT: .long 1
-; CXX-NEXT: .long .Ltmp1@IMGREL+1
-; CXX-NEXT: .long -1
-; CXX-NEXT: .long "?catch$3@?0?test@4HA"@IMGREL
-; CXX-NEXT: .long 2
-; CXX-NEXT: .long .Ltmp2@IMGREL+1
-; CXX-NEXT: .long 3
-; CXX-NEXT: .long .Ltmp3@IMGREL+1
-; CXX-NEXT: .long 2
-; CXX-NEXT: .long "?catch$5@?0?test@4HA"@IMGREL
-; CXX-NEXT: .long 4
+; CXX-NEXT: .[[ENTRY:long|word]] .Lfunc_begin0@IMGREL
+; CXX-NEXT: .[[ENTRY]] -1
+; CXX-NEXT: .[[ENTRY]] .Ltmp0@IMGREL
+; X64CXX-SAME: +1
+; CXX-NEXT: .[[ENTRY]] 1
+; CXX-NEXT: .[[ENTRY]] .Ltmp1@IMGREL
+; X64CXX-SAME: +1
+; CXX-NEXT: .[[ENTRY]] -1
+; CXX-NEXT: .[[ENTRY]] "?catch$3@?0?test@4HA"@IMGREL
+; CXX-NEXT: .[[ENTRY]] 2
+; CXX-NEXT: .[[ENTRY]] .Ltmp2@IMGREL
+; X64CXX-SAME: +1
+; CXX-NEXT: .[[ENTRY]] 3
+; CXX-NEXT: .[[ENTRY]] .Ltmp3@IMGREL
+; X64CXX-SAME: +1
+; CXX-NEXT: .[[ENTRY]] 2
+; CXX-NEXT: .[[ENTRY]] "?catch$5@?0?test@4HA"@IMGREL
+; CXX-NEXT: .[[ENTRY]] 4
; SEH-LABEL: test:
+; SEH: .LBB0_[[CATCH2:[0-9]+]]: {{.*}} %catch.body.2
+; SEH: .LBB0_[[CATCH:[0-9]+]]: {{.*}} %catch.body
; SEH-LABEL: .Llsda_begin0:
-; SEH-NEXT: .long .Ltmp0@IMGREL
-; SEH-NEXT: .long .Ltmp1@IMGREL+1
-; SEH-NEXT: .long dummy_filter@IMGREL
-; SEH-NEXT: .long .LBB0_3@IMGREL
-; SEH-NEXT: .long .Ltmp0@IMGREL
-; SEH-NEXT: .long .Ltmp1@IMGREL+1
-; SEH-NEXT: .long dummy_filter@IMGREL
-; SEH-NEXT: .long .LBB0_5@IMGREL
-; SEH-NEXT: .long .Ltmp2@IMGREL
-; SEH-NEXT: .long .Ltmp3@IMGREL+1
-; SEH-NEXT: .long "?dtor$2@?0?test@4HA"@IMGREL
-; SEH-NEXT: .long 0
-; SEH-NEXT: .long .Ltmp2@IMGREL
-; SEH-NEXT: .long .Ltmp3@IMGREL+1
-; SEH-NEXT: .long dummy_filter@IMGREL
-; SEH-NEXT: .long .LBB0_5@IMGREL
+; SEH-NEXT: .[[ENTRY:long|word]] .Ltmp0@IMGREL
+; SEH-NEXT: .[[ENTRY]] .Ltmp1@IMGREL+1
+; SEH-NEXT: .[[ENTRY]] dummy_filter@IMGREL
+; SEH-NEXT: .[[ENTRY]] .LBB0_[[CATCH]]@IMGREL
+; SEH-NEXT: .[[ENTRY]] .Ltmp0@IMGREL
+; SEH-NEXT: .[[ENTRY]] .Ltmp1@IMGREL+1
+; SEH-NEXT: .[[ENTRY]] dummy_filter@IMGREL
+; SEH-NEXT: .[[ENTRY]] .LBB0_[[CATCH2]]@IMGREL
+; SEH-NEXT: .[[ENTRY]] .Ltmp2@IMGREL
+; SEH-NEXT: .[[ENTRY]] .Ltmp3@IMGREL+1
+; SEH-NEXT: .[[ENTRY]] "?dtor$[[DTOR:[0-9]+]]@?0?test@4HA"@IMGREL
+; SEH-NEXT: .[[ENTRY]] 0
+; SEH-NEXT: .[[ENTRY]] .Ltmp2@IMGREL
+; SEH-NEXT: .[[ENTRY]] .Ltmp3@IMGREL+1
+; SEH-NEXT: .[[ENTRY]] dummy_filter@IMGREL
+; SEH-NEXT: .[[ENTRY]] .LBB0_[[CATCH2]]@IMGREL
; SEH-NEXT: .Llsda_end0:
+; SEH: "?dtor$[[DTOR]]@?0?test@4HA"
|
if not ( | ||
("X86" in config.root.targets) | ||
| ("AArch64" in config.root.targets) | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a binary OR in what's supposedly a boolean context? Not really sure how Python behaves wrt that though.
Secondly, this would run the tests if either X86 or the AArch64 backend is enabled - but the tests use both, so this would cause failures if you have only one of them available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following the pattern in:
llvm-project/llvm/test/ExecutionEngine/MCJIT/lit.local.cfg
Lines 3 to 11 in 136558b
if not ( | |
("X86" in targets) | |
| ("AArch64" in targets) | |
| ("ARM" in targets) | |
| ("Mips" in targets) | |
| ("PowerPC" in targets) | |
| ("SystemZ" in targets) | |
): | |
config.unsupported = True |
Thinking about this a bit more, I'm going to have the directory require x86 only, then add substitutions to filter out individual commands if AArch64 isn't available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right - that pattern is different there, as the JIT tests only execute for the native platform, so it's enough as long as the native arch is enabled as a target, and is one of the specific listed architectures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The form you pushed now should probably be fine; it's a bit more wordy, but it should work correctly. I'll leave it up to others to say which form you prefer. The former style, with the right condition in the lit.local.cfg file, is easier to read and write, but restricts the tests to only run on setups with both x86 and aarch64 targets enabled, while the new form requires more repeated code for the conditions, but makes the tests accessible to more build configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree it's more verbose but I didn't want to lose coverage for existing x86-only builders (no idea how many of those there are though).
This directory gets about 5/changes per year, so I don't think the extra complexity when writing tests is too big an issue.
Enabled AArch64 runs for these tests where it made sense.
Also removed the "temporary" suffixes filter that was added over 10 years ago, I believe the "misched-copy.s output file" has been cleaned from the runners by now...