Skip to content

Commit 8a71284

Browse files
committed
[MC][X86] Cleanup check prefixes identified in #92248
Avoid using numbers as check prefix - replace with actual triple config names where possible
1 parent 3b5a121 commit 8a71284

File tree

8 files changed

+310
-311
lines changed

8 files changed

+310
-311
lines changed

llvm/test/MC/X86/abs8.s

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// RUN: llvm-mc -filetype=obj %s -o - -triple i686-pc-linux | llvm-objdump --no-print-imm-hex -d -r - | FileCheck --check-prefix=32 %s
2-
// RUN: llvm-mc -filetype=obj %s -o - -triple x86_64-pc-linux | llvm-objdump --no-print-imm-hex -d -r - | FileCheck --check-prefix=64 %s
1+
// RUN: llvm-mc -filetype=obj %s -o - -triple i686-pc-linux | llvm-objdump --no-print-imm-hex -d -r - | FileCheck --check-prefix=X86 %s
2+
// RUN: llvm-mc -filetype=obj %s -o - -triple x86_64-pc-linux | llvm-objdump --no-print-imm-hex -d -r - | FileCheck --check-prefix=X64 %s
33

4-
// 32: 0: 83 ff 00 cmpl $0, %edi
5-
// 32: 00000002: R_386_8 foo
6-
// 64: 0: 83 ff 00 cmpl $0, %edi
7-
// 64: 0000000000000002: R_X86_64_8 foo
4+
// X86: 0: 83 ff 00 cmpl $0, %edi
5+
// X86: 00000002: R_386_8 foo
6+
// X64: 0: 83 ff 00 cmpl $0, %edi
7+
// X64: 0000000000000002: R_X86_64_8 foo
88
cmp $foo@ABS8, %edi
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=call+indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=64BIT,CHECK
2-
3-
# RUN: llvm-mc -filetype=obj -triple i386 --x86-align-branch-boundary=32 --x86-align-branch=call+indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=32BIT,CHECK
1+
# RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=call+indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=CHECK,X64
2+
# RUN: llvm-mc -filetype=obj -triple i386 --x86-align-branch-boundary=32 --x86-align-branch=call+indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=CHECK,X86
43

54
# Exercise cases where the instruction to be aligned has a variant symbol
65
# operand, and we can't add before it since linker may rewrite it.
@@ -14,8 +13,8 @@ foo:
1413
int3
1514
.endr
1615
# CHECK: 1d: int3
17-
# 64BIT: 1e: callq
18-
# 32BIT: 1e: calll
16+
# X64: 1e: callq
17+
# X86: 1e: calll
1918
# CHECK: 23: int3
2019
call ___tls_get_addr@PLT
2120
int3
@@ -25,10 +24,10 @@ foo:
2524
int3
2625
.endr
2726
# CHECK: 5d: int3
28-
# 64BIT: 5e: callq *(%ecx)
29-
# 64BIT: 65: int3
30-
# 32BIT: 5e: calll *(%ecx)
31-
# 32BIT: 64: int3
27+
# X64: 5e: callq *(%ecx)
28+
# X64: 65: int3
29+
# X86: 5e: calll *(%ecx)
30+
# X86: 64: int3
3231
call *___tls_get_addr@GOT(%ecx)
3332
int3
3433

@@ -37,10 +36,10 @@ foo:
3736
int3
3837
.endr
3938
# CHECK: 9d: int3
40-
# 64BIT: 9e: callq *(%eax)
41-
# 64BIT: a1: int3
42-
# 32BIT: 9e: calll *(%eax)
43-
# 32BIT: a0: int3
39+
# X64: 9e: callq *(%eax)
40+
# X64: a1: int3
41+
# X86: 9e: calll *(%eax)
42+
# X86: a0: int3
4443
call *foo@tlscall(%eax)
4544
int3
4645

