llvm-project/llvm/test/tools/llvm-ml/anonymous_labels_errors.asm
Eric Astor 7d1a295484 [ms] [llvm-ml] Add support for anonymous labels (@@, @B, @F)
ml.exe and ml64.exe support the use of anonymous labels, with @B and @F referring to the previous and next anonymous label respectively.

We add similar support to llvm-ml, with the exception that we are unable to emit an error message for an @F expression not followed by a @@ label.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D128944
2022-07-07 10:29:10 -04:00

17 lines
364 B
NASM

; RUN: not llvm-ml -filetype=s %s /Fo - 2>&1 | FileCheck %s --implicit-check-not=error:
.code
; CHECK: :[[# @LINE + 2]]:5: error: Expected @@ label before @B reference
; CHECK: :[[# @LINE + 1]]:7: error: Unexpected identifier!
jmp @B
@@:
jmp @B
jmp @F
@@:
xor eax, eax
; NOTE: a trailing @F will not fail; fixing this seems to require two passes.
jmp @F