1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/MC/X86/code16-32-64.s
Reid Kleckner a021a99618 [MC] Pass through .code16/32/64 and .syntax unified for COFF
These flags should simply be passed through to the target, which will do
the right thing. Add an MC/X86 test that uses these directives with the
three primary object file formats and shows that they disassemble the
same everywhere.

There is a missing test for .code32 on Windows ARM, since I'm not sure
exactly how to construct one.

Fixes PR43203

llvm-svn: 370805
2019-09-03 18:16:52 +00:00

22 lines
677 B
ArmAsm

# RUN: llvm-mc %s -triple x86_64-linux-gnu -filetype=obj -o - | llvm-objdump -d - | FileCheck %s
# RUN: llvm-mc %s -triple x86_64-windows-msvc -filetype=obj -o - | llvm-objdump -d - | FileCheck %s
# RUN: llvm-mc %s -triple x86_64-apple-macos -filetype=obj -o - | llvm-objdump -d - | FileCheck %s
.text
.global foo
foo:
.code64
movl (%eax), %eax
.code32
movl (%eax), %eax
.code16
movl (%eax), %eax
.code64
retq
# CHECK: foo:
# CHECK-NEXT: 67 8b 00 movl (%eax), %eax
# CHECK-NEXT: 8b 00 movl (%rax), %eax
# CHECK-NEXT: 67 66 8b 00 movw (%eax), %ax
# CHECK-NEXT: c3 retq