llvm-project/llvm/test/MC/AsmParser
Nirav Dave 6c0665e221 [MC] Change AsmParser to leverage Assembler during evaluation
Teach AsmParser to check with Assembler for when evaluating constant
expressions.  This improves the handing of preprocessor expressions
that must be resolved at parse time. This idiom can be found as
assembling-time assertion checks in source-level assemblers. Note that
this relies on the MCStreamer to keep sufficient tabs on Section /
Fragment information which the MCAsmStreamer does not. As a result the
textual output may fail where the equivalent object generation would
pass. This can most easily be resolved by folding the MCAsmStreamer
and MCObjectStreamer together which is planned for in a separate
patch.

Currently, this feature is only enabled for assembly input, keeping IR
compilation consistent between assembly and object generation.

Reviewers: echristo, rnk, probinson, espindola, peter.smith

Reviewed By: peter.smith

Subscribers: eraman, peter.smith, arichardson, jyknight, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D45164

llvm-svn: 331218
2018-04-30 19:22:40 +00:00
..
AArch64 [AsmParser] Recommit: Hash is not a comment on some targets 2017-08-21 09:58:37 +00:00
Inputs [MC] - llvm-mc hangs on non-english characters. 2017-10-05 08:15:55 +00:00
align_invalid.s
altmacro_expression.s Fix test for altmacro 2017-05-01 14:00:54 +00:00
altmacro_string.s [LLVM][inline-asm][Altmacor] Altmacro string delimiter '<..>' 2017-05-04 10:37:00 +00:00
altmacro_string_escape.s [LLVM][inline-asm] Altmacro string escape character '!' 2017-05-10 13:08:11 +00:00
assembler-expressions-fail.s [MC] Change AsmParser to leverage Assembler during evaluation 2018-04-30 19:22:40 +00:00
assembler-expressions-inlineasm.ll [MC] Change AsmParser to leverage Assembler during evaluation 2018-04-30 19:22:40 +00:00
assembler-expressions.s [MC] Change AsmParser to leverage Assembler during evaluation 2018-04-30 19:22:40 +00:00
assignment.s Use .set instead of = when printing assignment in assembly output 2018-03-27 16:44:41 +00:00
at-pseudo-variable-bad.s [MC] Fix Error Location for ParseIdentifier 2016-10-12 13:58:07 +00:00
at-pseudo-variable.s
bad-macro.s
cfi-unfinished-frame.s
cfi-unknown-register.s [MC] Handle unknown literal register numbers in .cfi_* directives 2017-12-01 21:44:27 +00:00
cfi-window-save.s
comments-x86-darwin.s Followup to 258750; update all MC tests to use .p2align . 2016-01-26 00:27:59 +00:00
conditional_asm.s
dash-n.s
debug-empty-source.s Specify REQUIRES: default_triple in a few tests 2018-04-26 19:15:25 +00:00
debug-no-source.s Specify REQUIRES: default_triple in a few tests 2018-04-26 19:15:25 +00:00
defsym.s
defsym_error1.s
defsym_error2.s [llvm-mc] Make error handling more consistent. 2018-04-22 08:01:35 +00:00
directive-err-diagnostics.s
directive-err.s
directive-warning.s
directive_abort.s
directive_align.s [AsmParser][GAS-compatibility] Ignore an empty 'p2align' directive 2017-08-02 17:36:10 +00:00
directive_ascii.s
directive_comm.s
directive_darwin_section.s
directive_dc.s [MC] Support .dc directives in assembler parser 2016-08-23 21:34:53 +00:00
directive_dcb.s [MC] Support .dcb directives in assembler parser 2016-09-23 19:25:15 +00:00
directive_desc.s
directive_ds.s [MC] Support .ds directives in assembler parser 2016-09-23 21:53:36 +00:00
directive_elf_size.s
directive_end-2.s
directive_end.s
directive_file-2.s [DWARF] Fix mixing assembler -g with DWARF .file directives. 2018-03-22 15:48:01 +00:00
directive_file.s
directive_fill.s [MC] Change AsmParser to leverage Assembler during evaluation 2018-04-30 19:22:40 +00:00
directive_incbin.s [MC] Support skip and count for .incbin directive 2016-09-23 00:41:06 +00:00
directive_include.s Use .set instead of = when printing assignment in assembly output 2018-03-27 16:44:41 +00:00
directive_lcomm.s
directive_line.s
directive_loc.s
directive_lsym.s
directive_org.s
directive_print.s [AsmParser] Support GAS's .print directive 2017-10-02 14:36:31 +00:00
directive_rept-diagnostics.s
directive_rept.s
directive_seh.s
directive_set.s Use .set instead of = when printing assignment in assembly output 2018-03-27 16:44:41 +00:00
directive_space.s [MC] Support symbolic expressions in assembly directives 2016-05-28 05:57:48 +00:00
directive_subsections_via_symbols.s
directive_symbol_attrs.s
directive_tbss.s
directive_tdata.s
directive_thread_init_func.s
directive_tlv.s
directive_values.s
directive_zerofill.s
dollars-in-identifiers.s
dot-symbol-assignment-backwards.s [Assembler] Better error messages for .org directive 2016-12-14 10:43:58 +00:00
dot-symbol-assignment.s
dot-symbol-non-absolute.s Simplify .org processing and make it a bit more powerful. 2015-11-04 23:50:29 +00:00
dot-symbol.s
empty-comment.s [MC] Fix compiler crash in AsmParser::Lex 2017-06-09 14:04:03 +00:00
equ.s [AsmParser] Diagnose empty symbol for .set directive 2016-12-01 18:00:36 +00:00
expr-shr.s [LLVM] Remove unwanted --check-prefix=CHECK from unit tests. NFC. 2016-04-19 23:51:52 +00:00
expr_symbol_modifiers.s
exprs-invalid.s [MC] Fix Various End Of Line Comment checkings 2016-10-24 14:35:29 +00:00
exprs.s [MC] Use LShr for constant evaluation of ">>" on non-arm64 darwin. 2015-11-11 00:51:36 +00:00
extern.s
floating-literals.s Ignore Lexing errors in macro body definitions 2016-06-02 17:15:05 +00:00
hash-directive.s Refactor and cleanup Assembly Parsing / Lexing 2016-06-17 16:06:17 +00:00
hello.s
if-diagnostics.s
ifb.s
ifc.s
ifdef.s
ifeqs-diagnostics.s
ifeqs.s
ifndef.s
ifnes.s
incbin_abcd
include.ll Use .set instead of = when printing assignment in assembly output 2018-03-27 16:44:41 +00:00
inline-comments.ll Provide support for preserving assembly comments 2016-07-11 12:42:14 +00:00
inline_macro_duplication.ll Specify REQUIRES: default_triple in a few tests 2018-04-26 19:15:25 +00:00
invalid-asm-variant.s [MC] Make llvm-mc fail cleanly on invalid output asm variant. 2016-10-31 18:36:31 +00:00
invalid-input-assertion.s
labels.s Use .set instead of = when printing assignment in assembly output 2018-03-27 16:44:41 +00:00
line_with_hash.s
lit.local.cfg
macro-args.s Use .set instead of = when printing assignment in assembly output 2018-03-27 16:44:41 +00:00
macro-def-in-instantiation.s
macro-duplicate-params-names-err.s Add triples or specify REQUIRES: default_triple to some tests 2018-01-27 23:31:09 +00:00
macro-err1.s
macro-exitm.s
macro-irp.s AsmParser: Fix nested .irp/.irpc 2016-03-01 08:18:28 +00:00
macro-irpc.s AsmParser: Fix nested .irp/.irpc 2016-03-01 08:18:28 +00:00
macro-max-depth.s [MC] Add command-line option to choose the max nest level in asm macros. 2016-07-27 05:51:56 +00:00
macro-qualifier-diagnostics.s
macro-qualifier.s
macro-rept-err1.s
macro-rept-err2.s
macro-rept.s
macro_parsing.s Ignore Lexing errors in macro body definitions 2016-06-02 17:15:05 +00:00
macros-argument-parsing-diagnostics.s
macros-argument-parsing.s
macros-darwin-vararg.s
macros-darwin.s
macros-gas.s [MC] Fixed parsing of macro arguments where expressions with spaces are present. 2016-02-11 13:48:49 +00:00
macros-parsing.s
negativ_altmacro_expression.s fix trivial typo in comment, NFC 2017-06-26 06:32:04 +00:00
negative_altmacro_string.s [LLVM][inline-asm][Altmacor] Altmacro string delimiter '<..>' 2017-05-04 10:37:00 +00:00
non-english-characters.s [MC] - llvm-mc hangs on non-english characters. 2017-10-05 08:15:55 +00:00
pr11865.s
pr28805.ll Revert r276895 "[MC][X86] Fix Intel Operand assembly parsing for .set ids" 2016-08-01 23:00:01 +00:00
pr28921.s Prevent out of order HashDirective lexing in AsmLexer. 2016-10-03 13:48:27 +00:00
preserve-comments-crlf.s REQUIRES: shell a couple of tests that require the shell 2018-02-10 00:14:54 +00:00
preserve-comments.s [MC] Cleanup Error Handling in AsmParser 2016-07-18 15:24:03 +00:00
purgem.s
reassign.s
rename.s
section.s
section_names.s Add default typo to .tbss.* 2017-03-22 14:04:19 +00:00
secure_log_unique.s
seh-directive-errors.s [CodeGen] Unify MBB reference format in both MIR and debug output 2017-12-04 17:18:51 +00:00
seh-unfinished-frame.s [MC] Suppress .Lcfi labels when emitting textual assembly 2017-10-10 00:57:36 +00:00
undefined-local-symbol.s MC: Don't crash after issuing a diagnostic. 2015-10-16 22:07:59 +00:00
uppercase-hex.s [MCParser] Accept uppercase radix variants 0X and 0B 2016-03-18 18:22:07 +00:00
vararg-default-value.s
vararg.s
variables-invalid.s
variables.s