summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/MachO/ARM
Commit message (Collapse)AuthorAgeFilesLines
* MCMacho: Allow __thread_ptr section after dwarf sectionsMatthias Braun2017-02-011-0/+28
| | | | | | Differential Revision: https://reviews.llvm.org/D29315 llvm-svn: 293730
* [Assembler] Make fatal assembler errors non-fatalOliver Stannard2015-11-171-0/+6
| | | | | | | | | | | | | | Currently, if the assembler encounters an error after parsing (such as an out-of-range fixup), it reports this as a fatal error, and so stops after the first error. However, for most of these there is an obvious way to recover after emitting the error, such as emitting the fixup with a value of zero. This means that we can report on all of the errors in a file, not just the first one. MCContext::reportError records the fact that an error was encountered, so we won't actually emit an object file with the incorrect contents. Differential Revision: http://reviews.llvm.org/D14717 llvm-svn: 253328
* MachO: improve load command tests slightlyTim Northover2015-11-021-0/+13
| | | | llvm-svn: 251815
* ARM: add support for WatchOS's compact unwind information.Tim Northover2015-10-281-0/+124
| | | | llvm-svn: 251573
* ARM: support .watchos_version_min and .tvos_version_min.Tim Northover2015-10-284-0/+103
| | | | | | | | These MachO file directives are used by linkers and other tools to provide compatibility information, much like the existing .ios_version_min and .macosx_version_min. llvm-svn: 251569
* [MC] Convert all the remaining tests from macho-dump to llvm-readobj.Davide Italiano2015-09-103-269/+299
| | | | | | | | | This sort-of deprecates macho-dump. It may take still a little while to garbage collect it, but at least there's no real usage of it in the tree anymore. New tests should always rely on llvm-readobj or llvm-objdump. llvm-svn: 247235
* [MC] Convert tests to use llvm-readobj --macho-version-min.Davide Italiano2015-08-281-6/+12
| | | | | | As an added bonus this also tests the newly introduced feature. llvm-svn: 246296
* [llvm-readobj] Test --macho-data-in-code option.Davide Italiano2015-08-221-18/+35
| | | | | | | As added bonus this converts an existing test from macho-dump to llvm-readobj. Only 66 to go. llvm-svn: 245791
* [MC] Convert another bunch of tests from macho-dump to llvm-readobj.Davide Italiano2015-08-1812-68/+196
| | | | | | | | This is (almost) everything under MC/MachO/ARM. There are still some cases missing, because llvm-readobj doesn't (yet) support some features, that macho-dump provides. I plan to reduce the gap between them shortly. llvm-svn: 245302
* Force the MachO generated for Darwin to have VERSION_MIN load commandSteven Wu2015-08-052-22/+22
| | | | | | | | | On Darwin, it is required to stamp the object file with VERSION_MIN load command. This commit will provide a VERSRION_MIN load command to the MachO file that doesn't specify the version itself by inferring from Target Triple. llvm-svn: 244059
* Reworking the test part of r241149Gabor Ballabas2015-07-021-0/+10
| | | | | | | | | The test part of r241149 has been reverted in r241451, due to misplaced test cases. This patch splits those test cases among the appropriate targets. Differential Revision: http://reviews.llvm.org/D10897 llvm-svn: 241283
* Improve the --expand-relocs handling of MachO.Rafael Espindola2015-06-181-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In a relocation target can take 3 basic forms * A r_value in scattered relocations. * A symbol in external relocations. * A section is non-external relocations. Have the dump reflect that. With this change we go from CHECK-NEXT: Extern: 0 CHECK-NEXT: Type: X86_64_RELOC_SUBTRACTOR (5) CHECK-NEXT: Symbol: 0x2 CHECK-NEXT: Scattered: 0 To just // CHECK-NEXT: Type: X86_64_RELOC_SUBTRACTOR (5) // CHECK-NEXT: Section: __data (2) Since the relocation is with a section, we print the seciton name and don't need to say that it is not scattered or external. Someone motivated can add further special cases for things like ARM64_RELOC_ADDEND and ARM_RELOC_PAIR. llvm-svn: 240073
* MC: For variable symbols, maintain MCSymbol::Section as a cache.Peter Collingbourne2015-04-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes PR19582. Previously, when an asm assignment (.set or =) was created, we would look up the section immediately in MCSymbol::setVariableValue. This caused symbols to receive the wrong section if the RHS of the assignment had not been seen yet. This had a knock-on effect in the object file emitters, causing them to emit extra symbols, or to give symbols the wrong visibility or the wrong section. For example, in the following asm: .data .Llocal: .text leaq .Llocal1(%rip), %rdi .Llocal1 = .Llocal2 .Llocal2 = .Llocal the first assignment would give .Llocal1 a null section, which would never get fixed up by the second assignment. This would cause the ELF object file emitter to consider .Llocal1 to be an undefined symbol and give it external linkage, even though .Llocal1 should not have been emitted at all in the object file. Or in the following asm: alias_to_local = Ltmp0 Ltmp0: the Mach-O object file emitter would give the alias_to_local symbol a n_type of N_SECT and a n_sect of 0. This is invalid under the Mach-O specification, which requires N_SECT symbols to receive a non-zero section number if the symbol is defined in a section in the object file. https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/MachORuntime/#//apple_ref/c/tag/nlist After this change we do not look up the section when the assignment is created, but instead look it up on demand and store it in Section, which is treated as a cache if the symbol is a variable symbol. This change also fixes a bug in MCExpr::FindAssociatedSection. Previously, if we saw a subtraction, we would return the first referenced section, even in cases where we should have been returning the absolute pseudo-section. Now we always return the absolute pseudo-section for expressions that subtract two section-derived expressions. This isn't always correct (e.g. if one of the sections ends up being laid out at an absolute address), but it's probably the best we can do without more context. This allows us to remove code in two places where we appear to have been working around this bug, in MachObjectWriter::markAbsoluteVariableSymbols and in X86AsmPrinter::EmitStartOfAsmFile. Re-applies r233595 (aka D8586), which was reverted in r233898. Differential Revision: http://reviews.llvm.org/D8798 llvm-svn: 233995
* Revert r233595, "MC: For variable symbols, maintain MCSymbol::Section as a ↵Peter Collingbourne2015-04-021-5/+5
| | | | | | cache." llvm-svn: 233898
* MC: For variable symbols, maintain MCSymbol::Section as a cache.Peter Collingbourne2015-03-301-5/+5
| | | | | | | | | | | This fixes the visibility of symbols in certain edge cases involving aliases with multiple levels of indirection. Fixes PR19582. Differential Revision: http://reviews.llvm.org/D8586 llvm-svn: 233595
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-03-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gep operator Similar to gep (r230786) and load (r230794) changes. Similar migration script can be used to update test cases, which successfully migrated all of LLVM and Polly, but about 4 test cases needed manually changes in Clang. (this script will read the contents of stdin and massage it into stdout - wrap it in the 'apply.sh' script shown in previous commits + xargs to apply it over a large set of test cases) import fileinput import sys import re rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL) def conv(match): line = match.group(1) line += match.group(4) line += ", " line += match.group(2) return line line = sys.stdin.read() off = 0 for match in re.finditer(rep, line): sys.stdout.write(line[off:match.start()]) sys.stdout.write(conv(match)) off = match.end() sys.stdout.write(line[off:]) llvm-svn: 232184
* [AsmPrinter][TLOF] Split tests and move to appropriate directoriesBruno Cardoso Lopes2015-03-061-0/+74
| | | | | | Follow up from r231474 and 231475 to appease buildbots llvm-svn: 231480
* Convert test to llvm-readobj. NFC.Rafael Espindola2014-12-291-16/+41
| | | | llvm-svn: 224959
* MachObjectWriter: optimize the string table for common sufficesHans Wennborg2014-10-062-5/+5
| | | | | | | | This is a follow-up to r207670 (ELF) and r218636 (COFF). Differential Revision: http://reviews.llvm.org/D5622 llvm-svn: 219126
* Adds the next bit of support for llvm-objdump’s -private-headers for ↵Kevin Enderby2014-09-041-1/+1
| | | | | | | | | executable Mach-O files. This adds the printing of more load commands, so that the normal load commands in a typical X86 Mach-O executable can all be printed. llvm-svn: 217172
* 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
* MachO: move test to ARM directory.Tim Northover2014-05-301-0/+115
| | | | | | | This test specifies an ARM triple, so it needs ARM as a registered target. llvm-svn: 209905
* ARM: consolidate MachO checks for ARM asm parserSaleem Abdulrasool2014-04-051-9/+14
| | | | | | | | | | | | | | | | | | | This consolidates the duplicated MachO checks in the directive parsing for various directives that are unsupported for Mach-O. The error message change is unimportant as this restores the behaviour to that prior to the addition of the new directive handling. Furthermore, use a more direct check for MachO targeting rather than an indirect feature check of the assembler. Also simplify the test execution command to avoid temporary files. Further more, perform the check in both object and assembly emission. Whether all non-applicable directives are handled is another question. .fnstart is marked as being unsupported, however, the complementary .fnend is not. The additional unwinding directives are also still honoured. This change does not change that, though, it would be good to validate and mark them as being unsupported if they are unsupported for the MachO emission. llvm-svn: 205678
* Fix crashes when assembler directives are used that are notKevin Enderby2014-03-251-0/+24
| | | | | | | | for Mach-O object files by generating an error instead. rdar://16335232 llvm-svn: 204687
* Move yet another test that requires ARM to an ARM test directory.NAKAMURA Takumi2014-03-181-0/+10
| | | | llvm-svn: 204198
* Move tests that require ARM to an ARM test directory.Jim Grosbach2014-03-182-0/+70
| | | | llvm-svn: 204197
* Fixed a bug in getARMFixupKindMachOInfo() where three ARM fixup kindsKevin Enderby2013-12-131-0/+9
| | | | | | | | | | | were falling into the cases for 24-bit branch kinds which are not 24-bit branches. The routine is to return false for fixups are expected to always be resolvable at assembly time. Which these three fixups are as they have limited displacement and are for local references within a function. rdar://15586725 llvm-svn: 197282
* [tests] Cleanup initialization of test suffixes.Daniel Dunbar2013-08-161-2/+0
| | | | | | | | | | | | | | | | | - Instead of setting the suffixes in a bunch of places, just set one master list in the top-level config. We now only modify the suffix list in a few suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py). - Aside from removing the need for a bunch of lit.local.cfg files, this enables 4 tests that were inadvertently being skipped (one in Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been XFAILED). - This commit also fixes a bunch of config files to use config.root instead of older copy-pasted code. llvm-svn: 188513
* Correct ARM NOP encodingDavid Sehr2012-12-051-1/+1
| | | | | | | | | | The encoding of NOP in ARMAsmBackend.cpp is missing a trailing zero, which causes the emission of a coprocessor instruction rather than "mov r0, r0" as indicated in the comment. The test also checks for the wrong encoding. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121203/157919.html llvm-svn: 169420
* Test commit.David Sehr2012-12-051-1/+1
| | | | llvm-svn: 169410
* A test in thid directory was not being run because lit.local.cfg didn'tEli Bendersky2012-12-041-1/+1
| | | | | | include .ll files. Fix that. llvm-svn: 169283
* ARM: Darwin BL/BLX relocations to out-of-range symbols.Jim Grosbach2012-09-251-0/+43
| | | | | | | | | | | When a BL/BLX references a symbol in the same translation unit that is out of range, use an external relocation. The linker will use this to generate a branch island rather than a direct reference, allowing the relocation to resolve correctly. rdar://12359919 llvm-svn: 164615
* Fix a bug in ARMMachObjectWriter::RecordRelocation() in ARMMachObjectWriter.cppKevin Enderby2012-07-301-0/+44
| | | | | | | | | where the other_half of the movt and movw relocation entries needs to get set and only with the 16 bits of the other half. rdar://10038370 llvm-svn: 160978
* Refactor data-in-code annotations.Jim Grosbach2012-05-181-0/+33
| | | | | | | | | | | | | | | | | | | | | | Use a dedicated MachO load command to annotate data-in-code regions. This is the same format the linker produces for final executable images, allowing consistency of representation and use of introspection tools for both object and executable files. Data-in-code regions are annotated via ".data_region"/".end_data_region" directive pairs, with an optional region type. data_region_directive := ".data_region" { region_type } region_type := "jt8" | "jt16" | "jt32" | "jta32" end_data_region_directive := ".end_data_region" The previous handling of ARM-style "$d.*" labels was broken and has been removed. Specifically, it didn't handle ARM vs. Thumb mode when marking the end of the section. rdar://11459456 llvm-svn: 157062
* Fixed a bug in llvm-objdump when disassembling using -macho option for a binaryKevin Enderby2012-05-181-0/+5
| | | | | | containing no symbols. Fixed the crash and fixed it not disassembling anything. llvm-svn: 157031
* Add a test case for r156840, a fix to llvm-objdump when disassembling usingKevin Enderby2012-05-151-0/+20
| | | | | | -macho to disassemble the last symbol to the end of the section. llvm-svn: 156850
* Fix issues with the ARM bl and blx thumb instructions and the J1 and J2 bitsKevin Enderby2012-05-031-0/+19
| | | | | | | | | for the assembler and disassembler. Which were not being set/read correctly for offsets greater than 22 bits in some cases. Changes to lib/Target/ARM/ARMAsmBackend.cpp from Gideon Myles! llvm-svn: 156118
* Continue cleanup of LIT, getting rid of the remaining artifacts from dejagnuEli Bendersky2012-03-251-8/+1
| | | | | | | | | | | | | | * Removed test/lib/llvm.exp - it is no longer needed * Deleted the dg.exp reading code from test/lit.cfg. There are no dg.exp files left in the test suite so this code is no longer required. test/lit.cfg is now much shorter and clearer * Removed a lot of duplicate code in lit.local.cfg files that need access to the root configuration, by adding a "root" attribute to the TestingConfig object. This attribute is dynamically computed to provide the same information as was previously provided by the custom getRoot functions. * Documented the config.root attribute in docs/CommandGuide/lit.pod llvm-svn: 153408
* ARM non-scattered MachO relocations for movw/movt.Jim Grosbach2012-03-201-0/+23
| | | | | | | | Needed when building -mdynamic-no-pic code. rdar://10459256 llvm-svn: 153097
* Fix flags for test in MC/MachO/ARM/empty-function-nop.llRichard Trieu2012-03-011-4/+4
| | | | llvm-svn: 151778
* ARM implement TargetInstrInfo::getNoopForMachoTarget()Jim Grosbach2012-02-281-0/+15
| | | | | | | | | | | | | | Without this hook, functions w/ a completely empty body (including no epilogue) will cause an MCEmitter assertion failure. For example, define internal fastcc void @empty_function() { unreachable } rdar://10947471 llvm-svn: 151673
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-162-5/+13
| | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. llvm-svn: 150664
* ARM Darwin symbol ref differences w/o subsection-via-symbols.Jim Grosbach2012-01-241-0/+18
| | | | | | | | When not using subsections via symbols, the assembler can resolve symbol differences (including pcrel references) to non-local labels at assembly time, not just those in the same atom. llvm-svn: 148865
* Add testcase.Jim Grosbach2012-01-191-0/+13
| | | | llvm-svn: 148454
* Thumb2 relaxation for LDR(literal).Jim Grosbach2012-01-181-0/+13
| | | | | | | | | If the fixup is out of range for the Thumb1 instruction, relax it to the Thumb2 encoding instead. rdar://10711829 llvm-svn: 148424
* MC tweak symbol difference resolution for non-local symbols.Jim Grosbach2012-01-171-2/+2
| | | | | | | | | | | | | | When the non-local symbol in the expression is in the same fragment as the second symbol, the assembler can still evaluate the expression without needing a relocation. For example, on ARM: _foo: ldr lr, (_foo - 4) rdar://10348687 llvm-svn: 148341
* Darwin assembler improved relocs when w/o subsections_via_symbols.Jim Grosbach2011-12-071-1/+3
| | | | | | | | When the file isn't being built with subsections-via-symbols, symbol differences involving non-local symbols can be resolved more aggressively. Needed for gas compatibility. llvm-svn: 146054
* Tidy up. Move MachO tests to MachO directory.Jim Grosbach2011-12-077-0/+371
| | | | llvm-svn: 146038
* test/MC: Introduce MC/MachO/ARM, and relocate relax-thumb2-branches.s into it.NAKAMURA Takumi2011-12-062-0/+19
FIXME: Restore more other arch-dependent MachO tests. (eg. r126401 and r133856) llvm-svn: 145925
OpenPOWER on IntegriCloud