| 
1 |  | -; RUN: llc %s --mtriple=x86_64-pc-windows-msvc -o - | FileCheck %s  | 
 | 1 | +; RUN: llc %s --mtriple=x86_64-pc-windows-msvc -o - | FileCheck %s --check-prefixes=CHECK,X64  | 
 | 2 | +; RUN: %if aarch64-registered-target %{ llc %s --mtriple=aarch64-pc-windows-msvc -o - | FileCheck %s --check-prefixes=CHECK,ARM64 %}  | 
2 | 3 | 
 
  | 
3 | 4 | ; Tests the fixed object layouts when two catchpads re-use the same stack  | 
4 | 5 | ; allocation for this catch objects.  | 
 | 
18 | 19 | ; }  | 
19 | 20 | ; ```  | 
20 | 21 | 
 
  | 
21 |  | -; Minimum stack alloc is 64 bytes, so no change there.  | 
22 | 22 | ; CHECK-LABEL:  calls_boom:  | 
23 |  | -; CHECK:        subq    $64, %rsp  | 
24 |  | -; CHECK:        .seh_stackalloc 64  | 
 | 23 | +; Minimum stack alloc is 64 bytes, so no change there.  | 
 | 24 | +; X64:          subq    $64, %rsp  | 
 | 25 | +; X64:          .seh_stackalloc 64  | 
 | 26 | +; Only need 48 bytes on the stack, not 64.  | 
 | 27 | +; ARM64:        sub     sp, sp, #48  | 
 | 28 | +; ARM64:        .seh_stackalloc 48  | 
25 | 29 | 
 
  | 
26 | 30 | ; Both the catch blocks load from the same address.  | 
27 | 31 | ; CHECK-LABEL:  "?catch$3@?0?calls_boom@4HA":  | 
28 |  | -; CHECK:        movq    -8(%rbp), %rax  | 
 | 32 | +; X64:          movq    -8(%rbp), %rax  | 
 | 33 | +; ARM64:        ldr     x8, [x29, #24]  | 
29 | 34 | ; CHECK-LABEL:  "?catch$4@?0?calls_boom@4HA":  | 
30 |  | -; CHECK:        movq    -8(%rbp), %rax  | 
 | 35 | +; X64:          movq    -8(%rbp), %rax  | 
 | 36 | +; ARM64:        ldr     x8, [x29, #24]  | 
31 | 37 | 
 
  | 
32 |  | -; There's enough space for the UnwindHelp to be at 48 instead of 40  | 
33 | 38 | ; CHECK-LABEL:  $cppxdata$calls_boom:  | 
34 |  | -; CHECK:        .long   48                              # UnwindHelp  | 
 | 39 | +; There's enough space for the UnwindHelp to be at 48 instead of 40  | 
 | 40 | +; X64:          .long   48                              # UnwindHelp  | 
 | 41 | +; There's enough space for the UnwindHelp to be at -16 instead of -32  | 
 | 42 | +; ARM64:        .word   -16                             // UnwindHelp  | 
35 | 43 | 
 
  | 
36 | 44 | ; Both catches have the same object offset.  | 
37 | 45 | ; CHECK-LABEL:  $handlerMap$0$calls_boom:  | 
38 |  | -; CHECK:        .long   56                              # CatchObjOffset  | 
39 |  | -; CHECK-NEXT:   .long   "?catch$3@?0?calls_boom@4HA"@IMGREL # Handler  | 
40 |  | -; CHECK:        .long   56                              # CatchObjOffset  | 
41 |  | -; CHECK-NEXT:   .long   "?catch$4@?0?calls_boom@4HA"@IMGREL # Handler  | 
 | 46 | +; X64:          .long   56                              # CatchObjOffset  | 
 | 47 | +; ARM64:        .word   -8                              // CatchObjOffset  | 
 | 48 | +; CHECK-NEXT:   "?catch$3@?0?calls_boom@4HA"@IMGREL  | 
 | 49 | +; X64:          .long   56                              # CatchObjOffset  | 
 | 50 | +; ARM64:        .word   -8                              // CatchObjOffset  | 
 | 51 | +; CHECK-NEXT:   "?catch$4@?0?calls_boom@4HA"@IMGREL  | 
42 | 52 | 
 
  | 
43 | 53 | %rtti.TypeDescriptor2 = type { ptr, ptr, [3 x i8] }  | 
44 | 54 | 
 
  | 
 | 
0 commit comments