From 2d74fbb20ddaf2f4a557879b3be46e4afdfcaa8d Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Wed, 9 Jul 2025 16:55:32 -0700 Subject: [PATCH] [win][aarch64] Enable the llvm/test/CodeGen/WinEH tests for AArch64 --- llvm/test/CodeGen/WinEH/lit.local.cfg | 9 --- llvm/test/CodeGen/WinEH/wineh-cloning.ll | 2 + llvm/test/CodeGen/WinEH/wineh-demotion.ll | 2 + .../CodeGen/WinEH/wineh-empty-seh-scope.ll | 8 +- .../test/CodeGen/WinEH/wineh-nested-unwind.ll | 5 +- llvm/test/CodeGen/WinEH/wineh-no-demotion.ll | 2 + .../test/CodeGen/WinEH/wineh-noret-cleanup.ll | 73 +++++++++++-------- 7 files changed, 54 insertions(+), 47 deletions(-) diff --git a/llvm/test/CodeGen/WinEH/lit.local.cfg b/llvm/test/CodeGen/WinEH/lit.local.cfg index b39ce3299f7e9..42bf50dcc13c3 100644 --- a/llvm/test/CodeGen/WinEH/lit.local.cfg +++ b/llvm/test/CodeGen/WinEH/lit.local.cfg @@ -1,11 +1,2 @@ -# 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: config.unsupported = True diff --git a/llvm/test/CodeGen/WinEH/wineh-cloning.ll b/llvm/test/CodeGen/WinEH/wineh-cloning.ll index 5df2eb26ead96..2b9e3bd06407b 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: %if aarch64-registered-target %{ opt -mtriple=aarch64-pc-windows-msvc -S -win-eh-prepare < %s | FileCheck %s %} +; RUN: %if aarch64-registered-target %{ 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..4e44c081ef586 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: %if aarch64-registered-target %{ opt -mtriple=aarch64-pc-windows-msvc -S -win-eh-prepare < %s | FileCheck %s %} +; RUN: %if aarch64-registered-target %{ 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..4e4d8f27497bc 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: %if aarch64-registered-target %{ 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..f73eca945d923 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: %if aarch64-registered-target %{ 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..2bfa07221c328 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: %if aarch64-registered-target %{ opt -mtriple=aarch64-pc-windows-msvc -S -win-eh-prepare -disable-demotion -disable-cleanups < %s | FileCheck %s %} +; RUN: %if aarch64-registered-target %{ 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..3b3a46069509b 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: %if aarch64-registered-target %{ sed -e s/.Cxx:// %s | llc -mtriple=aarch64-pc-windows-msvc | FileCheck %s --check-prefix=CXX %} +; RUN: %if aarch64-registered-target %{ 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"