diff --git a/tests/assembly/test_msg_send_id/expected/x86_64-apple-darwin.ll b/tests/assembly/test_msg_send_id/expected/x86_64-apple-darwin.ll index c97bb5f38..95a211b0f 100644 --- a/tests/assembly/test_msg_send_id/expected/x86_64-apple-darwin.ll +++ b/tests/assembly/test_msg_send_id/expected/x86_64-apple-darwin.ll @@ -216,4 +216,4 @@ attributes #3 = { inaccessiblememonly nounwind } !110 = distinct !{!110, !111, !"_ZN4core6result19Result$LT$T$C$E$GT$3map17h6973c903a4a56d77E: argument 0"} !111 = distinct !{!111, !"_ZN4core6result19Result$LT$T$C$E$GT$3map17h6973c903a4a56d77E"} !112 = distinct !{!112, !111, !"_ZN4core6result19Result$LT$T$C$E$GT$3map17h6973c903a4a56d77E: %self"} -!113 = !{i32 14074831} +!113 = !{i32 14075183} diff --git a/tests/assembly/test_retain_autoreleased/expected/x86_64-apple-darwin.ll b/tests/assembly/test_retain_autoreleased/expected/x86_64-apple-darwin.ll index ce12d6750..012b83c3c 100644 --- a/tests/assembly/test_retain_autoreleased/expected/x86_64-apple-darwin.ll +++ b/tests/assembly/test_retain_autoreleased/expected/x86_64-apple-darwin.ll @@ -44,4 +44,4 @@ attributes #2 = { inaccessiblememonly nounwind } !8 = distinct !{!8, !"_ZN5objc27message8platform15send_unverified17hc201b8e753fc02dbE"} !9 = distinct !{!9, !10, !"_ZN5objc27message15MessageReceiver12send_message17hb26bf01fb9c18ba0E: argument 0"} !10 = distinct !{!10, !"_ZN5objc27message15MessageReceiver12send_message17hb26bf01fb9c18ba0E"} -!11 = !{i32 14073351} +!11 = !{i32 14073703} diff --git a/tests/assembly/test_static_sel/expected/apple-aarch64.s b/tests/assembly/test_static_sel/expected/apple-aarch64.s index b152c2912..3af5dcb4e 100644 --- a/tests/assembly/test_static_sel/expected/apple-aarch64.s +++ b/tests/assembly/test_static_sel/expected/apple-aarch64.s @@ -39,6 +39,36 @@ Lloh7: ret .loh AdrpLdr Lloh6, Lloh7 + .globl _use_fns + .p2align 2 +_use_fns: +Lloh8: + adrp x9, L_OBJC_SELECTOR_REFERENCES_43d7e4d3b832d234@PAGE +Lloh9: + ldr x9, [x9, L_OBJC_SELECTOR_REFERENCES_43d7e4d3b832d234@PAGEOFF] +Lloh10: + adrp x10, L_OBJC_SELECTOR_REFERENCES_475a96ed80683d38@PAGE +Lloh11: + ldr x10, [x10, L_OBJC_SELECTOR_REFERENCES_475a96ed80683d38@PAGEOFF] +Lloh12: + adrp x11, L_OBJC_SELECTOR_REFERENCES_7ece3464aee33aa8@PAGE +Lloh13: + ldr x11, [x11, L_OBJC_SELECTOR_REFERENCES_7ece3464aee33aa8@PAGEOFF] + stp x9, x10, [x8] + str x11, [x8, #16] + ret + .loh AdrpLdr Lloh12, Lloh13 + .loh AdrpLdr Lloh10, Lloh11 + .loh AdrpLdr Lloh8, Lloh9 + + .globl _use_generic + .p2align 2 +_use_generic: + adrp x8, L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885@PAGE + ldr x0, [x8, L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885@PAGEOFF] + ldr x1, [x8, L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885@PAGEOFF] + ret + .section __DATA,__objc_imageinfo,regular,no_dead_strip .globl L_OBJC_IMAGE_INFO_43d7e4d3b832d234 .p2align 2 @@ -107,4 +137,21 @@ L_OBJC_METH_VAR_NAME_501d7eaffe8512eb: L_OBJC_SELECTOR_REFERENCES_501d7eaffe8512eb: .quad L_OBJC_METH_VAR_NAME_501d7eaffe8512eb + .section __DATA,__objc_imageinfo,regular,no_dead_strip + .globl L_OBJC_IMAGE_INFO_17dedb23a5725885 + .p2align 2 +L_OBJC_IMAGE_INFO_17dedb23a5725885: + .space 8 + + .section __TEXT,__objc_methname,cstring_literals + .globl L_OBJC_METH_VAR_NAME_17dedb23a5725885 +L_OBJC_METH_VAR_NAME_17dedb23a5725885: + .asciz "generic:" + + .section __DATA,__objc_selrefs,literal_pointers + .globl L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885 + .p2align 3 +L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885: + .quad L_OBJC_METH_VAR_NAME_17dedb23a5725885 + .subsections_via_symbols diff --git a/tests/assembly/test_static_sel/expected/apple-armv7.s b/tests/assembly/test_static_sel/expected/apple-armv7.s index 16e30b57b..8e0372763 100644 --- a/tests/assembly/test_static_sel/expected/apple-armv7.s +++ b/tests/assembly/test_static_sel/expected/apple-armv7.s @@ -40,6 +40,39 @@ LPC3_0: ldr r0, [pc, r0] bx lr + .globl _use_fns + .p2align 2 + .code 32 +_use_fns: + movw r1, :lower16:(L_OBJC_SELECTOR_REFERENCES_43d7e4d3b832d234-(LPC4_0+8)) + movt r1, :upper16:(L_OBJC_SELECTOR_REFERENCES_43d7e4d3b832d234-(LPC4_0+8)) +LPC4_0: + ldr r1, [pc, r1] + movw r2, :lower16:(L_OBJC_SELECTOR_REFERENCES_475a96ed80683d38-(LPC4_1+8)) + movt r2, :upper16:(L_OBJC_SELECTOR_REFERENCES_475a96ed80683d38-(LPC4_1+8)) +LPC4_1: + ldr r2, [pc, r2] + movw r3, :lower16:(L_OBJC_SELECTOR_REFERENCES_7ece3464aee33aa8-(LPC4_2+8)) + movt r3, :upper16:(L_OBJC_SELECTOR_REFERENCES_7ece3464aee33aa8-(LPC4_2+8)) +LPC4_2: + ldr r3, [pc, r3] + stm r0, {r1, r2, r3} + bx lr + + .globl _use_generic + .p2align 2 + .code 32 +_use_generic: + movw r0, :lower16:(L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-(LPC5_0+8)) + movt r0, :upper16:(L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-(LPC5_0+8)) +LPC5_0: + ldr r0, [pc, r0] + movw r1, :lower16:(L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-(LPC5_1+8)) + movt r1, :upper16:(L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-(LPC5_1+8)) +LPC5_1: + ldr r1, [pc, r1] + bx lr + .section __DATA,__objc_imageinfo,regular,no_dead_strip .globl L_OBJC_IMAGE_INFO_43d7e4d3b832d234 .p2align 2 @@ -108,4 +141,21 @@ L_OBJC_METH_VAR_NAME_501d7eaffe8512eb: L_OBJC_SELECTOR_REFERENCES_501d7eaffe8512eb: .long L_OBJC_METH_VAR_NAME_501d7eaffe8512eb + .section __DATA,__objc_imageinfo,regular,no_dead_strip + .globl L_OBJC_IMAGE_INFO_17dedb23a5725885 + .p2align 2 +L_OBJC_IMAGE_INFO_17dedb23a5725885: + .space 8 + + .section __TEXT,__objc_methname,cstring_literals + .globl L_OBJC_METH_VAR_NAME_17dedb23a5725885 +L_OBJC_METH_VAR_NAME_17dedb23a5725885: + .asciz "generic:" + + .section __DATA,__objc_selrefs,literal_pointers + .globl L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885 + .p2align 2 +L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885: + .long L_OBJC_METH_VAR_NAME_17dedb23a5725885 + .subsections_via_symbols diff --git a/tests/assembly/test_static_sel/expected/apple-armv7s.s b/tests/assembly/test_static_sel/expected/apple-armv7s.s index 16e30b57b..8e0372763 100644 --- a/tests/assembly/test_static_sel/expected/apple-armv7s.s +++ b/tests/assembly/test_static_sel/expected/apple-armv7s.s @@ -40,6 +40,39 @@ LPC3_0: ldr r0, [pc, r0] bx lr + .globl _use_fns + .p2align 2 + .code 32 +_use_fns: + movw r1, :lower16:(L_OBJC_SELECTOR_REFERENCES_43d7e4d3b832d234-(LPC4_0+8)) + movt r1, :upper16:(L_OBJC_SELECTOR_REFERENCES_43d7e4d3b832d234-(LPC4_0+8)) +LPC4_0: + ldr r1, [pc, r1] + movw r2, :lower16:(L_OBJC_SELECTOR_REFERENCES_475a96ed80683d38-(LPC4_1+8)) + movt r2, :upper16:(L_OBJC_SELECTOR_REFERENCES_475a96ed80683d38-(LPC4_1+8)) +LPC4_1: + ldr r2, [pc, r2] + movw r3, :lower16:(L_OBJC_SELECTOR_REFERENCES_7ece3464aee33aa8-(LPC4_2+8)) + movt r3, :upper16:(L_OBJC_SELECTOR_REFERENCES_7ece3464aee33aa8-(LPC4_2+8)) +LPC4_2: + ldr r3, [pc, r3] + stm r0, {r1, r2, r3} + bx lr + + .globl _use_generic + .p2align 2 + .code 32 +_use_generic: + movw r0, :lower16:(L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-(LPC5_0+8)) + movt r0, :upper16:(L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-(LPC5_0+8)) +LPC5_0: + ldr r0, [pc, r0] + movw r1, :lower16:(L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-(LPC5_1+8)) + movt r1, :upper16:(L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-(LPC5_1+8)) +LPC5_1: + ldr r1, [pc, r1] + bx lr + .section __DATA,__objc_imageinfo,regular,no_dead_strip .globl L_OBJC_IMAGE_INFO_43d7e4d3b832d234 .p2align 2 @@ -108,4 +141,21 @@ L_OBJC_METH_VAR_NAME_501d7eaffe8512eb: L_OBJC_SELECTOR_REFERENCES_501d7eaffe8512eb: .long L_OBJC_METH_VAR_NAME_501d7eaffe8512eb + .section __DATA,__objc_imageinfo,regular,no_dead_strip + .globl L_OBJC_IMAGE_INFO_17dedb23a5725885 + .p2align 2 +L_OBJC_IMAGE_INFO_17dedb23a5725885: + .space 8 + + .section __TEXT,__objc_methname,cstring_literals + .globl L_OBJC_METH_VAR_NAME_17dedb23a5725885 +L_OBJC_METH_VAR_NAME_17dedb23a5725885: + .asciz "generic:" + + .section __DATA,__objc_selrefs,literal_pointers + .globl L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885 + .p2align 2 +L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885: + .long L_OBJC_METH_VAR_NAME_17dedb23a5725885 + .subsections_via_symbols diff --git a/tests/assembly/test_static_sel/expected/apple-x86.s b/tests/assembly/test_static_sel/expected/apple-x86.s index b0280ff59..b5ee95733 100644 --- a/tests/assembly/test_static_sel/expected/apple-x86.s +++ b/tests/assembly/test_static_sel/expected/apple-x86.s @@ -48,6 +48,39 @@ L3$pb: pop ebp ret + .globl _use_fns + .p2align 4, 0x90 +_use_fns: + push ebp + mov ebp, esp + push esi + call L4$pb +L4$pb: + pop ecx + mov eax, dword ptr [ebp + 8] + mov edx, dword ptr [ecx + L_OBJC_SELECTOR_REFERENCES_43d7e4d3b832d234-L4$pb] + mov esi, dword ptr [ecx + L_OBJC_SELECTOR_REFERENCES_475a96ed80683d38-L4$pb] + mov ecx, dword ptr [ecx + L_OBJC_SELECTOR_REFERENCES_7ece3464aee33aa8-L4$pb] + mov dword ptr [eax], edx + mov dword ptr [eax + 4], esi + mov dword ptr [eax + 8], ecx + pop esi + pop ebp + ret 4 + + .globl _use_generic + .p2align 4, 0x90 +_use_generic: + push ebp + mov ebp, esp + call L5$pb +L5$pb: + pop ecx + mov eax, dword ptr [ecx + L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-L5$pb] + mov edx, dword ptr [ecx + L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885-L5$pb] + pop ebp + ret + .section __DATA,__objc_imageinfo,regular,no_dead_strip .globl L_OBJC_IMAGE_INFO_43d7e4d3b832d234 .p2align 2 @@ -116,4 +149,21 @@ L_OBJC_METH_VAR_NAME_501d7eaffe8512eb: L_OBJC_SELECTOR_REFERENCES_501d7eaffe8512eb: .long L_OBJC_METH_VAR_NAME_501d7eaffe8512eb + .section __DATA,__objc_imageinfo,regular,no_dead_strip + .globl L_OBJC_IMAGE_INFO_17dedb23a5725885 + .p2align 2 +L_OBJC_IMAGE_INFO_17dedb23a5725885: + .space 8 + + .section __TEXT,__objc_methname,cstring_literals + .globl L_OBJC_METH_VAR_NAME_17dedb23a5725885 +L_OBJC_METH_VAR_NAME_17dedb23a5725885: + .asciz "generic:" + + .section __DATA,__objc_selrefs,literal_pointers + .globl L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885 + .p2align 2 +L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885: + .long L_OBJC_METH_VAR_NAME_17dedb23a5725885 + .subsections_via_symbols diff --git a/tests/assembly/test_static_sel/expected/apple-x86_64.s b/tests/assembly/test_static_sel/expected/apple-x86_64.s index ee39ee500..9623cd8e5 100644 --- a/tests/assembly/test_static_sel/expected/apple-x86_64.s +++ b/tests/assembly/test_static_sel/expected/apple-x86_64.s @@ -36,6 +36,31 @@ _unused_sel: pop rbp ret + .globl _use_fns + .p2align 4, 0x90 +_use_fns: + push rbp + mov rbp, rsp + mov rax, rdi + mov rcx, qword ptr [rip + L_OBJC_SELECTOR_REFERENCES_43d7e4d3b832d234] + mov rdx, qword ptr [rip + L_OBJC_SELECTOR_REFERENCES_475a96ed80683d38] + mov rsi, qword ptr [rip + L_OBJC_SELECTOR_REFERENCES_7ece3464aee33aa8] + mov qword ptr [rdi], rcx + mov qword ptr [rdi + 8], rdx + mov qword ptr [rdi + 16], rsi + pop rbp + ret + + .globl _use_generic + .p2align 4, 0x90 +_use_generic: + push rbp + mov rbp, rsp + mov rax, qword ptr [rip + L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885] + mov rdx, qword ptr [rip + L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885] + pop rbp + ret + .section __DATA,__objc_imageinfo,regular,no_dead_strip .globl L_OBJC_IMAGE_INFO_43d7e4d3b832d234 .p2align 2 @@ -104,4 +129,21 @@ L_OBJC_METH_VAR_NAME_501d7eaffe8512eb: L_OBJC_SELECTOR_REFERENCES_501d7eaffe8512eb: .quad L_OBJC_METH_VAR_NAME_501d7eaffe8512eb + .section __DATA,__objc_imageinfo,regular,no_dead_strip + .globl L_OBJC_IMAGE_INFO_17dedb23a5725885 + .p2align 2 +L_OBJC_IMAGE_INFO_17dedb23a5725885: + .space 8 + + .section __TEXT,__objc_methname,cstring_literals + .globl L_OBJC_METH_VAR_NAME_17dedb23a5725885 +L_OBJC_METH_VAR_NAME_17dedb23a5725885: + .asciz "generic:" + + .section __DATA,__objc_selrefs,literal_pointers + .globl L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885 + .p2align 3 +L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885: + .quad L_OBJC_METH_VAR_NAME_17dedb23a5725885 + .subsections_via_symbols diff --git a/tests/assembly/test_static_sel/expected/x86_64-apple-darwin.ll b/tests/assembly/test_static_sel/expected/x86_64-apple-darwin.ll index 28c02010d..c5f951df5 100644 --- a/tests/assembly/test_static_sel/expected/x86_64-apple-darwin.ll +++ b/tests/assembly/test_static_sel/expected/x86_64-apple-darwin.ll @@ -15,7 +15,10 @@ target triple = "x86_64-apple-macosx10.7.0" @"\01L_OBJC_IMAGE_INFO_501d7eaffe8512eb" = constant <{ [8 x i8] }> zeroinitializer, section "__DATA,__objc_imageinfo,regular,no_dead_strip", align 4 @"\01L_OBJC_METH_VAR_NAME_501d7eaffe8512eb" = constant <{ [4 x i8] }> <{ [4 x i8] c"xyz\00" }>, section "__TEXT,__objc_methname,cstring_literals", align 1 @"\01L_OBJC_SELECTOR_REFERENCES_501d7eaffe8512eb" = global <{ i8* }> <{ i8* getelementptr inbounds (<{ [4 x i8] }>, <{ [4 x i8] }>* @"\01L_OBJC_METH_VAR_NAME_501d7eaffe8512eb", i32 0, i32 0, i32 0) }>, section "__DATA,__objc_selrefs,literal_pointers", align 8 -@llvm.compiler.used = appending global [4 x i8*] [i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @"\01L_OBJC_IMAGE_INFO_43d7e4d3b832d234", i32 0, i32 0, i32 0), i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @"\01L_OBJC_IMAGE_INFO_475a96ed80683d38", i32 0, i32 0, i32 0), i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @"\01L_OBJC_IMAGE_INFO_501d7eaffe8512eb", i32 0, i32 0, i32 0), i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @"\01L_OBJC_IMAGE_INFO_7ece3464aee33aa8", i32 0, i32 0, i32 0)], section "llvm.metadata" +@"\01L_OBJC_IMAGE_INFO_17dedb23a5725885" = constant <{ [8 x i8] }> zeroinitializer, section "__DATA,__objc_imageinfo,regular,no_dead_strip", align 4 +@"\01L_OBJC_METH_VAR_NAME_17dedb23a5725885" = constant <{ [9 x i8] }> <{ [9 x i8] c"generic:\00" }>, section "__TEXT,__objc_methname,cstring_literals", align 1 +@"\01L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885" = global <{ i8* }> <{ i8* getelementptr inbounds (<{ [9 x i8] }>, <{ [9 x i8] }>* @"\01L_OBJC_METH_VAR_NAME_17dedb23a5725885", i32 0, i32 0, i32 0) }>, section "__DATA,__objc_selrefs,literal_pointers", align 8 +@llvm.compiler.used = appending global [5 x i8*] [i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @"\01L_OBJC_IMAGE_INFO_17dedb23a5725885", i32 0, i32 0, i32 0), i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @"\01L_OBJC_IMAGE_INFO_43d7e4d3b832d234", i32 0, i32 0, i32 0), i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @"\01L_OBJC_IMAGE_INFO_475a96ed80683d38", i32 0, i32 0, i32 0), i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @"\01L_OBJC_IMAGE_INFO_501d7eaffe8512eb", i32 0, i32 0, i32 0), i8* getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @"\01L_OBJC_IMAGE_INFO_7ece3464aee33aa8", i32 0, i32 0, i32 0)], section "llvm.metadata" ; Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn define nonnull i8* @get_sel() unnamed_addr #0 { @@ -48,6 +51,36 @@ start: ret void } +; Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn +define void @use_fns({ i8*, i8*, i8* }* noalias nocapture noundef writeonly sret({ i8*, i8*, i8* }) dereferenceable(24) %0) unnamed_addr #0 { +start: + %1 = load volatile [4 x i8]*, [4 x i8]** bitcast (<{ i8* }>* @"\01L_OBJC_SELECTOR_REFERENCES_43d7e4d3b832d234" to [4 x i8]**), align 8, !nonnull !1 + %2 = getelementptr [4 x i8], [4 x i8]* %1, i64 0, i64 0 + %3 = load volatile [4 x i8]*, [4 x i8]** bitcast (<{ i8* }>* @"\01L_OBJC_SELECTOR_REFERENCES_475a96ed80683d38" to [4 x i8]**), align 8, !nonnull !1 + %4 = getelementptr [4 x i8], [4 x i8]* %3, i64 0, i64 0 + %5 = load volatile [4 x i8]*, [4 x i8]** bitcast (<{ i8* }>* @"\01L_OBJC_SELECTOR_REFERENCES_7ece3464aee33aa8" to [4 x i8]**), align 8, !nonnull !1 + %6 = getelementptr [4 x i8], [4 x i8]* %5, i64 0, i64 0 + %7 = getelementptr inbounds { i8*, i8*, i8* }, { i8*, i8*, i8* }* %0, i64 0, i32 0 + store i8* %2, i8** %7, align 8 + %8 = getelementptr inbounds { i8*, i8*, i8* }, { i8*, i8*, i8* }* %0, i64 0, i32 1 + store i8* %4, i8** %8, align 8 + %9 = getelementptr inbounds { i8*, i8*, i8* }, { i8*, i8*, i8* }* %0, i64 0, i32 2 + store i8* %6, i8** %9, align 8 + ret void +} + +; Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn +define { i8*, i8* } @use_generic() unnamed_addr #0 { +start: + %0 = load volatile [9 x i8]*, [9 x i8]** bitcast (<{ i8* }>* @"\01L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885" to [9 x i8]**), align 8, !nonnull !1 + %1 = getelementptr [9 x i8], [9 x i8]* %0, i64 0, i64 0 + %2 = load volatile [9 x i8]*, [9 x i8]** bitcast (<{ i8* }>* @"\01L_OBJC_SELECTOR_REFERENCES_17dedb23a5725885" to [9 x i8]**), align 8, !nonnull !1 + %3 = getelementptr [9 x i8], [9 x i8]* %2, i64 0, i64 0 + %4 = insertvalue { i8*, i8* } undef, i8* %1, 0 + %5 = insertvalue { i8*, i8* } %4, i8* %3, 1 + ret { i8*, i8* } %5 +} + attributes #0 = { mustprogress nofree norecurse nounwind uwtable willreturn "frame-pointer"="all" "probe-stack"="__rust_probestack" "target-cpu"="core2" } !llvm.module.flags = !{!0} diff --git a/tests/assembly/test_static_sel/lib.rs b/tests/assembly/test_static_sel/lib.rs index ece344197..1fa115f61 100644 --- a/tests/assembly/test_static_sel/lib.rs +++ b/tests/assembly/test_static_sel/lib.rs @@ -22,3 +22,20 @@ pub fn get_different_sel() -> Sel { pub fn unused_sel() { let _x = sel!(xyz); } + +#[no_mangle] +pub fn use_fns() -> (Sel, Sel, Sel) { + let s1 = get_sel(); + let s2 = get_same_sel(); + let s3 = get_different_sel(); + (s1, s2, s3) +} + +fn generic() -> Sel { + sel!(generic:) +} + +#[no_mangle] +pub fn use_generic() -> (Sel, Sel) { + (generic::(), generic::()) +}