github.com/razvanm/vanadium-go-1.3@v0.0.0-20160721203343-4a65068e5915/src/cmd/link/testdata/dead.s (about) 1 // Copyright 2014 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Test of dead code removal. 6 // Symbols with names beginning with dead_ should be discarded. 7 // Others should be kept. 8 9 TEXT start(SB),7,$0 // start symbol 10 MOVQ $data1<>(SB), AX 11 CALL text1(SB) 12 MOVQ $text2(SB), BX 13 RET 14 15 TEXT text1(SB),7,$0 16 FUNCDATA $1, funcdata+4(SB) 17 RET 18 19 TEXT text2(SB),7,$0 20 MOVQ $runtime·edata(SB),BX 21 RET 22 23 DATA data1<>+0(SB)/8, $data2(SB) 24 DATA data1<>+8(SB)/8, $data3(SB) 25 GLOBL data1<>(SB), $16 26 GLOBL data2(SB), $1 27 GLOBL data3(SB), $1 28 GLOBL funcdata(SB), $8 29 30 TEXT dead_start(SB),7,$0 31 MOVQ $dead_data1(SB), AX 32 CALL dead_text1(SB) 33 MOVQ $dead_text2(SB), BX 34 RET 35 36 TEXT dead_text1(SB),7,$0 37 FUNCDATA $1, dead_funcdata+4(SB) 38 RET 39 40 TEXT dead_text2(SB),7,$0 41 RET 42 43 DATA dead_data1+0(SB)/8, $dead_data2(SB) 44 DATA dead_data1+8(SB)/8, $dead_data3(SB) 45 GLOBL dead_data1(SB), $16 46 GLOBL dead_data2(SB), $1 47 GLOBL dead_data3(SB), $1 48 GLOBL dead_funcdata(SB), $8