@@ -49,9 +48,9 @@ foo:
4948
int3
5049
.endr
5150
# CHECK: dd: int3
52-
# 64BIT: de: jmpq *(%eax)
53-
# 64BIT: e1: int3
54-
# 32BIT: de: jmpl *(%eax)
55-
# 32BIT: e0: int3
51+
# X64: de: jmpq *(%eax)
52+
# X64: e1: int3
53+
# X86: de: jmpl *(%eax)
54+
# X86: e0: int3
5655
jmp *foo@tlscall(%eax)
5756
int3

llvm/test/MC/X86/data-prefix-fail.s

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
// RUN: not llvm-mc -triple x86_64-unknown-unknown --show-encoding %s 2> %t.err | FileCheck --check-prefix=64 %s
1+
// RUN: not llvm-mc -triple x86_64-unknown-unknown --show-encoding %s 2> %t.err | FileCheck --check-prefix=X86-64 %s
22
// RUN: FileCheck --check-prefix=ERR64 < %t.err %s
3-
// RUN: not llvm-mc -triple i386-unknown-unknown --show-encoding %s 2> %t.err | FileCheck --check-prefix=32 %s
3+
// RUN: not llvm-mc -triple i386-unknown-unknown --show-encoding %s 2> %t.err | FileCheck --check-prefix=X86-32 %s
44
// RUN: FileCheck --check-prefix=ERR32 < %t.err %s
5-
// RUN: not llvm-mc -triple i386-unknown-unknown-code16 --show-encoding %s 2> %t.err | FileCheck --check-prefix=16 %s
5+
// RUN: not llvm-mc -triple i386-unknown-unknown-code16 --show-encoding %s 2> %t.err | FileCheck --check-prefix=X86-16 %s
66
// RUN: FileCheck --check-prefix=ERR16 < %t.err %s
77

88
// ERR64: error: 'data32' is not supported in 64-bit mode
99
// ERR32: error: redundant data32 prefix
10-
// 16: lgdtl 0
11-
// 16-SAME: encoding: [0x66,0x0f,0x01,0x16,0x00,0x00]
10+
// X86-16: lgdtl 0
11+
// X86-16-SAME: encoding: [0x66,0x0f,0x01,0x16,0x00,0x00]
1212
data32 lgdt 0
1313

14-
// 64: data16
15-
// 64: encoding: [0x66]
16-
// 64: lgdtq 0
17-
// 64: encoding: [0x0f,0x01,0x14,0x25,0x00,0x00,0x00,0x00]
18-
// 32: data16
19-
// 32: encoding: [0x66]
20-
// 32: lgdtl 0
21-
// 32: encoding: [0x0f,0x01,0x15,0x00,0x00,0x00,0x00]
14+
// X86-64: data16
15+
// X86-64: encoding: [0x66]
16+
// X86-64: lgdtq 0
17+
// X86-64: encoding: [0x0f,0x01,0x14,0x25,0x00,0x00,0x00,0x00]
18+
// X86-32: data16
19+
// X86-32: encoding: [0x66]
20+
// X86-32: lgdtl 0
21+
// X86-32: encoding: [0x0f,0x01,0x15,0x00,0x00,0x00,0x00]
2222
// ERR16: error: redundant data16 prefix
2323
data16 lgdt 0
2424

25-
// 64: data16 # encoding: [0x66]
26-
// 64-NEXT: callq 0 # encoding: [0xe8,A,A,A,A]
27-
// 32: data16 # encoding: [0x66]
28-
// 32-NEXT: calll 0 # encoding: [0xe8,A,A,A,A]
25+
// X86-64: data16 # encoding: [0x66]
26+
// X86-64-NEXT: callq 0 # encoding: [0xe8,A,A,A,A]
27+
// X86-32: data16 # encoding: [0x66]
28+
// X86-32-NEXT: calll 0 # encoding: [0xe8,A,A,A,A]
2929
// ERR16: {{.*}}.s:[[#@LINE+1]]:1: error: redundant data16 prefix
3030
data16 call 0

