llvm-6502/test
Greg Fitzgerald 148c7f286c Fix inline assembly that switches between ARM and Thumb modes
This patch restores the ARM mode if the user's inline assembly
does not.  In the object streamer, it ensures that instructions
following the inline assembly are encoded correctly and that
correct mapping symbols are emitted.  For the asm streamer, it
emits a .arm or .thumb directive.

This patch does not ensure that the inline assembly contains
the ADR instruction to switch modes at runtime.

The problem we need to solve is code like this:

  int foo(int a, int b) {
    int r = a + b;
    asm volatile(
        ".align 2     \n"
        ".arm         \n"
        "add r0,r0,r0 \n"
    : : "r"(r));
    return r+1;
  }

If we compile this function in thumb mode then the inline assembly
will switch to arm mode. We need to make sure that we switch back to
thumb mode after emitting the inline assembly or we will incorrectly
encode the instructions that follow (i.e. the assembly instructions
for return r+1).

Based on patch by David Peixotto

Change-Id: Ib57f6d2d78a22afad5de8693fba6230ff56ba48b

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199818 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-22 18:32:35 +00:00
..
Analysis BasicAA: We need to check both access sizes when comparing a gep and an 2014-01-16 04:53:18 +00:00
Assembler Add an inalloca flag to allocas 2014-01-17 23:58:17 +00:00
Bindings
Bitcode Report a warning when dropping outdated debug info metadata. 2014-01-16 01:51:12 +00:00
BugPoint
CodeGen Fix inline assembly that switches between ARM and Thumb modes 2014-01-22 18:32:35 +00:00
DebugInfo Debug info: On ARM ensure that all __TEXT sections come before the 2014-01-20 19:15:59 +00:00
ExecutionEngine Revert 199262 - MCJIT remote still failing on ARM 2014-01-15 09:09:46 +00:00
Feature
FileCheck
Instrumentation [asan] extend asan-coverage (still experimental). 2014-01-17 11:00:30 +00:00
Integer
JitListener
Linker Debug info (LTO): Move the creation of accessibility flags to 2014-01-18 02:12:00 +00:00
LTO
MC [x86] Allow segment and address-size overrides for INS[BWLQ] (PR9385) 2014-01-22 15:08:55 +00:00
Object Fix typo: : not ; 2014-01-16 07:08:22 +00:00
Other [PM] Wire up the Verifier for the new pass manager and connect it to the 2014-01-20 11:34:08 +00:00
TableGen [TableGen] Correctly generate implicit anonymous prototype defs in multiclasses 2014-01-02 20:47:09 +00:00
tools tools: support decoding ARM EHABI opcodes in readobj 2014-01-21 02:33:15 +00:00
Transforms Fix all the remaining lost-fast-math-flags bugs I've been able to find. The most important of these are cases in the generic logic for combining BinaryOperators. 2014-01-20 07:44:53 +00:00
Unit
Verifier [PM] Make the verifier work independently of any pass manager. 2014-01-19 02:22:18 +00:00
YAMLParser
.clang-format
CMakeLists.txt [CMake] Add llvm-tblgen to dependencies of check-llvm. 2014-01-18 19:01:08 +00:00
lit.cfg
lit.site.cfg.in [CMake] Add missing set_output_directory after Takumi's change in r198205. 2014-01-02 19:47:45 +00:00
Makefile
Makefile.tests
TestRunner.sh