# sh testcase for gettr $trb, $rd -*- Asm -*-
# mach: all
# as: -isa=shmedia
# ld: -m shelf64

	.include "media/testutils.inc"

	start
init:
	# tr0 is reserved.
	# don't use it anywhere else in this test.
	pta wrong, tr0

gettr1:
	# Put garbage in r1, r2.
	movi 20, r1
	movi 30, r2

	pta foo, tr1
	pta foo, tr2

check1:
	gettr tr1, r1
	gettr tr2, r2
	bne r1, r2, tr0

gettr2:
	# Put garbage in r3, r4.
	movi 21, r3
	movi 42, r4
	
check2:
	pta foo, tr1
	gettr tr1, r2
	ptabs r2, tr2
	gettr tr2, r3
	ptabs r3, tr3
	gettr tr3, r4
	bne r2, r4, tr0
	
okay:	
	pass

wrong:
	fail

foo:
	nop
