summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/AsmParser
Commit message (Collapse)AuthorAgeFilesLines
* MCObjectStreamer: assign MCSymbols in the dummy fragment to offset 0.James Y Knight2019-11-161-11/+15
| | | | | | | | | | | | | | | | | In MCObjectStreamer, when there is no current fragment, initially symbols are created in a "pending" state and assigned to a dummy empty fragment. Previously, they were not being assigned an offset, and thus evaluateAbsolute would fail if trying to evaluate an expression 'a - b', where both 'a' and 'b' were in this pending state. Also slightly refactored the EmitLabel overload which takes an MCFragment for clarity. Fixes: https://llvm.org/PR41825 Differential Revision: https://reviews.llvm.org/D70062
* Revert "[ARM] Uses "Sun Style" syntax for section switching"Jian Cai2019-10-251-13/+0
| | | | This reverts commit 03de2f84fc4acf06c719cd007b5459c9d4d0a20c.
* [ARM] Uses "Sun Style" syntax for section switchingJian Cai2019-10-251-0/+13
| | | | | | | | | | | | | | | | Summary: Support "Sun Style" syntax for section switching ("#alloc,#write" etc). https://bugs.llvm.org/show_bug.cgi?id=43759 Reviewers: peter.smith, eli.friedman, kristof.beyls, t.p.northover Reviewed By: peter.smith Subscribers: MaskRay, llozano, manojgupta, nickdesaulniers, kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69296
* [X86] Fix register parsing in .seh_* in Intel syntaxReid Kleckner2019-10-181-0/+46
| | | | | | | | | | Previously, the parser checked for a '%' prefix to indicate a register. In Intel syntax mode, LLVM does not print a '%' prefix on registers, so LLVM could not parse its own assembly output. Instead, require that register numbers be integer literals, or at least start with an integer literal, which is consistent with .cfi_* directive register parsing. llvm-svn: 375287
* [lit] Fix internal diff's --strip-trailing-cr and use itJoel E. Denny2019-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Using GNU diff, `--strip-trailing-cr` removes a `\r` appearing before a `\n` at the end of a line. Without this patch, lit's internal diff only removes `\r` if it appears as the last character. That seems useless. This patch fixes that. This patch also adds `--strip-trailing-cr` to some tests that fail on Windows bots when D68664 is applied. Based on what I see in the bot logs, I think the following is happening. In each test there, lit diff is comparing a file with `\r\n` line endings to a file with `\n` line endings. Without D68664, lit diff reads those files in text mode, which in Windows causes `\r\n` to be replaced with `\n`. However, with D68664, lit diff reads the files in binary mode instead and thus reports that every line is different, just as GNU diff does (at least under Ubuntu). Adding `--strip-trailing-cr` to those tests restores the previous behavior while permitting the behavior of lit diff to be more like GNU diff. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68839 llvm-svn: 375020
* Revert r374652: "[lit] Fix internal diff's --strip-trailing-cr and use it"Joel E. Denny2019-10-121-1/+1
| | | | | | This series of patches still breaks a Windows bot. llvm-svn: 374679
* [lit] Fix internal diff's --strip-trailing-cr and use itJoel E. Denny2019-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Using GNU diff, `--strip-trailing-cr` removes a `\r` appearing before a `\n` at the end of a line. Without this patch, lit's internal diff only removes `\r` if it appears as the last character. That seems useless. This patch fixes that. This patch also adds `--strip-trailing-cr` to some tests that fail on Windows bots when D68664 is applied. Based on what I see in the bot logs, I think the following is happening. In each test there, lit diff is comparing a file with `\r\n` line endings to a file with `\n` line endings. Without D68664, lit diff reads those files with Python's universal newlines support activated, causing `\r` to be dropped. However, with D68664, lit diff reads the files in binary mode instead and thus reports that every line is different, just as GNU diff does (at least under Ubuntu). Adding `--strip-trailing-cr` to those tests restores the previous behavior while permitting the behavior of lit diff to be more like GNU diff. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D68839 llvm-svn: 374652
* [IA] Add tests for a few other edge casesBill Wendling2019-10-081-0/+4
| | | | | | | Test with the last eight bits within the range [7F, FF] and with lower-case hex letters. llvm-svn: 374124
* [IA] Recognize hexadecimal escape sequencesBill Wendling2019-10-081-0/+5
| | | | | | | | | | | | | | | | | Summary: Implement support for hexadecimal escape sequences to match how GNU 'as' handles them. I.e., read all hexadecimal characters and truncate to the lower 16 bits. Reviewers: nickdesaulniers, jcai19 Subscribers: llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D68598 llvm-svn: 374018
* Revert r373888 "[IA] Recognize hexadecimal escape sequences"Nico Weber2019-10-071-5/+0
| | | | | | | | | It broke MC/AsmParser/directive_ascii.s on all bots: Assertion failed: (Index < Length && "Invalid index!"), function operator[], file ../../llvm/include/llvm/ADT/StringRef.h, line 243. llvm-svn: 373898
* [IA] Recognize hexadecimal escape sequencesBill Wendling2019-10-071-0/+5
| | | | | | | | | | | | | | | | | Summary: Implement support for hexadecimal escape sequences to match how GNU 'as' handles them. I.e., read all hexadecimal characters and truncate to the lower 16 bits. Reviewers: nickdesaulniers Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68483 llvm-svn: 373888
* Remove some unnecessary REQUIRES: shell linesReid Kleckner2019-09-101-14/+13
| | | | | | | This means these tests will run on Windows. Replace one with UNSUPPORTED: system-windows. llvm-svn: 371473
* [MC] Avoid crashes from improperly nested or wrong target .seh_handlerdata ↵Reid Kleckner2019-08-301-0/+4
| | | | | | directives llvm-svn: 370540
* [X86] Print register names in .seh_* directivesReid Kleckner2019-08-302-18/+42
| | | | | | | | | | Also improve assembler parser register validation for .seh_ directives. This requires moving X86-specific seh directive handling into the x86 backend, which addresses some assembler FIXMEs. Differential Revision: https://reviews.llvm.org/D66625 llvm-svn: 370533
* Fix a crash with assembler source and -g.Paul Robinson2019-06-211-0/+24
| | | | | | | | | | | | | | | llvm-mc or clang with -g normally produces debug info describing the assembler source itself; however, if that source already contains some .file/.loc directives, we should instead emit the debug info described by those directives. For certain assembler sources seen in the wild (particularly in the Chrome build) this was causing a crash due to incorrect assumptions about legal sequences of assembler source text. Fixes PR38994. Differential Revision: https://reviews.llvm.org/D63573 llvm-svn: 364039
* [lit] Delete empty lines at the end of lit.local.cfg NFCFangrui Song2019-06-171-1/+0
| | | | llvm-svn: 363538
* [llvm-readobj] Change -t to --symbols in tests. NFCFangrui Song2019-05-012-2/+2
| | | | | | | | | | -t is --symbols in llvm-readobj but --section-details (unimplemented) in readelf. The confusing option should not be used since we aim for improving compatibility. Keep just one llvm-readobj -t use case in test/tools/llvm-readobj/symbols.test llvm-svn: 359661
* [llvm-readobj] Change -long-option to --long-option in tests. NFCFangrui Song2019-05-012-2/+2
| | | | | | | | | | We use both -long-option and --long-option in tests. Switch to --long-option for consistency. In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf. While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf). llvm-svn: 359649
* [MC] Fix floating-point literal lexing.Eli Friedman2019-03-281-4/+43
| | | | | | | | | | | | | | | | | | | | | This patch has three related fixes to improve float literal lexing: 1. Make AsmLexer::LexDigit handle floats without a decimal point more consistently. 2. Make AsmLexer::LexFloatLiteral print an error for floats which are apparently missing an "e". 3. Make APFloat::convertFromString use binutils-compatible exponent parsing. Together, this fixes some cases where a float would be incorrectly rejected, fixes some cases where the compiler would crash, and improves diagnostics in some cases. Patch by Brandon Jones. Differential Revision: https://reviews.llvm.org/D57321 llvm-svn: 357214
* X86AsmParser: Do not process a non-existent tokenCraig Topper2019-03-261-0/+4
| | | | | | | | | | This error can only happen if an unfinished operation is at Eof. Patch by Brandon Jones Differential Revision: https://reviews.llvm.org/D57379 llvm-svn: 356972
* [DWARF] Emit reasonable debug info for empty .s files.Paul Robinson2019-01-291-0/+6
| | | | llvm-svn: 352541
* [MC] Do not consider .ifdef/.ifndef as a useScott Linder2019-01-282-0/+28
| | | | | | | | This is allowed by GAS and seems correct. Differential Revision: https://reviews.llvm.org/D55439 llvm-svn: 352414
* [X86] Fix incomplete handling of register-assigned variables in parsing.Nirav Dave2019-01-111-3/+3
| | | | | | | | | | | | | | Teach x86 assembly operand parsing to distinguish between assembler variable assigned to named registers and those assigned to immediate values. Reviewers: rnk, nickdesaulniers, void Subscribers: hiraditya, jyknight, llvm-commits Differential Revision: https://reviews.llvm.org/D56287 llvm-svn: 350966
* AsmParser: test .double NaN and .double infJF Bastien2018-12-171-0/+9
| | | | | | | | | | | | | | | | Summary: It looks like this support was added to match GNU AS, but only tests .float and not .double. I asked RedHat folks to confirm that 0x7fffffffffffffff was indeed the right value for NaN. Same for infinity, but it only has positive / negative encodings. Reviewers: scanon, rjmccall Subscribers: jkorous, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D55531 llvm-svn: 349376
* [debuginfo] generate debug info with asm+.fileBrian Cain2018-08-281-0/+24
| | | | | | | | | | | | | | | Summary: For assembly input files, generate debug info even when the .file directive is present, provided it does not include a file-number argument. Fixes PR38695. Reviewers: probinson, sidneym Subscribers: aprantl, hiraditya, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D51315 llvm-svn: 340839
* [AsmParser] Fix preserve-comments-crlf.s on FreeBSDFangrui Song2018-07-261-1/+1
| | | | | | | | --strip-trailing-cr is a diffutils option which is also available on BSD-licensed diff introduced in FreeBSD 11.2, however, it has a bug comparing files mixing \r and \r\n. Use -b (POSIX) instead. llvm-svn: 338008
* [MC] Fix nested macro body parsingNirav Dave2018-07-181-0/+13
| | | | | | Add missing .rep case in nestlevel checking for macro body parsing. llvm-svn: 337398
* [X86] Fix test/MC/AsmParser/exprs-invalid.s after rL336104Alex Bradbury2018-07-021-1/+1
| | | | | | | | This was my mistake for only running test/MC/X86 and test/CodeGen/X86. Arguably .word should be removed from this test, as it is not supported universally. llvm-svn: 336107
* Move `REQUIRES:` line to the topFangrui Song2018-06-263-3/+3
| | | | llvm-svn: 335635
* [MC] Add assembler support for .cg_profile.Michael J. Spencer2018-06-021-0/+9
| | | | | | | | | | | | | | | Object FIle Representation At codegen time this is emitted into the ELF file a pair of symbol indices and a weight. In assembly it looks like: .cg_profile a, b, 32 .cg_profile freq, a, 11 .cg_profile freq, b, 20 When writing an ELF file these are put into a SHT_LLVM_CALL_GRAPH_PROFILE (0x6fff4c02) section as (uint32_t, uint32_t, uint64_t) tuples as (from symbol index, to symbol index, weight). Differential Revision: https://reviews.llvm.org/D44965 llvm-svn: 333823
* [MC] Relax .fill size requirementsNirav Dave2018-05-183-8/+64
| | | | | | | | | | | | | | | Avoid requirement that number of values must be known at assembler time. Fixes PR33586. Reviewers: rnk, peter.smith, echristo, jyknight Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D46703 llvm-svn: 332741
* Correct compatibility with the GNU Assembler's handling of comparison opsBill Wendling2018-05-143-11/+21
| | | | | | | | GAS returns -1 for a comparison operator if the result is true and 0 if false. https://www.sourceware.org/binutils/docs-2.12/as.info/Infix-Ops.html#Infix%20Ops llvm-svn: 332215
* [MC] Change AsmParser to leverage Assembler during evaluationNirav Dave2018-04-304-2/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [MC] Undo spurious commit added into r331052.Nirav Dave2018-04-274-81/+2
| | | | llvm-svn: 331055
* [MC] Provide default value for IsResolved.Nirav Dave2018-04-274-2/+81
| | | | llvm-svn: 331052
* Specify REQUIRES: default_triple in a few testsJustin Bogner2018-04-263-0/+3
| | | | | | These were all failing when specifying LLVM_DEFAULT_TARGET_TRIPLE=''. llvm-svn: 330977
* [llvm-mc] Make error handling more consistent.Jonas Devlieghere2018-04-221-1/+1
| | | | | | Makes error handling more consistent by using the helpers in support. llvm-svn: 330536
* Use .set instead of = when printing assignment in assembly outputKrzysztof Parzyszek2018-03-276-11/+22
| | | | | | | | | On Hexagon "x = y" is a syntax used in most instructions, and is not treated as a directive. Differential Revision: https://reviews.llvm.org/D44256 llvm-svn: 328635
* [DWARF] Fix mixing assembler -g with DWARF .file directives.Paul Robinson2018-03-221-1/+1
| | | | | | | | | | | We were effectively overriding an explicit '.file' directive with info for the assembler source. That shouldn't happen. Fixes PR36636, really, even for .s files emitted by Clang. Differential Revision: https://reviews.llvm.org/D44265 llvm-svn: 328208
* Revert "[DWARF] Fix mixing assembler -g with DWARF .file directives."Paul Robinson2018-03-091-1/+1
| | | | | | | This reverts commit d6d9ac1ab5039ba1fe0f63c36eac2bdd9f0a79c9. aka r327073 llvm-svn: 327083
* [DWARF] Fix mixing assembler -g with DWARF .file directives.Paul Robinson2018-03-081-1/+1
| | | | | | | | | | | We were effectively overriding an explicit '.file' directive with info for the assembler source. That shouldn't happen. Fixes PR36636. Differential Revision: https://reviews.llvm.org/D44265 llvm-svn: 327073
* [DebugInfo] Remove target-specific instructions in testScott Linder2018-02-261-2/+0
| | | | | | | This AsmParser test is target-agnostic, but contained some target-specific instructions, which broke on SystemZ. llvm-svn: 326129
* [DebugInfo] Add remaining files to r325970Scott Linder2018-02-232-0/+12
| | | | | | Add files which I missed in the original check-in llvm-svn: 325973
* Store defined macros in MCContext.Rafael Espindola2018-02-141-0/+8
| | | | | | | | | | | | | | | So that macros defined in inline assembly blocks are available to the whole file. This provides a consistent behavior with other assembly directives, since equations for example are already preserved between inline assembly blocks. PR: 36110 Patch by Roger! llvm-svn: 325139
* REQUIRES: shell a couple of tests that require the shellDavid Blaikie2018-02-101-0/+1
| | | | | | | | One test uses diff, the other tries to change the PATH which doesn't seem to work well ('not' is no longer accessible/found after the PATH is changed - I think $PATH isn't expanded when setting PATH). llvm-svn: 324787
* Add triples or specify REQUIRES: default_triple to some testsJustin Bogner2018-01-272-1/+2
| | | | | | | These were all failing when building the X86 backend but specifying LLVM_DEFAULT_TARGET_TRIPLE=''. llvm-svn: 323608
* [CodeGen] Unify MBB reference format in both MIR and debug outputFrancis Visoiu Mistrih2017-12-041-1/+1
| | | | | | | | | | | | | | | | As part of the unification of the debug format and the MIR format, print MBB references as '%bb.5'. The MIR printer prints the IR name of a MBB only for block definitions. * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g' * find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g' * grep -nr 'BB#' and fix Differential Revision: https://reviews.llvm.org/D40422 llvm-svn: 319665
* [MC] Handle unknown literal register numbers in .cfi_* directivesJake Ehrlich2017-12-011-0/+7
| | | | | | | | | | | | | | | | | r230670 introduced a step to map EH register numbers to standard DWARF register numbers. This failed to consider the case when a user .cfi_* directive uses an integer literal rather than a register name, to specify a DWARF register number that has no corresponding LLVM register number (e.g. a special register that the compiler and assembler have no name for). Fixes PR34028. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D36493 llvm-svn: 319586
* [MC] Fix regression tests on Windows when git “core.autocrlf” is set to ↵Zhen Cao2017-11-171-0/+13
| | | | | | | | | | true. Differential Revision: https://reviews.llvm.org/D39737 This is the second attempt to commit this. The test was broken on Linux in the first attempt. llvm-svn: 318560
* Revert "[MC] Fix regression tests on Windows when git “core.autocrlf” is ↵Rafael Espindola2017-11-171-13/+0
| | | | | | | | | | set to true." This reverts commit r318528. MC/AsmParser/preserve-comments-crlf.s fails on linux. llvm-svn: 318533
OpenPOWER on IntegriCloud