brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 3e6a6b0 Raw
66 lines · plain
1// RUN: %clang -c -o %t %s2// RUN: %llvm_jitlink %t3//4// Test that basic ELF TLS work by adding together TLSs with values5// 0, 1, and -1, and returning the result (0 for success). This setup6// tests both zero-initialized (.tbss) and non-zero-initialized7// (.tdata) sections.8 9	.text10	.file	"tlstest.cpp"11	.globl	main12	.p2align	213	.type	main,@function14main:15	stp	x29, x30, [sp, #-16]!16	mov	x29, sp17	adrp	x0, :tlsdesc:x18	ldr	x1, [x0, :tlsdesc_lo12:x]19	add	x0, x0, :tlsdesc_lo12:x20	.tlsdesccall x21	blr	x122	mrs	x8, TPIDR_EL023	ldr	w9, [x8, x0]24	adrp	x0, :tlsdesc:y25	ldr	x1, [x0, :tlsdesc_lo12:y]26	add	x0, x0, :tlsdesc_lo12:y27	.tlsdesccall y28	blr	x129	ldr	w10, [x8, x0]30	add	w9, w10, w931	adrp	x0, :tlsdesc:z32	ldr	x1, [x0, :tlsdesc_lo12:z]33	add	x0, x0, :tlsdesc_lo12:z34	.tlsdesccall z35	blr	x136	ldr	w8, [x8, x0]37	add	w0, w9, w838	ldp	x29, x30, [sp], #1639	ret40.Lfunc_end0:41	.size	main, .Lfunc_end0-main42 43	.type	x,@object44	.section	.tdata,"awT",@progbits45	.globl	x46	.p2align	247x:48	.word	429496729549	.size	x, 450 51	.type	y,@object52	.section	.tbss,"awT",@nobits53	.globl	y54	.p2align	255y:56	.word	057	.size	y, 458 59	.type	z,@object60	.section	.tdata,"awT",@progbits61	.globl	z62	.p2align	263z:64	.word	165	.size	z, 466