mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
tests/tcg/s390x: Test LARL with a large offset
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Acked-by: David Hildenbrand <david@redhat.com> Message-Id: <20230704081506.276055-10-iii@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
f5c2ae7134
commit
ad85ac6a8f
2 changed files with 22 additions and 0 deletions
|
@ -37,6 +37,7 @@ TESTS+=ex-relative-long
|
||||||
TESTS+=ex-branch
|
TESTS+=ex-branch
|
||||||
TESTS+=mxdb
|
TESTS+=mxdb
|
||||||
TESTS+=epsw
|
TESTS+=epsw
|
||||||
|
TESTS+=larl
|
||||||
|
|
||||||
cdsg: CFLAGS+=-pthread
|
cdsg: CFLAGS+=-pthread
|
||||||
cdsg: LDFLAGS+=-pthread
|
cdsg: LDFLAGS+=-pthread
|
||||||
|
|
21
tests/tcg/s390x/larl.c
Normal file
21
tests/tcg/s390x/larl.c
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Test the LARL instruction.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
*/
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
long algfi = (long)main;
|
||||||
|
long larl;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The compiler may emit larl for the C addition, so compute the expected
|
||||||
|
* value using algfi.
|
||||||
|
*/
|
||||||
|
asm("algfi %[r],0xd0000000" : [r] "+r" (algfi) : : "cc");
|
||||||
|
asm("larl %[r],main+0xd0000000" : [r] "=r" (larl));
|
||||||
|
|
||||||
|
return algfi == larl ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue