81 lines · plain
1// Test that basic MachO TLVs work by adding together TLVs with values2// 0, 1, and -1, and returning the result (0 for success). This setup3// tests both zero-initialized (__thread_bss) and non-zero-initialized4// (__thread_data) secitons.5//6// RUN: %clang -c -o %t %s7// RUN: %llvm_jitlink %t8 9 .section __TEXT,__text,regular,pure_instructions10 .build_version macos, 12, 0 sdk_version 12, 011 .globl _main ; -- Begin function main12 .p2align 213_main: ; @main14 .cfi_startproc15; %bb.0:16 sub sp, sp, #32 ; =3217 stp x29, x30, [sp, #16] ; 16-byte Folded Spill18 add x29, sp, #16 ; =1619 .cfi_def_cfa w29, 1620 .cfi_offset w30, -821 .cfi_offset w29, -1622 adrp x0, _x@TLVPPAGE23 ldr x0, [x0, _x@TLVPPAGEOFF]24 ldr x8, [x0]25 blr x826 mov x8, x027 adrp x0, _y@TLVPPAGE28 ldr x0, [x0, _y@TLVPPAGEOFF]29 ldr x9, [x0]30 blr x931 mov x9, x032 adrp x0, _z@TLVPPAGE33 ldr x0, [x0, _z@TLVPPAGEOFF]34 ldr x10, [x0]35 blr x1036 stur wzr, [x29, #-4]37 ldr w8, [x8]38 ldr w9, [x9]39 add w8, w8, w940 ldr w9, [x0]41 add w0, w8, w942 ldp x29, x30, [sp, #16] ; 16-byte Folded Reload43 add sp, sp, #32 ; =3244 ret45 .cfi_endproc46 ; -- End function47.tbss _x$tlv$init, 4, 2 ; @x48 49 .section __DATA,__thread_vars,thread_local_variables50 .globl _x51_x:52 .quad __tlv_bootstrap53 .quad 054 .quad _x$tlv$init55 56 .section __DATA,__thread_data,thread_local_regular57 .p2align 2 ; @y58_y$tlv$init:59 .long 4294967295 ; 0xffffffff60 61 .section __DATA,__thread_vars,thread_local_variables62 .globl _y63_y:64 .quad __tlv_bootstrap65 .quad 066 .quad _y$tlv$init67 68 .section __DATA,__thread_data,thread_local_regular69 .p2align 2 ; @z70_z$tlv$init:71 .long 1 ; 0x172 73 .section __DATA,__thread_vars,thread_local_variables74 .globl _z75_z:76 .quad __tlv_bootstrap77 .quad 078 .quad _z$tlv$init79 80.subsections_via_symbols81