From 2b706ee4d3c472dccd8455444388e105647329a2 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 27 Aug 2023 20:25:46 +0200 Subject: [PATCH] Update assembly tests to current nightly --- .../expected/apple-aarch64.s | 2 +- .../test_declare_class/expected/apple-armv7.s | 2 +- .../expected/apple-armv7s.s | 2 +- .../expected/apple-old-x86.s | 32 ++--- .../test_declare_class/expected/apple-x86.s | 32 ++--- .../expected/apple-x86_64.s | 2 +- .../expected/apple-aarch64.s | 3 +- .../test_dynamic_class/expected/apple-armv7.s | 8 +- .../expected/apple-armv7s.s | 44 +++--- .../expected/apple-x86_64.s | 5 +- .../test_dynamic_sel/expected/apple-aarch64.s | 3 +- .../test_dynamic_sel/expected/apple-armv7.s | 9 +- .../test_dynamic_sel/expected/apple-armv7s.s | 44 +++--- .../test_dynamic_sel/expected/apple-x86_64.s | 5 +- .../expected/apple-x86.s | 132 +++++++++--------- .../test_ns_string/expected/apple-aarch64.s | 14 ++ .../test_ns_string/expected/apple-armv7.s | 14 ++ .../test_ns_string/expected/apple-armv7s.s | 14 ++ .../test_ns_string/expected/apple-x86.s | 14 ++ .../test_ns_string/expected/apple-x86_64.s | 14 ++ .../test_ns_string/expected/gnustep-x86_64.s | 15 +- .../expected/gnustep-x86_64.s | 10 +- crates/test-assembly/src/lib.rs | 1 + helper-scripts/run-assembly-tests.sh | 24 ++-- 24 files changed, 265 insertions(+), 180 deletions(-) diff --git a/crates/test-assembly/crates/test_declare_class/expected/apple-aarch64.s b/crates/test-assembly/crates/test_declare_class/expected/apple-aarch64.s index 271e785ac..ec60189d2 100644 --- a/crates/test-assembly/crates/test_declare_class/expected/apple-aarch64.s +++ b/crates/test-assembly/crates/test_declare_class/expected/apple-aarch64.s @@ -789,7 +789,7 @@ l_anon.[ID].3: .p2align 3, 0x0 l_anon.[ID].4: .quad l_anon.[ID].3 - .asciz "t\000\000\000\000\000\000\000\225\000\000\0002\000\000" + .asciz "p\000\000\000\000\000\000\000\225\000\000\0002\000\000" .section __TEXT,__literal4,4byte_literals l_anon.[ID].5: diff --git a/crates/test-assembly/crates/test_declare_class/expected/apple-armv7.s b/crates/test-assembly/crates/test_declare_class/expected/apple-armv7.s index c89f6b361..f6b37478c 100644 --- a/crates/test-assembly/crates/test_declare_class/expected/apple-armv7.s +++ b/crates/test-assembly/crates/test_declare_class/expected/apple-armv7.s @@ -717,7 +717,7 @@ l_anon.[ID].3: .p2align 2, 0x0 l_anon.[ID].4: .long l_anon.[ID].3 - .asciz "t\000\000\000\225\000\000\0002\000\000" + .asciz "p\000\000\000\225\000\000\0002\000\000" .section __TEXT,__literal4,4byte_literals L_anon.[ID].5: diff --git a/crates/test-assembly/crates/test_declare_class/expected/apple-armv7s.s b/crates/test-assembly/crates/test_declare_class/expected/apple-armv7s.s index 9f475c54a..718a0d1fe 100644 --- a/crates/test-assembly/crates/test_declare_class/expected/apple-armv7s.s +++ b/crates/test-assembly/crates/test_declare_class/expected/apple-armv7s.s @@ -720,7 +720,7 @@ l_anon.[ID].3: .p2align 2, 0x0 l_anon.[ID].4: .long l_anon.[ID].3 - .asciz "t\000\000\000\225\000\000\0002\000\000" + .asciz "p\000\000\000\225\000\000\0002\000\000" .section __TEXT,__literal4,4byte_literals L_anon.[ID].5: diff --git a/crates/test-assembly/crates/test_declare_class/expected/apple-old-x86.s b/crates/test-assembly/crates/test_declare_class/expected/apple-old-x86.s index 87a6a5744..736669c17 100644 --- a/crates/test-assembly/crates/test_declare_class/expected/apple-old-x86.s +++ b/crates/test-assembly/crates/test_declare_class/expected/apple-old-x86.s @@ -33,11 +33,11 @@ L1$pb: add esp, 16 test eax, eax je LBB1_4 - mov dword ptr [ebp - 40], eax + mov dword ptr [ebp - 36], eax sub esp, 8 lea eax, [esi + l_anon.[ID].6-L1$pb] lea ecx, [esi + L_anon.[ID].5-L1$pb] - lea ebx, [ebp - 40] + lea ebx, [ebp - 36] push eax push 0 push 1 @@ -152,7 +152,7 @@ L1$pb: push eax call SYM(objc2::declare::ClassBuilder::add_method_inner::GENERATED_ID, 0) add esp, 20 - push dword ptr [ebp - 40] + push dword ptr [ebp - 36] call SYM(objc2::declare::ClassBuilder::register::GENERATED_ID, 0) add esp, 60 pop esi @@ -170,19 +170,19 @@ LBB1_3: call SYM(core::panicking::panic::GENERATED_ID, 0) LBB1_4: lea eax, [esi + l_anon.[ID].21-L1$pb] - mov dword ptr [ebp - 48], eax - lea eax, [esi + SYM(<&str as core[CRATE_ID]::fmt::Display>::fmt, 0)-L1$pb] mov dword ptr [ebp - 44], eax - lea eax, [esi + l_anon.[ID].20-L1$pb] + lea eax, [esi + SYM(<&str as core[CRATE_ID]::fmt::Display>::fmt, 0)-L1$pb] mov dword ptr [ebp - 40], eax - mov dword ptr [ebp - 36], 2 - mov dword ptr [ebp - 24], 0 - lea eax, [ebp - 48] - mov dword ptr [ebp - 32], eax - mov dword ptr [ebp - 28], 1 + lea eax, [esi + l_anon.[ID].20-L1$pb] + mov dword ptr [ebp - 36], eax + mov dword ptr [ebp - 32], 2 + mov dword ptr [ebp - 20], 0 + lea eax, [ebp - 44] + mov dword ptr [ebp - 28], eax + mov dword ptr [ebp - 24], 1 sub esp, 8 lea eax, [esi + l_anon.[ID].10-L1$pb] - lea ecx, [ebp - 40] + lea ecx, [ebp - 36] push eax push ecx call SYM(core::panicking::panic_fmt::GENERATED_ID, 0) @@ -435,10 +435,10 @@ L8$pb: LBB8_2: mov eax, dword ptr [ebx + LL_OBJC_CLASS_REFERENCES_NSObject$non_lazy_ptr-L8$pb] mov eax, dword ptr [eax] - mov dword ptr [ebp - 24], edi - mov dword ptr [ebp - 20], eax + mov dword ptr [ebp - 20], edi + mov dword ptr [ebp - 16], eax sub esp, 8 - lea eax, [ebp - 24] + lea eax, [ebp - 20] push esi push eax call _objc_msgSendSuper @@ -742,7 +742,7 @@ l_anon.[ID].3: .p2align 2, 0x0 l_anon.[ID].4: .long l_anon.[ID].3 - .asciz "t\000\000\000\225\000\000\0002\000\000" + .asciz "p\000\000\000\225\000\000\0002\000\000" .section __TEXT,__literal4,4byte_literals L_anon.[ID].5: diff --git a/crates/test-assembly/crates/test_declare_class/expected/apple-x86.s b/crates/test-assembly/crates/test_declare_class/expected/apple-x86.s index 31b87f358..cb0432314 100644 --- a/crates/test-assembly/crates/test_declare_class/expected/apple-x86.s +++ b/crates/test-assembly/crates/test_declare_class/expected/apple-x86.s @@ -33,11 +33,11 @@ L1$pb: add esp, 16 test eax, eax je LBB1_4 - mov dword ptr [ebp - 40], eax + mov dword ptr [ebp - 36], eax sub esp, 8 lea eax, [esi + l_anon.[ID].6-L1$pb] lea ecx, [esi + L_anon.[ID].5-L1$pb] - lea ebx, [ebp - 40] + lea ebx, [ebp - 36] push eax push 0 push 1 @@ -152,7 +152,7 @@ L1$pb: push eax call SYM(objc2::declare::ClassBuilder::add_method_inner::GENERATED_ID, 0) add esp, 20 - push dword ptr [ebp - 40] + push dword ptr [ebp - 36] call SYM(objc2::declare::ClassBuilder::register::GENERATED_ID, 0) add esp, 60 pop esi @@ -170,19 +170,19 @@ LBB1_3: call SYM(core::panicking::panic::GENERATED_ID, 0) LBB1_4: lea eax, [esi + l_anon.[ID].21-L1$pb] - mov dword ptr [ebp - 48], eax - lea eax, [esi + SYM(<&str as core[CRATE_ID]::fmt::Display>::fmt, 0)-L1$pb] mov dword ptr [ebp - 44], eax - lea eax, [esi + l_anon.[ID].20-L1$pb] + lea eax, [esi + SYM(<&str as core[CRATE_ID]::fmt::Display>::fmt, 0)-L1$pb] mov dword ptr [ebp - 40], eax - mov dword ptr [ebp - 36], 2 - mov dword ptr [ebp - 24], 0 - lea eax, [ebp - 48] - mov dword ptr [ebp - 32], eax - mov dword ptr [ebp - 28], 1 + lea eax, [esi + l_anon.[ID].20-L1$pb] + mov dword ptr [ebp - 36], eax + mov dword ptr [ebp - 32], 2 + mov dword ptr [ebp - 20], 0 + lea eax, [ebp - 44] + mov dword ptr [ebp - 28], eax + mov dword ptr [ebp - 24], 1 sub esp, 8 lea eax, [esi + l_anon.[ID].10-L1$pb] - lea ecx, [ebp - 40] + lea ecx, [ebp - 36] push eax push ecx call SYM(core::panicking::panic_fmt::GENERATED_ID, 0) @@ -435,10 +435,10 @@ L8$pb: LBB8_2: mov eax, dword ptr [ebx + LL_OBJC_CLASSLIST_REFERENCES_$_NSObject$non_lazy_ptr-L8$pb] mov eax, dword ptr [eax] - mov dword ptr [ebp - 24], edi - mov dword ptr [ebp - 20], eax + mov dword ptr [ebp - 20], edi + mov dword ptr [ebp - 16], eax sub esp, 8 - lea eax, [ebp - 24] + lea eax, [ebp - 20] push esi push eax call _objc_msgSendSuper @@ -742,7 +742,7 @@ l_anon.[ID].3: .p2align 2, 0x0 l_anon.[ID].4: .long l_anon.[ID].3 - .asciz "t\000\000\000\225\000\000\0002\000\000" + .asciz "p\000\000\000\225\000\000\0002\000\000" .section __TEXT,__literal4,4byte_literals L_anon.[ID].5: diff --git a/crates/test-assembly/crates/test_declare_class/expected/apple-x86_64.s b/crates/test-assembly/crates/test_declare_class/expected/apple-x86_64.s index 90380c35f..3586c0da7 100644 --- a/crates/test-assembly/crates/test_declare_class/expected/apple-x86_64.s +++ b/crates/test-assembly/crates/test_declare_class/expected/apple-x86_64.s @@ -556,7 +556,7 @@ l_anon.[ID].3: .p2align 3, 0x0 l_anon.[ID].4: .quad l_anon.[ID].3 - .asciz "L\000\000\000\000\000\000\000\225\000\000\0002\000\000" + .asciz "p\000\000\000\000\000\000\000\225\000\000\0002\000\000" .section __TEXT,__literal4,4byte_literals L_anon.[ID].5: diff --git a/crates/test-assembly/crates/test_dynamic_class/expected/apple-aarch64.s b/crates/test-assembly/crates/test_dynamic_class/expected/apple-aarch64.s index 4b28f1a3f..ad0b133b1 100644 --- a/crates/test-assembly/crates/test_dynamic_class/expected/apple-aarch64.s +++ b/crates/test-assembly/crates/test_dynamic_class/expected/apple-aarch64.s @@ -313,12 +313,12 @@ Lloh81: .globl _use_in_loop .p2align 2 _use_in_loop: + cbz x0, LBB6_6 stp x24, x23, [sp, #-64]! stp x22, x21, [sp, #16] stp x20, x19, [sp, #32] stp x29, x30, [sp, #48] add x29, sp, #48 - cbz x0, LBB6_5 mov x19, x0 adrp x23, SYM(test_dynamic_class[CRATE_ID]::use_in_loop::CACHED_CLASS, 0)@PAGE Lloh82: @@ -350,6 +350,7 @@ LBB6_5: ldp x20, x19, [sp, #32] ldp x22, x21, [sp, #16] ldp x24, x23, [sp], #64 +LBB6_6: ret .loh AdrpAdd Lloh86, Lloh87 .loh AdrpAdd Lloh84, Lloh85 diff --git a/crates/test-assembly/crates/test_dynamic_class/expected/apple-armv7.s b/crates/test-assembly/crates/test_dynamic_class/expected/apple-armv7.s index 8d596d8a6..716bdd6d1 100644 --- a/crates/test-assembly/crates/test_dynamic_class/expected/apple-armv7.s +++ b/crates/test-assembly/crates/test_dynamic_class/expected/apple-armv7.s @@ -255,11 +255,12 @@ LPC5_6: .p2align 2 .code 32 _use_in_loop: + cmp r0, #0 + bxeq lr +LBB6_1: push {r4, r5, r6, r7, lr} add r7, sp, #12 push {r8} - cmp r0, #0 - beq LBB6_5 movw r5, :lower16:(SYM(test_dynamic_class[CRATE_ID]::use_in_loop::CACHED_CLASS, 0)-(LPC6_0+8)) mov r4, r0 movt r5, :upper16:(SYM(test_dynamic_class[CRATE_ID]::use_in_loop::CACHED_CLASS, 0)-(LPC6_0+8)) @@ -288,7 +289,8 @@ LBB6_3: b LBB6_2 LBB6_5: pop {r8} - pop {r4, r5, r6, r7, pc} + pop {r4, r5, r6, r7, lr} + bx lr .section __TEXT,__const l_anon.[ID].0: diff --git a/crates/test-assembly/crates/test_dynamic_class/expected/apple-armv7s.s b/crates/test-assembly/crates/test_dynamic_class/expected/apple-armv7s.s index 69a186013..608a84973 100644 --- a/crates/test-assembly/crates/test_dynamic_class/expected/apple-armv7s.s +++ b/crates/test-assembly/crates/test_dynamic_class/expected/apple-armv7s.s @@ -4,16 +4,16 @@ .p2align 2 .code 32 _get_class: - push {r7, lr} - mov r7, sp movw r0, :lower16:(__MergedGlobals-(LPC0_0+8)) movt r0, :upper16:(__MergedGlobals-(LPC0_0+8)) LPC0_0: add r0, pc, r0 ldr r0, [r0] cmp r0, #0 - popne {r7, pc} + bxne lr LBB0_1: + push {r7, lr} + mov r7, sp movw r0, :lower16:(__MergedGlobals-(LPC0_1+8)) movt r0, :upper16:(__MergedGlobals-(LPC0_1+8)) movw r1, :lower16:(l_anon.[ID].0-(LPC0_2+8)) @@ -27,22 +27,23 @@ LPC0_2: LPC0_3: add r2, pc, r2 bl SYM(objc2::__macro_helpers::cache::CachedClass::fetch::GENERATED_ID, 0) - pop {r7, pc} + pop {r7, lr} + bx lr .globl _get_same_class .p2align 2 .code 32 _get_same_class: - push {r7, lr} - mov r7, sp movw r3, :lower16:(__MergedGlobals-(LPC1_0+8)) movt r3, :upper16:(__MergedGlobals-(LPC1_0+8)) LPC1_0: add r3, pc, r3 ldr r0, [r3, #4] cmp r0, #0 - popne {r7, pc} + bxne lr LBB1_1: + push {r7, lr} + mov r7, sp movw r1, :lower16:(l_anon.[ID].0-(LPC1_1+8)) add r0, r3, #4 movt r1, :upper16:(l_anon.[ID].0-(LPC1_1+8)) @@ -53,22 +54,23 @@ LPC1_1: LPC1_2: add r2, pc, r2 bl SYM(objc2::__macro_helpers::cache::CachedClass::fetch::GENERATED_ID, 0) - pop {r7, pc} + pop {r7, lr} + bx lr .globl _get_different_class .p2align 2 .code 32 _get_different_class: - push {r7, lr} - mov r7, sp movw r3, :lower16:(__MergedGlobals-(LPC2_0+8)) movt r3, :upper16:(__MergedGlobals-(LPC2_0+8)) LPC2_0: add r3, pc, r3 ldr r0, [r3, #8] cmp r0, #0 - popne {r7, pc} + bxne lr LBB2_1: + push {r7, lr} + mov r7, sp movw r1, :lower16:(l_anon.[ID].4-(LPC2_1+8)) add r0, r3, #8 movt r1, :upper16:(l_anon.[ID].4-(LPC2_1+8)) @@ -79,22 +81,23 @@ LPC2_1: LPC2_2: add r2, pc, r2 bl SYM(objc2::__macro_helpers::cache::CachedClass::fetch::GENERATED_ID, 0) - pop {r7, pc} + pop {r7, lr} + bx lr .globl _unused_class .p2align 2 .code 32 _unused_class: - push {r7, lr} - mov r7, sp movw r0, :lower16:(SYM(test_dynamic_class[CRATE_ID]::unused_class::CACHED_CLASS, 0)-(LPC3_0+8)) movt r0, :upper16:(SYM(test_dynamic_class[CRATE_ID]::unused_class::CACHED_CLASS, 0)-(LPC3_0+8)) LPC3_0: add r0, pc, r0 ldr r0, [r0] cmp r0, #0 - popne {r7, pc} + bxne lr LBB3_1: + push {r7, lr} + mov r7, sp movw r0, :lower16:(SYM(test_dynamic_class[CRATE_ID]::unused_class::CACHED_CLASS, 0)-(LPC3_1+8)) movt r0, :upper16:(SYM(test_dynamic_class[CRATE_ID]::unused_class::CACHED_CLASS, 0)-(LPC3_1+8)) movw r1, :lower16:(l_anon.[ID].6-(LPC3_2+8)) @@ -108,7 +111,8 @@ LPC3_2: LPC3_3: add r2, pc, r2 bl SYM(objc2::__macro_helpers::cache::CachedClass::fetch::GENERATED_ID, 0) - pop {r7, pc} + pop {r7, lr} + bx lr .globl _use_fns .p2align 2 @@ -267,11 +271,12 @@ LPC5_6: .p2align 2 .code 32 _use_in_loop: + cmp r0, #0 + bxeq lr +LBB6_1: push {r4, r5, r6, r7, lr} add r7, sp, #12 push {r8} - cmp r0, #0 - beq LBB6_5 movw r5, :lower16:(SYM(test_dynamic_class[CRATE_ID]::use_in_loop::CACHED_CLASS, 0)-(LPC6_0+8)) mov r4, r0 movt r5, :upper16:(SYM(test_dynamic_class[CRATE_ID]::use_in_loop::CACHED_CLASS, 0)-(LPC6_0+8)) @@ -300,7 +305,8 @@ LBB6_3: b LBB6_2 LBB6_5: pop {r8} - pop {r4, r5, r6, r7, pc} + pop {r4, r5, r6, r7, lr} + bx lr .section __TEXT,__const l_anon.[ID].0: diff --git a/crates/test-assembly/crates/test_dynamic_class/expected/apple-x86_64.s b/crates/test-assembly/crates/test_dynamic_class/expected/apple-x86_64.s index 7ccd891da..966b7eb3a 100644 --- a/crates/test-assembly/crates/test_dynamic_class/expected/apple-x86_64.s +++ b/crates/test-assembly/crates/test_dynamic_class/expected/apple-x86_64.s @@ -179,14 +179,14 @@ LBB5_3: .globl _use_in_loop .p2align 4, 0x90 _use_in_loop: + test rdi, rdi + je LBB6_6 push rbp mov rbp, rsp push r15 push r14 push r12 push rbx - test rdi, rdi - je LBB6_5 mov rbx, rdi lea r14, [rip + SYM(test_dynamic_class[CRATE_ID]::use_in_loop::CACHED_CLASS, 0)] lea r15, [rip + l_anon.[ID].10] @@ -211,6 +211,7 @@ LBB6_5: pop r14 pop r15 pop rbp +LBB6_6: ret .section __TEXT,__const diff --git a/crates/test-assembly/crates/test_dynamic_sel/expected/apple-aarch64.s b/crates/test-assembly/crates/test_dynamic_sel/expected/apple-aarch64.s index 11f072ca7..33fe531d4 100644 --- a/crates/test-assembly/crates/test_dynamic_sel/expected/apple-aarch64.s +++ b/crates/test-assembly/crates/test_dynamic_sel/expected/apple-aarch64.s @@ -316,11 +316,11 @@ Lloh71: .globl _use_in_loop .p2align 2 _use_in_loop: + cbz x0, LBB7_6 stp x22, x21, [sp, #-48]! stp x20, x19, [sp, #16] stp x29, x30, [sp, #32] add x29, sp, #32 - cbz x0, LBB7_5 mov x19, x0 adrp x22, SYM(test_dynamic_sel[CRATE_ID]::use_in_loop::CACHED_SEL, 0)@PAGE Lloh72: @@ -346,6 +346,7 @@ LBB7_5: ldp x29, x30, [sp, #32] ldp x20, x19, [sp, #16] ldp x22, x21, [sp], #48 +LBB7_6: ret .loh AdrpAdd Lloh74, Lloh75 .loh AdrpAdd Lloh72, Lloh73 diff --git a/crates/test-assembly/crates/test_dynamic_sel/expected/apple-armv7.s b/crates/test-assembly/crates/test_dynamic_sel/expected/apple-armv7.s index a485cb296..f79259864 100644 --- a/crates/test-assembly/crates/test_dynamic_sel/expected/apple-armv7.s +++ b/crates/test-assembly/crates/test_dynamic_sel/expected/apple-armv7.s @@ -262,11 +262,11 @@ LPC6_4: .p2align 2 .code 32 _use_in_loop: - push {r4, r5, r6, r7, lr} - add r7, sp, #12 cmp r0, #0 - popeq {r4, r5, r6, r7, pc} + bxeq lr LBB7_1: + push {r4, r5, r6, r7, lr} + add r7, sp, #12 movw r5, :lower16:(SYM(test_dynamic_sel[CRATE_ID]::use_in_loop::CACHED_SEL, 0)-(LPC7_0+8)) mov r4, r0 movt r5, :upper16:(SYM(test_dynamic_sel[CRATE_ID]::use_in_loop::CACHED_SEL, 0)-(LPC7_0+8)) @@ -289,7 +289,8 @@ LBB7_3: bl SYM(objc2::__macro_helpers::cache::CachedSel::fetch::GENERATED_ID, 0) b LBB7_2 LBB7_5: - pop {r4, r5, r6, r7, pc} + pop {r4, r5, r6, r7, lr} + bx lr .section __TEXT,__const l_anon.[ID].0: diff --git a/crates/test-assembly/crates/test_dynamic_sel/expected/apple-armv7s.s b/crates/test-assembly/crates/test_dynamic_sel/expected/apple-armv7s.s index add9c4df5..ee4618029 100644 --- a/crates/test-assembly/crates/test_dynamic_sel/expected/apple-armv7s.s +++ b/crates/test-assembly/crates/test_dynamic_sel/expected/apple-armv7s.s @@ -4,16 +4,16 @@ .p2align 2 .code 32 _get_sel: - push {r7, lr} - mov r7, sp movw r0, :lower16:(__MergedGlobals-(LPC0_0+8)) movt r0, :upper16:(__MergedGlobals-(LPC0_0+8)) LPC0_0: add r0, pc, r0 ldr r0, [r0] cmp r0, #0 - popne {r7, pc} + bxne lr LBB0_1: + push {r7, lr} + mov r7, sp movw r0, :lower16:(__MergedGlobals-(LPC0_1+8)) movt r0, :upper16:(__MergedGlobals-(LPC0_1+8)) movw r1, :lower16:(l_anon.[ID].0-(LPC0_2+8)) @@ -23,29 +23,31 @@ LPC0_1: LPC0_2: add r1, pc, r1 bl SYM(objc2::__macro_helpers::cache::CachedSel::fetch::GENERATED_ID, 0) - pop {r7, pc} + pop {r7, lr} + bx lr .globl _get_same_sel .p2align 2 .code 32 _get_same_sel: - push {r7, lr} - mov r7, sp movw r2, :lower16:(__MergedGlobals-(LPC1_0+8)) movt r2, :upper16:(__MergedGlobals-(LPC1_0+8)) LPC1_0: add r2, pc, r2 ldr r0, [r2, #4] cmp r0, #0 - popne {r7, pc} + bxne lr LBB1_1: + push {r7, lr} + mov r7, sp movw r1, :lower16:(l_anon.[ID].0-(LPC1_1+8)) add r0, r2, #4 movt r1, :upper16:(l_anon.[ID].0-(LPC1_1+8)) LPC1_1: add r1, pc, r1 bl SYM(objc2::__macro_helpers::cache::CachedSel::fetch::GENERATED_ID, 0) - pop {r7, pc} + pop {r7, lr} + bx lr .globl _get_common_twice .p2align 2 @@ -98,38 +100,39 @@ LPC2_4: .p2align 2 .code 32 _get_different_sel: - push {r7, lr} - mov r7, sp movw r2, :lower16:(__MergedGlobals-(LPC3_0+8)) movt r2, :upper16:(__MergedGlobals-(LPC3_0+8)) LPC3_0: add r2, pc, r2 ldr r0, [r2, #8] cmp r0, #0 - popne {r7, pc} + bxne lr LBB3_1: + push {r7, lr} + mov r7, sp movw r1, :lower16:(L_anon.[ID].2-(LPC3_1+8)) add r0, r2, #8 movt r1, :upper16:(L_anon.[ID].2-(LPC3_1+8)) LPC3_1: add r1, pc, r1 bl SYM(objc2::__macro_helpers::cache::CachedSel::fetch::GENERATED_ID, 0) - pop {r7, pc} + pop {r7, lr} + bx lr .globl _unused_sel .p2align 2 .code 32 _unused_sel: - push {r7, lr} - mov r7, sp movw r0, :lower16:(SYM(test_dynamic_sel[CRATE_ID]::unused_sel::CACHED_SEL, 0)-(LPC4_0+8)) movt r0, :upper16:(SYM(test_dynamic_sel[CRATE_ID]::unused_sel::CACHED_SEL, 0)-(LPC4_0+8)) LPC4_0: add r0, pc, r0 ldr r0, [r0] cmp r0, #0 - popne {r7, pc} + bxne lr LBB4_1: + push {r7, lr} + mov r7, sp movw r0, :lower16:(SYM(test_dynamic_sel[CRATE_ID]::unused_sel::CACHED_SEL, 0)-(LPC4_1+8)) movt r0, :upper16:(SYM(test_dynamic_sel[CRATE_ID]::unused_sel::CACHED_SEL, 0)-(LPC4_1+8)) movw r1, :lower16:(l_anon.[ID].3-(LPC4_2+8)) @@ -139,7 +142,8 @@ LPC4_1: LPC4_2: add r1, pc, r1 bl SYM(objc2::__macro_helpers::cache::CachedSel::fetch::GENERATED_ID, 0) - pop {r7, pc} + pop {r7, lr} + bx lr .globl _use_fns .p2align 2 @@ -274,10 +278,11 @@ LPC6_4: .p2align 2 .code 32 _use_in_loop: + cmp r0, #0 + bxeq lr +LBB7_1: push {r4, r5, r6, r7, lr} add r7, sp, #12 - cmp r0, #0 - beq LBB7_5 movw r5, :lower16:(SYM(test_dynamic_sel[CRATE_ID]::use_in_loop::CACHED_SEL, 0)-(LPC7_0+8)) mov r4, r0 movt r5, :upper16:(SYM(test_dynamic_sel[CRATE_ID]::use_in_loop::CACHED_SEL, 0)-(LPC7_0+8)) @@ -300,7 +305,8 @@ LBB7_3: bl SYM(objc2::__macro_helpers::cache::CachedSel::fetch::GENERATED_ID, 0) b LBB7_2 LBB7_5: - pop {r4, r5, r6, r7, pc} + pop {r4, r5, r6, r7, lr} + bx lr .section __TEXT,__const l_anon.[ID].0: diff --git a/crates/test-assembly/crates/test_dynamic_sel/expected/apple-x86_64.s b/crates/test-assembly/crates/test_dynamic_sel/expected/apple-x86_64.s index 8216efc2d..bb609b0d0 100644 --- a/crates/test-assembly/crates/test_dynamic_sel/expected/apple-x86_64.s +++ b/crates/test-assembly/crates/test_dynamic_sel/expected/apple-x86_64.s @@ -204,14 +204,14 @@ LBB6_3: .globl _use_in_loop .p2align 4, 0x90 _use_in_loop: + test rdi, rdi + je LBB7_6 push rbp mov rbp, rsp push r15 push r14 push rbx push rax - test rdi, rdi - je LBB7_5 mov rbx, rdi lea r14, [rip + SYM(test_dynamic_sel[CRATE_ID]::use_in_loop::CACHED_SEL, 0)] lea r15, [rip + l_anon.[ID].5] @@ -234,6 +234,7 @@ LBB7_5: pop r14 pop r15 pop rbp +LBB7_6: ret .section __TEXT,__const diff --git a/crates/test-assembly/crates/test_fast_enumeration/expected/apple-x86.s b/crates/test-assembly/crates/test_fast_enumeration/expected/apple-x86.s index b4a70918f..e71ba2465 100644 --- a/crates/test-assembly/crates/test_fast_enumeration/expected/apple-x86.s +++ b/crates/test-assembly/crates/test_fast_enumeration/expected/apple-x86.s @@ -125,34 +125,34 @@ _iter: L3$pb: pop eax mov ebx, dword ptr [ebp + 8] - mov dword ptr [ebp - 44], 0 - mov dword ptr [ebp - 48], 0 - mov dword ptr [ebp - 36], 0 mov dword ptr [ebp - 40], 0 + mov dword ptr [ebp - 44], 0 mov dword ptr [ebp - 32], 0 - mov dword ptr [ebp - 128], ebx - lea edi, [ebp - 60] - mov dword ptr [ebp - 120], 0 - mov dword ptr [ebp - 124], 0 - mov dword ptr [ebp - 112], 0 + mov dword ptr [ebp - 36], 0 + mov dword ptr [ebp - 28], 0 + mov dword ptr [ebp - 124], ebx + lea edi, [ebp - 56] mov dword ptr [ebp - 116], 0 - mov dword ptr [ebp - 104], 0 + mov dword ptr [ebp - 120], 0 mov dword ptr [ebp - 108], 0 - mov dword ptr [ebp - 96], 0 + mov dword ptr [ebp - 112], 0 mov dword ptr [ebp - 100], 0 - mov dword ptr [ebp - 88], 0 + mov dword ptr [ebp - 104], 0 mov dword ptr [ebp - 92], 0 - mov dword ptr [ebp - 80], 0 + mov dword ptr [ebp - 96], 0 mov dword ptr [ebp - 84], 0 - mov dword ptr [ebp - 72], 0 + mov dword ptr [ebp - 88], 0 mov dword ptr [ebp - 76], 0 - mov dword ptr [ebp - 64], 0 + mov dword ptr [ebp - 80], 0 mov dword ptr [ebp - 68], 0 - mov dword ptr [ebp - 56], 0 + mov dword ptr [ebp - 72], 0 mov dword ptr [ebp - 60], 0 + mov dword ptr [ebp - 64], 0 mov dword ptr [ebp - 52], 0 - mov dword ptr [ebp - 28], 0 + mov dword ptr [ebp - 56], 0 + mov dword ptr [ebp - 48], 0 mov dword ptr [ebp - 24], 0 + mov dword ptr [ebp - 20], 0 mov esi, dword ptr [eax + LSYM(icrate::Foundation::generated::__NSEnumerator::NSFastEnumeration::countByEnumeratingWithState_objects_count::CACHED_SEL::GENERATED_ID, 0)$non_lazy_ptr-L3$pb] lea eax, [eax + l_anon.[ID].0-L3$pb] mov dword ptr [ebp - 16], eax @@ -163,28 +163,28 @@ L3$pb: LBB3_4: sub esp, 12 push 16 - lea ecx, [ebp - 124] + lea ecx, [ebp - 120] push ecx push edi push eax push ebx call _objc_msgSend add esp, 32 - mov dword ptr [ebp - 24], eax + mov dword ptr [ebp - 20], eax xor ecx, ecx test eax, eax je LBB3_5 LBB3_6: - mov eax, dword ptr [ebp - 56] + mov eax, dword ptr [ebp - 52] lea edx, [ecx + 1] - mov dword ptr [ebp - 28], edx + mov dword ptr [ebp - 24], edx sub esp, 12 push dword ptr [eax + 4*ecx] call _use_obj add esp, 16 - mov ebx, dword ptr [ebp - 128] - mov ecx, dword ptr [ebp - 28] - mov eax, dword ptr [ebp - 24] + mov ebx, dword ptr [ebp - 124] + mov ecx, dword ptr [ebp - 24] + mov eax, dword ptr [ebp - 20] LBB3_1: cmp ecx, eax jb LBB3_6 @@ -218,34 +218,34 @@ _iter_noop: L4$pb: pop eax mov ebx, dword ptr [ebp + 8] - mov dword ptr [ebp - 44], 0 - mov dword ptr [ebp - 48], 0 - mov dword ptr [ebp - 36], 0 mov dword ptr [ebp - 40], 0 + mov dword ptr [ebp - 44], 0 mov dword ptr [ebp - 32], 0 - mov dword ptr [ebp - 128], ebx - lea edi, [ebp - 60] - mov dword ptr [ebp - 120], 0 - mov dword ptr [ebp - 124], 0 - mov dword ptr [ebp - 112], 0 + mov dword ptr [ebp - 36], 0 + mov dword ptr [ebp - 28], 0 + mov dword ptr [ebp - 124], ebx + lea edi, [ebp - 56] mov dword ptr [ebp - 116], 0 - mov dword ptr [ebp - 104], 0 + mov dword ptr [ebp - 120], 0 mov dword ptr [ebp - 108], 0 - mov dword ptr [ebp - 96], 0 + mov dword ptr [ebp - 112], 0 mov dword ptr [ebp - 100], 0 - mov dword ptr [ebp - 88], 0 + mov dword ptr [ebp - 104], 0 mov dword ptr [ebp - 92], 0 - mov dword ptr [ebp - 80], 0 + mov dword ptr [ebp - 96], 0 mov dword ptr [ebp - 84], 0 - mov dword ptr [ebp - 72], 0 + mov dword ptr [ebp - 88], 0 mov dword ptr [ebp - 76], 0 - mov dword ptr [ebp - 64], 0 + mov dword ptr [ebp - 80], 0 mov dword ptr [ebp - 68], 0 - mov dword ptr [ebp - 56], 0 + mov dword ptr [ebp - 72], 0 mov dword ptr [ebp - 60], 0 + mov dword ptr [ebp - 64], 0 mov dword ptr [ebp - 52], 0 - mov dword ptr [ebp - 28], 0 + mov dword ptr [ebp - 56], 0 + mov dword ptr [ebp - 48], 0 mov dword ptr [ebp - 24], 0 + mov dword ptr [ebp - 20], 0 mov esi, dword ptr [eax + LSYM(icrate::Foundation::generated::__NSEnumerator::NSFastEnumeration::countByEnumeratingWithState_objects_count::CACHED_SEL::GENERATED_ID, 0)$non_lazy_ptr-L4$pb] lea eax, [eax + l_anon.[ID].0-L4$pb] mov dword ptr [ebp - 16], eax @@ -255,7 +255,7 @@ L4$pb: .p2align 4, 0x90 LBB4_6: inc ecx - mov dword ptr [ebp - 28], ecx + mov dword ptr [ebp - 24], ecx LBB4_1: cmp ecx, eax jb LBB4_6 @@ -265,18 +265,18 @@ LBB4_1: LBB4_4: sub esp, 12 push 16 - lea ecx, [ebp - 124] + lea ecx, [ebp - 120] push ecx push edi push eax push ebx call _objc_msgSend add esp, 32 - mov dword ptr [ebp - 24], eax + mov dword ptr [ebp - 20], eax test eax, eax je LBB4_7 xor ecx, ecx - mov ebx, dword ptr [ebp - 128] + mov ebx, dword ptr [ebp - 124] jmp LBB4_6 LBB4_3: sub esp, 8 @@ -306,34 +306,34 @@ _iter_retained: L5$pb: pop eax mov esi, dword ptr [ebp + 8] - mov dword ptr [ebp - 44], 0 - mov dword ptr [ebp - 48], 0 - mov dword ptr [ebp - 36], 0 mov dword ptr [ebp - 40], 0 + mov dword ptr [ebp - 44], 0 mov dword ptr [ebp - 32], 0 - mov dword ptr [ebp - 128], esi - lea ebx, [ebp - 60] - mov dword ptr [ebp - 120], 0 - mov dword ptr [ebp - 124], 0 - mov dword ptr [ebp - 112], 0 + mov dword ptr [ebp - 36], 0 + mov dword ptr [ebp - 28], 0 + mov dword ptr [ebp - 124], esi + lea ebx, [ebp - 56] mov dword ptr [ebp - 116], 0 - mov dword ptr [ebp - 104], 0 + mov dword ptr [ebp - 120], 0 mov dword ptr [ebp - 108], 0 - mov dword ptr [ebp - 96], 0 + mov dword ptr [ebp - 112], 0 mov dword ptr [ebp - 100], 0 - mov dword ptr [ebp - 88], 0 + mov dword ptr [ebp - 104], 0 mov dword ptr [ebp - 92], 0 - mov dword ptr [ebp - 80], 0 + mov dword ptr [ebp - 96], 0 mov dword ptr [ebp - 84], 0 - mov dword ptr [ebp - 72], 0 + mov dword ptr [ebp - 88], 0 mov dword ptr [ebp - 76], 0 - mov dword ptr [ebp - 64], 0 + mov dword ptr [ebp - 80], 0 mov dword ptr [ebp - 68], 0 - mov dword ptr [ebp - 56], 0 + mov dword ptr [ebp - 72], 0 mov dword ptr [ebp - 60], 0 + mov dword ptr [ebp - 64], 0 mov dword ptr [ebp - 52], 0 - mov dword ptr [ebp - 28], 0 + mov dword ptr [ebp - 56], 0 + mov dword ptr [ebp - 48], 0 mov dword ptr [ebp - 24], 0 + mov dword ptr [ebp - 20], 0 mov edi, dword ptr [eax + LSYM(icrate::Foundation::generated::__NSEnumerator::NSFastEnumeration::countByEnumeratingWithState_objects_count::CACHED_SEL::GENERATED_ID, 0)$non_lazy_ptr-L5$pb] lea eax, [eax + l_anon.[ID].0-L5$pb] mov dword ptr [ebp - 16], eax @@ -344,21 +344,21 @@ L5$pb: LBB5_4: sub esp, 12 push 16 - lea ecx, [ebp - 124] + lea ecx, [ebp - 120] push ecx push ebx push eax push esi call _objc_msgSend add esp, 32 - mov dword ptr [ebp - 24], eax + mov dword ptr [ebp - 20], eax xor ecx, ecx test eax, eax je LBB5_5 LBB5_6: - mov eax, dword ptr [ebp - 56] + mov eax, dword ptr [ebp - 52] lea edx, [ecx + 1] - mov dword ptr [ebp - 28], edx + mov dword ptr [ebp - 24], edx sub esp, 12 push dword ptr [eax + 4*ecx] call _objc_retain @@ -371,9 +371,9 @@ LBB5_6: push esi call _objc_release add esp, 16 - mov esi, dword ptr [ebp - 128] - mov ecx, dword ptr [ebp - 28] - mov eax, dword ptr [ebp - 24] + mov esi, dword ptr [ebp - 124] + mov ecx, dword ptr [ebp - 24] + mov eax, dword ptr [ebp - 20] LBB5_1: cmp ecx, eax jb LBB5_6 diff --git a/crates/test-assembly/crates/test_ns_string/expected/apple-aarch64.s b/crates/test-assembly/crates/test_ns_string/expected/apple-aarch64.s index b4af13383..72c0a3657 100644 --- a/crates/test-assembly/crates/test_ns_string/expected/apple-aarch64.s +++ b/crates/test-assembly/crates/test_ns_string/expected/apple-aarch64.s @@ -41,9 +41,16 @@ _XYZ: .quad SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0) SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0): .space 1 + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0): + .space 2 + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0) .p2align 3, 0x0 @@ -54,9 +61,16 @@ SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0): .space 8 .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0) SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0): .asciz "xyz" + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0): + .asciz "x\000y\000z\000\000" + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .p2align 3, 0x0 diff --git a/crates/test-assembly/crates/test_ns_string/expected/apple-armv7.s b/crates/test-assembly/crates/test_ns_string/expected/apple-armv7.s index 56285f623..affe294c2 100644 --- a/crates/test-assembly/crates/test_ns_string/expected/apple-armv7.s +++ b/crates/test-assembly/crates/test_ns_string/expected/apple-armv7.s @@ -42,9 +42,16 @@ _XYZ: .long SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0) SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0): .space 1 + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0): + .space 2 + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0) .p2align 2, 0x0 @@ -55,9 +62,16 @@ SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0): .space 4 .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0) SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0): .asciz "xyz" + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0): + .asciz "x\000y\000z\000\000" + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .p2align 2, 0x0 diff --git a/crates/test-assembly/crates/test_ns_string/expected/apple-armv7s.s b/crates/test-assembly/crates/test_ns_string/expected/apple-armv7s.s index 56285f623..affe294c2 100644 --- a/crates/test-assembly/crates/test_ns_string/expected/apple-armv7s.s +++ b/crates/test-assembly/crates/test_ns_string/expected/apple-armv7s.s @@ -42,9 +42,16 @@ _XYZ: .long SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0) SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0): .space 1 + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0): + .space 2 + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0) .p2align 2, 0x0 @@ -55,9 +62,16 @@ SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0): .space 4 .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0) SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0): .asciz "xyz" + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0): + .asciz "x\000y\000z\000\000" + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .p2align 2, 0x0 diff --git a/crates/test-assembly/crates/test_ns_string/expected/apple-x86.s b/crates/test-assembly/crates/test_ns_string/expected/apple-x86.s index 7d4c14ca1..e5fb7cc78 100644 --- a/crates/test-assembly/crates/test_ns_string/expected/apple-x86.s +++ b/crates/test-assembly/crates/test_ns_string/expected/apple-x86.s @@ -48,9 +48,16 @@ _XYZ: .long SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0) SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0): .space 1 + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0): + .space 2 + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0) .p2align 2, 0x0 @@ -61,9 +68,16 @@ SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0): .space 4 .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0) SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0): .asciz "xyz" + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0): + .asciz "x\000y\000z\000\000" + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .p2align 2, 0x0 diff --git a/crates/test-assembly/crates/test_ns_string/expected/apple-x86_64.s b/crates/test-assembly/crates/test_ns_string/expected/apple-x86_64.s index 7ab74f733..1303d8b1c 100644 --- a/crates/test-assembly/crates/test_ns_string/expected/apple-x86_64.s +++ b/crates/test-assembly/crates/test_ns_string/expected/apple-x86_64.s @@ -39,9 +39,16 @@ _XYZ: .quad SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0) SYM(test_ns_string[CRATE_ID]::EMPTY::ASCII, 0): .space 1 + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::EMPTY::UTF16, 0): + .space 2 + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0) .p2align 3, 0x0 @@ -52,9 +59,16 @@ SYM(test_ns_string[CRATE_ID]::EMPTY::CFSTRING, 0): .space 8 .section __TEXT,__cstring,cstring_literals + .globl SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0) SYM(test_ns_string[CRATE_ID]::XYZ::ASCII, 0): .asciz "xyz" + .section __TEXT,__ustring + .globl SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0) + .p2align 1, 0x0 +SYM(test_ns_string[CRATE_ID]::XYZ::UTF16, 0): + .asciz "x\000y\000z\000\000" + .section __DATA,__cfstring .globl SYM(test_ns_string[CRATE_ID]::XYZ::CFSTRING, 0) .p2align 3, 0x0 diff --git a/crates/test-assembly/crates/test_ns_string/expected/gnustep-x86_64.s b/crates/test-assembly/crates/test_ns_string/expected/gnustep-x86_64.s index ee7af6226..050c70ee2 100644 --- a/crates/test-assembly/crates/test_ns_string/expected/gnustep-x86_64.s +++ b/crates/test-assembly/crates/test_ns_string/expected/gnustep-x86_64.s @@ -5,19 +5,18 @@ .p2align 4, 0x90 .type get_ascii,@function get_ascii: - push rax mov rax, qword ptr [rip + SYM(test_ns_string[CRATE_ID]::get_ascii::CACHED_NSSTRING, 0).0] test rax, rax je .LBB0_1 - pop rcx ret .LBB0_1: + push rax lea rdi, [rip + .Lanon.[ID].0] mov esi, 3 call qword ptr [rip + SYM(icrate::Foundation::additions::string::::from_str::GENERATED_ID, 0)@GOTPCREL] mov rcx, rax xchg qword ptr [rip + SYM(test_ns_string[CRATE_ID]::get_ascii::CACHED_NSSTRING, 0).0], rcx - pop rcx + add rsp, 8 ret .Lfunc_end0: .size get_ascii, .Lfunc_end0-get_ascii @@ -27,19 +26,18 @@ get_ascii: .p2align 4, 0x90 .type get_utf16,@function get_utf16: - push rax mov rax, qword ptr [rip + SYM(test_ns_string[CRATE_ID]::get_utf16::CACHED_NSSTRING, 0).0] test rax, rax je .LBB1_1 - pop rcx ret .LBB1_1: + push rax lea rdi, [rip + .Lanon.[ID].1] mov esi, 5 call qword ptr [rip + SYM(icrate::Foundation::additions::string::::from_str::GENERATED_ID, 0)@GOTPCREL] mov rcx, rax xchg qword ptr [rip + SYM(test_ns_string[CRATE_ID]::get_utf16::CACHED_NSSTRING, 0).0], rcx - pop rcx + add rsp, 8 ret .Lfunc_end1: .size get_utf16, .Lfunc_end1-get_utf16 @@ -49,19 +47,18 @@ get_utf16: .p2align 4, 0x90 .type get_with_nul,@function get_with_nul: - push rax mov rax, qword ptr [rip + SYM(test_ns_string[CRATE_ID]::get_with_nul::CACHED_NSSTRING, 0).0] test rax, rax je .LBB2_1 - pop rcx ret .LBB2_1: + push rax lea rdi, [rip + .Lanon.[ID].2] mov esi, 6 call qword ptr [rip + SYM(icrate::Foundation::additions::string::::from_str::GENERATED_ID, 0)@GOTPCREL] mov rcx, rax xchg qword ptr [rip + SYM(test_ns_string[CRATE_ID]::get_with_nul::CACHED_NSSTRING, 0).0], rcx - pop rcx + add rsp, 8 ret .Lfunc_end2: .size get_with_nul, .Lfunc_end2-get_with_nul diff --git a/crates/test-assembly/crates/test_out_parameters/expected/gnustep-x86_64.s b/crates/test-assembly/crates/test_out_parameters/expected/gnustep-x86_64.s index 2b2e30f9a..ad38d928b 100644 --- a/crates/test-assembly/crates/test_out_parameters/expected/gnustep-x86_64.s +++ b/crates/test-assembly/crates/test_out_parameters/expected/gnustep-x86_64.s @@ -48,14 +48,13 @@ null_nonnull: mov r14, rsi mov r15, rdi call qword ptr [rip + objc_msg_lookup@GOTPCREL] - mov rcx, rax test rbx, rbx je .LBB1_2 mov r12, qword ptr [rbx] mov rdi, r15 mov rsi, r14 mov rdx, rbx - call rcx + call rax mov r14, rax mov rdi, qword ptr [rbx] call qword ptr [rip + objc_retain@GOTPCREL] @@ -77,7 +76,7 @@ null_nonnull: pop r12 pop r14 pop r15 - jmp rcx + jmp rax .Lfunc_end1: .size null_nonnull, .Lfunc_end1-null_nonnull @@ -132,14 +131,13 @@ null_null: mov r14, rsi mov r12, rdi call qword ptr [rip + objc_msg_lookup@GOTPCREL] - mov rcx, rax test rbx, rbx je .LBB3_4 mov r15, qword ptr [rbx] mov rdi, r12 mov rsi, r14 mov rdx, rbx - call rcx + call rax mov r14, rax mov rdi, qword ptr [rbx] call qword ptr [rip + objc_retain@GOTPCREL] @@ -164,7 +162,7 @@ null_null: pop r12 pop r14 pop r15 - jmp rcx + jmp rax .Lfunc_end3: .size null_null, .Lfunc_end3-null_null diff --git a/crates/test-assembly/src/lib.rs b/crates/test-assembly/src/lib.rs index 5c6fb8e64..105464d5c 100644 --- a/crates/test-assembly/src/lib.rs +++ b/crates/test-assembly/src/lib.rs @@ -102,6 +102,7 @@ pub fn read_assembly>(path: P, package_path: &Path) -> io::Result let s = strip_lines(&s, ".file"); // Added in nightly-2022-07-21 let s = strip_lines(&s, ".no_dead_strip"); + let s = strip_lines(&s, ".ident\t\"rustc "); // We remove the __LLVM,__bitcode and __LLVM,__cmdline sections because // they're uninteresting for out use-case. // diff --git a/helper-scripts/run-assembly-tests.sh b/helper-scripts/run-assembly-tests.sh index eaf510f43..4672b3f65 100755 --- a/helper-scripts/run-assembly-tests.sh +++ b/helper-scripts/run-assembly-tests.sh @@ -4,30 +4,30 @@ set -euxo pipefail -export ARGS="run --features=run --bin=test-assembly -- --target" +ARGS="run --features=run --bin=test-assembly -- -Zbuild-std --target" # Add `+nightly` when using `-Zbuild-std` if the user's `cargo` is not a # `nightly` by default if grep -q nightly <<< $(cargo --version); then - export NIGHTLY="" + NIGHTLY="" else - export NIGHTLY="+nightly" + NIGHTLY="+nightly" fi echo "Apple" cargo $NIGHTLY $ARGS x86_64-apple-darwin -cargo $NIGHTLY $ARGS aarch64-apple-darwin -Zbuild-std -cargo $NIGHTLY $ARGS armv7s-apple-ios -Zbuild-std -cargo $NIGHTLY $ARGS armv7-apple-ios -Zbuild-std -cargo $NIGHTLY $ARGS i386-apple-ios -Zbuild-std +cargo $NIGHTLY $ARGS aarch64-apple-darwin +cargo $NIGHTLY $ARGS armv7s-apple-ios +cargo $NIGHTLY $ARGS armv7-apple-ios +cargo $NIGHTLY $ARGS i386-apple-ios echo "Old Apple" -cargo $NIGHTLY $ARGS i686-apple-darwin -Zbuild-std +cargo $NIGHTLY $ARGS i686-apple-darwin echo "GNUStep" -cargo $NIGHTLY $ARGS x86_64-unknown-linux-gnu -Zbuild-std --no-default-features --features=std,gnustep-2-1 -cargo $NIGHTLY $ARGS i686-unknown-linux-gnu -Zbuild-std --no-default-features --features=std,gnustep-2-1 +cargo $NIGHTLY $ARGS x86_64-unknown-linux-gnu --no-default-features --features=std,gnustep-2-1 +cargo $NIGHTLY $ARGS i686-unknown-linux-gnu --no-default-features --features=std,gnustep-2-1 echo "Old GNUStep" -cargo $NIGHTLY $ARGS x86_64-unknown-linux-gnu -Zbuild-std --no-default-features --features=std,gnustep-1-7 -cargo $NIGHTLY $ARGS i686-unknown-linux-gnu -Zbuild-std --no-default-features --features=std,gnustep-1-7 +cargo $NIGHTLY $ARGS x86_64-unknown-linux-gnu --no-default-features --features=std,gnustep-1-7 +cargo $NIGHTLY $ARGS i686-unknown-linux-gnu --no-default-features --features=std,gnustep-1-7