1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/MC/AsmParser/directive_incbin.s
Fangrui Song 1846161749 [MC] Add parseEOL() overload and migrate some parseToken(AsmToken::EndOfStatement) to parseEOL()
For many directives, the following diagnostics

* `error: unexpected token`
* `error: unexpected token in '.abort' directive"`

are replaced with `error: expected newline`.

`unexpected token` may make the user think a different token is needed.
`expected newline` is clearer about the expected token.

For `in '...' directive`, the directive name is not useful because the next line
replicates the error line which includes the directive.
2021-03-06 17:45:23 -08:00

46 lines
899 B
ArmAsm

# RUN: not llvm-mc -triple i386-unknown-unknown %s -I %p | FileCheck %s
# RUN: not llvm-mc -triple i386-unknown-unknown %s -I %p 2>&1 > /dev/null| FileCheck %s --check-prefix=CHECK-ERROR
.data
.incbin "incbin\137abcd" # "\137" is underscore "_"
# CHECK: .ascii "abcd\n"
.data
.incbin "incbin\137abcd", 1
# CHECK: .ascii "bcd\n"
.data
.incbin "incbin\137abcd", 1, 2
# CHECK: .ascii "bc"
.data
.incbin "incbin\137abcd",, 2
# CHECK: .ascii "ab"
.data
.incbin incbin\137abcd
# CHECK-ERROR: error: expected string in '.incbin' directive
.data
.incbin "incbin\137abcd" 1
# CHECK-ERROR: :[[#@LINE-1]]:26: error: expected newline
.data
.incbin "incbin\137abcd", 1 2
# CHECK-ERROR: :[[#@LINE-1]]:29: error: expected newline
.data
.incbin "incbin\137abcd", -1
# CHECK-ERROR: error: skip is negative
.data
.incbin "incbin\137abcd",, -1
# CHECK-ERROR: warning: negative count has no effect