1 #include <stdio.h> 2 #include "../../../none/tests/s390x/opcodes.h" 3 int main() 4 { 5 int field1, field2; 6 int result; 7 8 /* 9 * gcc does some tricks for checking the highest bit. It seems 10 * to load a full word/double word. 11 * By using mask=10 for brc (jhe) only the msb is influencing 12 * the code flow. This test was inspired by 308427 13 */ 14 asm volatile( "oi %1,128\n\t" 15 "la 1,%1\n\t" 16 LTG(0,0,1,000,00) 17 "jhe 1f\n\t" 18 "lghi %0,0\n\t" 19 "j 2f\n\t" 20 "1:lghi %0,0\n\t" 21 "2:\n\t" 22 :"=d" (result) 23 :"Q" (field1) 24 :"0","cc"); 25 26 if (result) 27 printf("Error\n"); 28 29 asm volatile( "oi %1,128\n\t" 30 "la 1,%1\n\t" 31 LT(0,0,1,000,00) 32 "jhe 1f\n\t" 33 "lghi %0,0\n\t" 34 "j 2f\n\t" 35 "1:lghi %0,0\n\t" 36 "2:\n\t" 37 :"=d" (result) 38 :"Q" (field2) 39 :"0","cc"); 40 41 if (result) 42 printf("Error\n"); 43 44 return 0; 45 } 46