summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/AsmParser
Commit message (Collapse)AuthorAgeFilesLines
...
* [MC] Support symbolic expressions in assembly directivesPetr Hosek2016-05-273-28/+47
| | | | | | | | | This matches the behavior of GNU assembler which supports symbolic expressions in absolute expressions used in assembly directives. Differential Revision: http://reviews.llvm.org/D20656 llvm-svn: 271028
* PR11740: Disable assembly debug info when assembly already contains line ↵David Blaikie2016-05-262-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | directives If there is already debug info in the assembly file, and user hope to use -g option for compiling, we think we should not directly report an error. According to what GNU assembler did, it just reused the debug info in the assembly file, and turned off the DEBUG_TYPE option so that there will be no new debug info emitted by assembler. This fix is just as what GNU assembler did. The concern is the situation that there are two .text sections in the assembly file, one with debug info and the other one without. Currently with this fix, the assembler will no longer generate any debug info for the second .text section. And this is what GNU assembler exactly did for this situation. So I think this still make some sense. Patch by Zhizhou Yang! Differential Revision: http://reviews.llvm.org/D20002 llvm-svn: 270806
* Revert "[MC] Support symbolic expressions in assembly directives"Reid Kleckner2016-05-253-39/+27
| | | | | | This reverts commit r270786, it causes the directive_fill.s to fail. llvm-svn: 270795
* [MC] Support symbolic expressions in assembly directivesPetr Hosek2016-05-253-27/+39
| | | | | | | | | This matches the behavior of GNU assembler which supports symbolic expressions in absolute expressions used in assembly directives. Differential Revision: http://reviews.llvm.org/D20337 llvm-svn: 270786
* [LLVM] Remove unwanted --check-prefix=CHECK from unit tests. NFC.Mandeep Singh Grang2016-04-191-2/+2
| | | | | | | | | | | | Summary: Removed unwanted --check-prefix=CHECK from numerous unit tests. Reviewers: t.p.northover, dblaikie, uweigand, MatzeB, tstellarAMD, mcrosier Subscribers: mcrosier, dsanders Differential Revision: http://reviews.llvm.org/D19279 llvm-svn: 266834
* [MCParser] Accept uppercase radix variants 0X and 0BColin LeMahieu2016-03-181-0/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D14781 llvm-svn: 263802
* AsmParser: Fix nested .irp/.irpcNikolay Haustov2016-03-012-0/+26
| | | | | | | | Count .irp/.irpc in parseMacroLikeBody similar to .rept Update tests. Review: http://reviews.llvm.org/D17707 llvm-svn: 262313
* [MC] Fixed parsing of macro arguments where expressions with spaces are present.Scott Egerton2016-02-111-2/+2
| | | | | | | | | | | | | | | Summary: Fixed an issue for mips with an instruction such as 'sdc1 $f1, 272 +8(a0)' which has a space between '272' and '+'. The parser would then parse '272' and '+8' as two arguments instead of a single expression resulting in one too many arguments in the pseudo instruction. The reason that the test case has been changed is so that the expected output matches the output of the GNU assembler. Reviewers: vkalintiris, dsanders Subscribers: dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D13592 llvm-svn: 260521
* Followup to 258750; update all MC tests to use .p2align .Dan Gohman2016-01-262-3/+3
| | | | llvm-svn: 258754
* [MC] Use LShr for constant evaluation of ">>" on non-arm64 darwin.Ahmed Bougacha2015-11-112-4/+3
| | | | | | | Follow-up to r235963: this matches other assemblers and is less unexpected (e.g. PR23227). llvm-svn: 252681
* Simplify .org processing and make it a bit more powerful.Rafael Espindola2015-11-041-1/+1
| | | | | | | We now always create the fragment, which lets us handle things like .org after a .align. llvm-svn: 252101
* [MC] Don't crash when .word is given bogus valuesDavid Majnemer2015-10-261-0/+3
| | | | | | | | | | We didn't validate that the .word directive was given a sane value, leading to crashes when we attempt to write out the object file. Instead, perform some validation and issue a diagnostic pointing at the start of the diagnostic. llvm-svn: 251270
* MC: Don't crash after issuing a diagnostic.Jim Grosbach2015-10-161-0/+8
| | | | | | | | | | | | | | | | Crashing is bad, m'kay? Fixing a 4 year old bug of my own creation. Adding the testcase now which I should have added then which would have long since caught this. The problem is that printMessage() will display the diagnostic but not set HadError to true, resulting in the assembler continuing on its way and trying to create relocations for things that may not allow them or otherwise get itself into trouble. Using the Error() helper function here rather than calling printMessage() directly resolves this. rdar://23133240 llvm-svn: 250557
* [MC/AsmParser] Avoid setting MCSymbol.IsUsed in some casesVedant Kumar2015-08-311-0/+12
| | | | | | | | | | | | | | | | | | | | Avoid marking some MCSymbols as used in MC/AsmParser.cpp when no uses exist. This fixes a bug in parseAssignmentExpression() which inadvertently sets IsUsed, thereby triggering: "invalid re-assignment of non-absolute variable" on otherwise valid code. No other functionality change intended. The original version of this patch touched many calls to MCSymbol accessors. On rafael's advice, I have stripped this patch down a bit. As a follow-up, I intend to find the call sites which intentionally set IsUsed and force them to do so explicitly. Differential Revision: http://reviews.llvm.org/D12347 llvm-svn: 246457
* Fix a bunch of trivial cases of 'CHECK[^:]*$' in the tests. NFCIJonathan Roelofs2015-08-102-2/+2
| | | | | | | I looked into adding a warning / error for this to FileCheck, but there doesn't seem to be a good way to avoid it triggering on the instances of it in RUN lines. llvm-svn: 244481
* Teaching llvm-mc how to understand the defsym command line option. This ↵Colin LeMahieu2015-06-073-0/+24
| | | | | | allows integer-constant symbols to be defined on the command line and used during assembly. llvm-svn: 239240
* Relax these tests a bit.Rafael Espindola2015-05-221-5/+5
| | | | | | It is not relevant where in the string table the name is located. llvm-svn: 238053
* [MC] Use LShr for constant evaluation of ">>" on ELF/arm64--darwin.Ahmed Bougacha2015-04-281-0/+13
| | | | | | | | | | This matches other assemblers and is less unexpected (e.g. PR23227). On ELF, I tried binutils gas v2.24 and nasm 2.10.09, and they both agree on LShr. On COFF, I couldn't get my hands on an assembler yet, so don't change the behavior. For now, don't change it on non-AArch64 Darwin either, as the other assembler is gas v1.38, which does an AShr. llvm-svn: 235963
* [MC] [IAS] Add support for the \@ .macro pseudo-variable.Toma Tabacu2015-04-272-0/+87
| | | | | | | | | | | | | | | | | | Summary: When used, it is substituted with the number of .macro instantiations we've done up to that point in time. So if this is the 1st time we've instantiated a .macro (any .macro, regardless of name), \@ will instantiate to 0, if it's the 2nd .macro instantiation, it will instantiate to 1 etc. It can only be used inside a .macro definition, an .irp definition or an .irpc definition (those last 2 uses are undocumented). Reviewers: echristo, rafael Reviewed By: rafael Subscribers: dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D9197 llvm-svn: 235862
* Add support for .ifnes psuedo-op.Sid Manning2015-03-182-0/+39
| | | | llvm-svn: 232636
* Centralize the handling of unique ids for temporary labels.Rafael Espindola2015-03-171-2/+2
| | | | | | | | | | | | | | | | Before this patch code wanting to create temporary labels for a given entity (function, cu, exception range, etc) had to keep its own counter to have stable symbol names. createTempSymbol would still add a suffix to make sure a new symbol was always returned, but it kept a single counter. Because of that, if we were to use just createTempSymbol("cu_begin"), the label could change from cu_begin42 to cu_begin43 because some other code started using temporary labels. Simplify this by just keeping one counter per prefix and removing the various specialized counters. llvm-svn: 232535
* MC: Don't emit .no_dead_strip on targets which don't support itDavid Majnemer2014-12-241-1/+3
| | | | llvm-svn: 224808
* MC: AsmLexer: handle multi-character CommentStrings correctlySaleem Abdulrasool2014-08-141-0/+14
| | | | | | | | | | | | As X86MCAsmInfoDarwin uses '##' as CommentString although a single '#' starts a comment a workaround for this special case is added. Fixes divisions in constant expressions for the AArch64 assembler and other targets which use '//' as CommentString. Patch by Janne Grunau! llvm-svn: 215615
* Enable Darwin vararg parameters support in assembler macros.Kevin Enderby2014-08-041-5/+87
| | | | | | | | | Duplicate the vararg tests for linux and add a tests which mixed vararg arguments with darwin positional parameters. Patch by: Janne Grunau <j@jannau.net> llvm-svn: 214799
* Let the integrated assembler understand .exitm, PR20426.Nico Weber2014-07-241-0/+64
| | | | llvm-svn: 213876
* Let the integrated assembler understand .warning, PR20428.Nico Weber2014-07-241-0/+26
| | | | llvm-svn: 213873
* Allow using .cfi_startproc without a leading symbol.Rafael Espindola2014-06-231-16/+0
| | | | | | This is possible now that we don't produce .eh symbols. This fixes pr19430. llvm-svn: 211502
* MCNullStreamer: assign file IDs to resolve crashes and errorsAlp Toker2014-06-193-0/+3
| | | | | | | | | | Use the MCStreamer base implementations for file ID tracking instead of overriding them as no-ops. Avoids assertions when streaming Dwarf debug info, and fixes ASM parsing of loc and file directives. llvm-svn: 211282
* MC: do not add comment string to the AsmToken in AsmLexer::LexLineCommentSaleem Abdulrasool2014-06-181-0/+10
| | | | | | | | Fixes macros with varargs if the macro instantiation has a trailing comment. Patch by Janne Grunau! llvm-svn: 211219
* MCAsmParser: full support for gas' '.if{cond} expression' directivesSaleem Abdulrasool2014-06-182-0/+89
| | | | | | Patch by Janne Grunau! llvm-svn: 211218
* Rearrange the CHECK lines in this test to make failure more obvious.Reid Kleckner2014-06-101-17/+16
| | | | llvm-svn: 210575
* Revert "Patch by Ray Donnelly to print register names instead of numbers."Reid Kleckner2014-06-101-4/+4
| | | | | | | | | | | | | This reverts commit r206683. The code was confusing SEH register numbers with DWARF register numbers. The test case it was committed with was obviously incorrect. The disassembler was roundtripping '.seh_pushreg %rsi' as '.seh_pushreg %rbp', and other exciting things. Noticed by Vadim Chugunov. llvm-svn: 210574
* Reduce verbiage of lit.local.cfg filesAlp Toker2014-06-091-2/+1
| | | | | | We can just split targets_to_build in one place and make it immutable. llvm-svn: 210496
* MC: remove unnecessary restriction on testsSaleem Abdulrasool2014-05-231-1/+0
| | | | | | | | | | Rafael correctly pointed out that the restriction is unnecessary. Although the tests are intended to ensure that we dont abort due to an assertion, running the tests in all modes is better since it also ensures that we dont crash without assertions. Always run these tests to ensure that we can handle invalid input correctly. llvm-svn: 209496
* MC: loosen an overzealous assertionSaleem Abdulrasool2014-05-211-0/+10
| | | | | | | | Permit active macro expansions when terminating the assembler if there were errors during the expansion. This would only trigger on invalid input when built with assertions. llvm-svn: 209309
* Integrated assbemler, macros: added 'vararg' argument qualifier support.Stepan Dyatkovskiy2014-04-233-0/+64
| | | | | | Note, currently we have no 'vararg' support for darwin macros. llvm-svn: 206951
* Patch by Ray Donnelly to print register names instead of numbers.Yaron Keren2014-04-191-4/+4
| | | | | | http://reviews.llvm.org/D3422 llvm-svn: 206683
* Revert r206565 (and r206566 which updated tests).Chandler Carruth2014-04-181-4/+4
| | | | | | | | | | | | | | This commit was attributed to a different person from the person who posted the patch to the list, and the person who posted it the list claimed when they did that they were not the author, but that the author was yet a third person. I don't know what is going on here, but reverting until the attribution is clear and the author has explicitly contributed the patch. Also, the review hasn't really involved any of the MC maintainers and that seems questionable too. llvm-svn: 206576
* Updated test with register names following r206565.Yaron Keren2014-04-181-4/+4
| | | | llvm-svn: 206566
* [MC] Emit an error if cfi_startproc is used before a symbol is defined.Quentin Colombet2014-04-151-0/+16
| | | | | | | | | Currently, we bind those directives with the last symbol, so if none has been defined, this would lead to a crash of the compiler. <rdar://problem/15939159> llvm-svn: 206236
* Move tests that require ARM to an ARM test directory.Jim Grosbach2014-03-182-70/+0
| | | | llvm-svn: 204197
* Darwin: Add assembler directives to create version-min load commands.Jim Grosbach2014-03-182-0/+70
| | | | | | | | | | | | Allow object files to be tagged with a version-min load command for iOS or MacOSX. Teach macho-dump to understand the version-min load commands for testcases. rdar://11337778 llvm-svn: 204190
* AsmParser: add missed testsSaleem Abdulrasool2014-03-031-0/+22
| | | | | | The diagnostics tests were missing from the previous introduction of ifeqs. llvm-svn: 202674
* Asm Parser: support .error directiveSaleem Abdulrasool2014-02-232-0/+28
| | | | | | | | The .error directive is similar to .err in that it will halt assembly if it is evaluated for assembly. However, it permits a user supplied message to be rendered. llvm-svn: 201999
* AsmParser: support .ifeqs directiveSaleem Abdulrasool2014-02-231-0/+20
| | | | | | | The .ifeqs directive assembles the following code if the quoted string parameters are equal. The strings must be quoted using double quotes. llvm-svn: 201998
* MCAsmParser: support .ifneSaleem Abdulrasool2014-02-231-0/+9
| | | | | | | The .ifne directive assembles the following section of code if the argument expression is non-zero. Effectively, it is equivalent to if. llvm-svn: 201986
* MCAsmParser: handle space properly for .ifc/.ifncSaleem Abdulrasool2014-02-231-0/+5
| | | | | | | | If the strings are not quoted, the first string stops at the first comma, and the second string stops at the end of the line. Strings which contain whitespace should be quoted. Unquoted space is to be discarded. llvm-svn: 201985
* MCAsmParser: add support for .err directiveSaleem Abdulrasool2014-02-231-0/+19
| | | | | | | The .err directive produces an error whenever it is assembled. This can be useful for preventing assembly when an unexpected condition occurs. llvm-svn: 201984
* AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets.Benjamin Kramer2014-02-202-1/+13
| | | | | | There is code in the wild that relies on $0 not being expanded. llvm-svn: 201784
* MCAsmParser: support required parametersSaleem Abdulrasool2014-02-192-0/+80
| | | | | | | | | | | This enhances the macro parser to parse and handle parameter qualifications, which is needed to support required formal parameters in macro definitions. A required parameter may not be defaulted (though providing a default value is accepted with a warning). This improves GAS compatibility. Partially addresses PR9248. llvm-svn: 201630
OpenPOWER on IntegriCloud