blob: ffb3acaf8bcf66c4e6a0030d6ebfd9a023ec73c9 [file]
Test of documentHighlight for assembly files.
-- example/highlight_text.s --
TEXT ·foo(SB), $0-0 //@hiloc(defFoo, "·foo", write)
CALL ·foo(SB) //@hiloc(refFoo, "·foo", read)
//@highlightall(defFoo, refFoo)
-- example/highlight_global.s --
GLOBL ·bar(SB), $8 //@hiloc(defBar, "·bar", write)
TEXT ·useBar(SB), $0-0
MOVQ ·bar(SB), AX //@hiloc(refBar, "·bar", read)
//@highlightall(defBar, refBar)
-- example/highlight_label.s --
TEXT ·loopDemo(SB), $0-0
loop: //@hiloc(defLoop, "loop", write)
JMP loop //@hiloc(refLoop, "loop", read)
//@highlightall(defLoop, refLoop)
-- example/highlight_register_amd64.s --
TEXT ·useReg(SB), $0-0
MOVQ AX, BX //@hiloc(ax1, "AX", read)
ADDQ CX, AX //@hiloc(ax2, "AX", write)
//@highlightall(ax1, ax2)
-- example/highlight_register_scope_amd64.s --
TEXT ·f1(SB), $0-0
MOVQ AX, BX //@hiloc(axF1, "AX", read)
TEXT ·f2(SB), $0-0
MOVQ AX, CX
//@highlightall(axF1)
-- example/highlight_compare_amd64.s --
TEXT ·cmpDemo(SB), $0-0
CMPQ AX, BX //@hiloc(cmpAX, "AX", read)
//@highlightall(cmpAX)
-- example/highlight_label_scope.s --
TEXT ·f1(SB), $0-0
loop: //@hiloc(f1def, "loop", write)
JMP loop //@hiloc(f1ref, "loop", read)
//@highlightall(f1def, f1ref)
TEXT ·f2(SB), $0-0
loop: //@hiloc(f2def, "loop", write)
JMP loop //@hiloc(f2ref, "loop", read)
//@highlightall(f2def, f2ref)
-- example/highlight_mem_operand_amd64.s --
TEXT ·storeLoad(SB), $0-0
MOVQ AX, (BX) //@hiloc(bxStore, "BX", read)
MOVQ (AX), BX //@hiloc(bxLoad, "BX", write)
//@highlightall(bxStore, bxLoad)
-- example/highlight_stack_amd64.s --
TEXT ·stack(SB), $0-0
PUSHQ AX //@hiloc(axPush, "AX", read)
POPQ AX //@hiloc(axPop, "AX", write)
//@highlightall(axPush, axPop)
-- example/highlight_register_386.s --
TEXT ·reg386(SB), $0-0
POPL AX //@hiloc(axPop386, "AX", write)
CMPL CX, AX //@hiloc(axCmp386, "AX", read)
//@highlightall(axPop386, axCmp386)
-- example/highlight_immediate_amd64.s --
TEXT ·imm(SB), $0-0
MOVQ $123, AX //@hiloc(imm, "123", read)
//@highlight(imm)
-- example/highlight_comment_amd64.s --
TEXT ·c(SB), $0-0
MOVQ AX, BX
// ADDQ AX, CX //@hiloc(commentAX, "AX", read)
//@highlight(commentAX)
-- example/highlight_mnemonic_amd64.s --
TEXT ·mn(SB), $0-0
MOVQ AX, BX //@hiloc(mnemonic, "MOVQ", read)
//@highlight(mnemonic)
-- example/highlight_bt_amd64.s --
TEXT ·btDemo(SB), $0-0
BTQ $3, AX //@hiloc(btAX, "AX", read)
//@highlightall(btAX)
-- example/highlight_setcc_amd64.s --
TEXT ·setcc(SB), $0-0
SETEQ AL //@hiloc(alSet, "AL", write)
//@highlightall(alSet)
-- example/highlight_bswap_amd64.s --
TEXT ·bswap(SB), $0-0
BSWAPL AX //@hiloc(axBswap, "AX", write)
//@highlightall(axBswap)
-- example/highlight_cmpxchg_amd64.s --
TEXT ·xchg(SB), $0-0
CMPXCHGQ AX, BX //@hiloc(bxXchg, "BX", write)
//@highlightall(bxXchg)
-- example/highlight_bare_text_amd64.s --
TEXT ·f(SB), $0-0
MOVQ AX, BX //@hiloc(axBare1, "AX", read)
TEXT
MOVQ AX, CX //@hiloc(axBare2, "AX", read)
//@highlightall(axBare1, axBare2)
-- example/highlight_register_noarch.s --
TEXT ·noArch(SB), $0-0
MOVQ AX, BX //@hiloc(axNoArch, "AX", read)
//@highlight(axNoArch)
-- example/highlight_arm64.s --
TEXT ·armDemo(SB), $0-0
MOVD R1, R0 //@hiloc(r0mov, "R0", write)
CMP R0, R1 //@hiloc(r0cmp, "R0", read)
TST $1, R0 //@hiloc(r0tst, "R0", read)
//@highlightall(r0mov, r0cmp, r0tst)
-- example/highlight_regpair_arm64.s --
TEXT ·pair(SB), $0-0
LDP (0*8)(R0), (R4, R5) //@hiloc(r4load, "R4", write)
STP (R4, R5), (0*8)(R0) //@hiloc(r4store, "R4", read)
//@highlightall(r4load, r4store)
-- example/highlight_macro_arm64.s --
#define QR(a, b, c, d) VADD a, b, c
TEXT ·macro(SB), $0-0
QR(V0, V4, V8, V12) //@hiloc(v12, "V12", read)
//@highlightall(v12)
-- example/highlight_macro_amd64.s --
#define QR(a, b, c, d) PADDL a, b
TEXT ·macro(SB), $0-0
QR(X0, X4, X8, X12) //@hiloc(x12, "X12", read)
//@highlightall(x12)
-- example/highlight_xmm_amd64.s --
TEXT ·xmm(SB), $0-0
MOVOU X0, X1 //@hiloc(x1mov, "X1", write)
PXOR X1, X0 //@hiloc(x1xor, "X1", read)
//@highlightall(x1mov, x1xor)