Skip to content
Snippets Groups Projects
Commit ebc14107 authored by Ilya Leoshkevich's avatar Ilya Leoshkevich Committed by Thomas Huth
Browse files

tests/tcg/s390x: Test LAALG with negative cc_src


Add a small test to prevent regressions.

Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Message-ID: <20231106093605.1349201-5-iii@linux.ibm.com>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
parent bea40248
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,7 @@ TESTS+=mdeb
TESTS+=cgebra
TESTS+=clgebr
TESTS+=clc
TESTS+=laalg
cdsg: CFLAGS+=-pthread
cdsg: LDFLAGS+=-pthread
......
/*
* Test the LAALG instruction.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <assert.h>
#include <stdlib.h>
int main(void)
{
unsigned long cc = 0, op1, op2 = 40, op3 = 2;
asm("slgfi %[cc],1\n" /* Set cc_src = -1. */
"laalg %[op1],%[op3],%[op2]\n"
"ipm %[cc]"
: [cc] "+r" (cc)
, [op1] "=r" (op1)
, [op2] "+T" (op2)
: [op3] "r" (op3)
: "cc");
assert(cc == 0xffffffff10ffffff);
assert(op1 == 40);
assert(op2 == 42);
return EXIT_SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment