[llvm] [AArch64][Win] Emit SEH instructions for the swift async context-related instructions in the prologue and the epilogue. (PR #66967)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 02:36:49 PDT 2023


================
@@ -0,0 +1,26 @@
+; RUN: rm -rf %t && mkdir -p %t
+; RUN: llc -mtriple aarch64-unknown-windows-msvc %s -o - | FileCheck %s
+; RUN: llc -mtriple aarch64-unknown-windows-msvc -filetype obj %s -o %t/a.o 2>&1 | FileCheck %s -check-prefix=MC --allow-empty
+
+; Check that the prologue/epilogue instructions for the swift async context
+; have an associated SEH instruction.
+
+; CHECK: orr     x29, x29, #0x1000000000000000
+; CHECK-NEXT: .seh_nop
+; CHECK:  str     x22, [sp, #16]
+; CHECK-NEXT: .seh_save_reg   x22, 16
+; CHECK: and     x29, x29, #0xefffffffffffffff
+; CHECK-NEXT: .seh_nop
+
+; MC-NOT: error: Incorrect size for test prologue: {{[0-9]+}} bytes of instructions in range, but .seh directives corresponding to {{[0-9]+}} bytes
----------------
mstorsjo wrote:

I guess this is kinda redundant to add to the test; if we do hit that case, then the `llc` command also would error out, and the test would fail due to that.

So it might also be fine to just do the second run like this:
```
;; Output an object file; this checks for mismatches between SEH opcodes and the generated instructions.
; RUN: llc -mtriple aarch64-unknown-windows-msvc -filetype obj %s -o %t/a.o
```
without any FileCheck at all


https://github.com/llvm/llvm-project/pull/66967


More information about the llvm-commits mailing list