As part of fixing Bug 465782, adjust the op00 and op_exception tests.
The op00 test case doesn't compile with clang because the .hword assembler
directive is not known to llvm-as. When replacing it with .short, the
test case fails because clang/llvm-as generates different line number
information from gcc/gas. Using gcc, Valgrind's error message locates the
unrecognised instruction
at 0x........: main (op00.c:3)
whereas with clang, it shows:
at 0x........: main (op00.c:4)
The asm statement in op00.c is indeed located at line 4, so when compiling
with gcc, the indicated line number is just wrong. This is because gas
only updates line number information for instruction directives, not for
directives like `.short' as used here. See also the discussion in
https://sourceware.org/bugzilla/show_bug.cgi?id=30206
The same applies to the op_exception test case, where `.long' is used to
emit illegal instructions.
Make these test cases independent from this difference, by replacing the
`.short' and `.long' directives by equivalent `.insn' directives. Also
drop the unnecessary duplication of op00.stderr.exp.
ecag.stdout.exp-z10ec ecag.stdout.exp-z196 ecag.stdout.exp-zec12 \
ecag.stdout.exp-z13 ecag.stdout.exp-z14 ecag.stdout.exp-z15 \
ecag.stdout.exp-z16 \
- op00.stderr.exp1 op00.stderr.exp2 op00.vgtest \
+ op00.stderr.exp op00.vgtest \
fixbr.vgtest fixbr.stderr.exp fixbr.stdout.exp \
fpext.vgtest fpext.stderr.exp fpext.stdout.exp \
fpext_fail.vgtest fpext_fail.stderr.exp fpext_fail.stdout.exp \
/* Test for invalid instruction 00. */
int main(int argc, char *argv[])
{
- asm volatile (".hword 0\n");
+ asm volatile (".insn e,0x0000");
return 0;
}
-
vex s390->IR: unknown insn: 0000
valgrind: Unrecognised instruction at address 0x.........
- at 0x........: main (op00.c:3)
+ at 0x........: main (op00.c:4)
Your program just tried to execute an instruction that Valgrind
did not recognise. There are two possible reasons for this.
1. Your program has a bug and erroneously jumped to a non-code
Process terminating with default action of signal 4 (SIGILL)
Illegal opcode at address 0x........
- at 0x........: main (op00.c:3)
+ at 0x........: main (op00.c:4)
+++ /dev/null
-
-vex s390->IR: unknown insn: 0000
-valgrind: Unrecognised instruction at address 0x.........
- at 0x........: main (op00.c:3)
-Your program just tried to execute an instruction that Valgrind
-did not recognise. There are two possible reasons for this.
-1. Your program has a bug and erroneously jumped to a non-code
- location. If you are running Memcheck and you just saw a
- warning about a bad jump, it's probably your program's fault.
-2. The instruction is legitimate but Valgrind doesn't handle it,
- i.e. it's Valgrind's fault. If you think this is the case or
- you are not sure, please let us know and we'll try to fix it.
-Either way, Valgrind will now raise a SIGILL signal which will
-probably kill your program.
-
-Process terminating with default action of signal 4 (SIGILL)
- Illegal opcode at address 0x........
- at 0x........: main (op00.c:3)
-
got_ill = 0;
/* most architectures loop here, but on s390 this would increase the
PSW by 2 and then by 2 */
- asm volatile(".long 0\n");
+ asm volatile(".insn e,0x0000\n\t.insn e,0x0000");
if (got_ill)
printf("0x00000000 does not loop\n");
got_ill = 0;
/* most architectures loop here, but on s390 this would increase the
PSW by 6 and then by 2*/
- asm volatile(".long 0xffffffff\n.long 0xffff0000\n");
+ asm volatile(".insn ril,0xffffffffffff,0xf,.-2\n\t.insn e,0x0000");
if (got_ill)
printf("0xffffffff does not loop\n");
return 0;
vex s390->IR: unknown insn: 0000
valgrind: Unrecognised instruction at address 0x.........
- at 0x........: main (op_exception.c:23)
+ at 0x........: main (op_exception.c:26)
Your program just tried to execute an instruction that Valgrind
did not recognise. There are two possible reasons for this.
1. Your program has a bug and erroneously jumped to a non-code
probably kill your program.
vex s390->IR: unknown insn: 0000
valgrind: Unrecognised instruction at address 0x.........
- at 0x........: main (op_exception.c:23)
+ at 0x........: main (op_exception.c:26)
Your program just tried to execute an instruction that Valgrind
did not recognise. There are two possible reasons for this.
1. Your program has a bug and erroneously jumped to a non-code
probably kill your program.
vex s390->IR: unknown insn: FFFF FFFF FFFF
valgrind: Unrecognised instruction at address 0x.........
- at 0x........: main (op_exception.c:30)
+ at 0x........: main (op_exception.c:33)
Your program just tried to execute an instruction that Valgrind
did not recognise. There are two possible reasons for this.
1. Your program has a bug and erroneously jumped to a non-code
probably kill your program.
vex s390->IR: unknown insn: 0000
valgrind: Unrecognised instruction at address 0x.........
- at 0x........: main (op_exception.c:30)
+ at 0x........: main (op_exception.c:33)
Your program just tried to execute an instruction that Valgrind
did not recognise. There are two possible reasons for this.
1. Your program has a bug and erroneously jumped to a non-code