llvm/test/MC/X86/displacement-overflow.s

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# RUN: not llvm-mc -triple=x86_64 %s 2>&1 | FileCheck %s --check-prefixes=CHECK,64 --implicit-check-not=error: --implicit-check-not=warning:
2-
# RUN: llvm-mc -triple=i686 --defsym A16=1 %s 2>&1 | FileCheck %s --check-prefixes=CHECK,32 --implicit-check-not=error: --implicit-check-not=warning:
1+
# RUN: not llvm-mc -triple=x86_64 %s 2>&1 | FileCheck %s --check-prefixes=CHECK,X64 --implicit-check-not=error: --implicit-check-not=warning:
2+
# RUN: llvm-mc -triple=i686 --defsym A16=1 %s 2>&1 | FileCheck %s --check-prefixes=CHECK,X86 --implicit-check-not=error: --implicit-check-not=warning:
33

44
.ifndef A16
55
movq 0x80000000-1(%rip), %rax
66
leaq -0x80000000(%rip), %rax
77

8-
# 64: [[#@LINE+1]]:17: error: displacement 2147483648 is not within [-2147483648, 2147483647]
8+
# X64: [[#@LINE+1]]:17: error: displacement 2147483648 is not within [-2147483648, 2147483647]
99
movq 0x80000000(%rip), %rax
1010

11-
# 64: [[#@LINE+1]]:18: error: displacement -2147483649 is not within [-2147483648, 2147483647]
11+
# X64: [[#@LINE+1]]:18: error: displacement -2147483649 is not within [-2147483648, 2147483647]
1212
leaq -0x80000001(%rip), %rax
1313
.endif
1414

@@ -31,8 +31,8 @@ leal -0xffffffff-2(%eax), %eax
3131
movw $0, 0xffff(%bp)
3232
movw $0, -0xffff(%si)
3333

34-
# 32: [[#@LINE+1]]:19: warning: displacement 65536 shortened to 16-bit signed 0
34+
# X86: [[#@LINE+1]]:19: warning: displacement 65536 shortened to 16-bit signed 0
3535
movw $0, 0xffff+1(%bp)
36-
# 32: [[#@LINE+1]]:20: warning: displacement -65536 shortened to 16-bit signed 0
36+
# X86: [[#@LINE+1]]:20: warning: displacement -65536 shortened to 16-bit signed 0
3737
movw $0, -0xffff-1(%si)
3838
.endif
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t.64
2-
// RUN: llvm-objdump --dwarf=frames %t.64 | FileCheck %s --check-prefixes=64,CHECK
2+
// RUN: llvm-objdump --dwarf=frames %t.64 | FileCheck %s --check-prefixes=X64,CHECK
33
// RUN: llvm-mc -filetype=obj -triple i386-pc-linux-gnu %s -o %t.32
4-
// RUN: llvm-objdump --dwarf=frames %t.32 | FileCheck %s --check-prefixes=32,CHECK
4+
// RUN: llvm-objdump --dwarf=frames %t.32 | FileCheck %s --check-prefixes=X86,CHECK
55

66
.cfi_startproc
77
.cfi_offset %cs, -40
@@ -12,26 +12,26 @@
1212
.cfi_offset %gs, 0
1313
.cfi_endproc
1414

15-
// 64: reg51
16-
// 32: reg41
15+
// X64: reg51
16+
// X86: reg41
1717
// CHECK-SAME: -40
1818

19-
// 64: reg53
20-
// 32: reg43
19+
// X64: reg53
20+
// X86: reg43
2121
// CHECK-SAME: -32
2222

23-
// 64: reg52
24-
// 32: reg42
23+
// X64: reg52
24+
// X86: reg42
2525
// CHECK-SAME: -24
2626

27-
// 64: reg50
28-
// 32: reg40
27+
// X64: reg50
28+
// X86: reg40
2929
// CHECK-SAME: -16
3030

31-
// 64: reg54
32-
// 32: reg44
31+
// X64: reg54
32+
// X86: reg44
3333
// CHECK-SAME: -8
3434

35-
// 64: reg55
36-
// 32: reg45
35+
// X64: reg55
36+
// X86: reg45
3737
// CHECK-SAME: 0

0 commit comments

Comments
 (0)