llvm-6502/test/CodeGen
Bill Wendling e9bf7e692e Handle code gen for the unreachable instruction if it's the only instruction in
the function. We'll just turn it into a "trap" instruction instead.

The problem with not handling this is that it might generate a prologue without
the equivalent epilogue to go with it:

$ cat t.ll
define void @foo() {
entry:
  unreachable
}
$ llc -o - t.ll -relocation-model=pic -disable-fp-elim -unwind-tables
        .section        __TEXT,__text,regular,pure_instructions
        .globl  _foo
        .align  4, 0x90
_foo:                                   ## @foo
Leh_func_begin0:
## BB#0:                                ## %entry
        pushq   %rbp
Ltmp0:
        movq    %rsp, %rbp
Ltmp1:
Leh_func_end0:
...

The unwind tables then have bad data in them causing all sorts of problems.

Fixes <rdar://problem/8096481>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 23:32:40 +00:00
..
Alpha
ARM Split -enable-finite-only-fp-math to two options: 2010-07-15 22:07:12 +00:00
Blackfin Remove TargetInstrInfo::copyRegToReg entirely. 2010-07-11 17:01:17 +00:00
CBackend
CellSPU Fix some tests that didn't test anything. 2010-06-26 20:05:06 +00:00
CPP
Generic Fix up -fstack-protector on linux to use the segment 2010-07-06 05:18:56 +00:00
MBlaze
Mips
MSP430
PIC16
PowerPC Handle code gen for the unreachable instruction if it's the only instruction in 2010-07-15 23:32:40 +00:00
SPARC
SystemZ
Thumb Propagate the AlignStack bit in InlineAsm's to the 2010-07-02 20:16:09 +00:00
Thumb2 Improve 64-subtraction of immediates when parts of the immediate can fit 2010-07-14 17:45:16 +00:00
X86 Handle code gen for the unreachable instruction if it's the only instruction in 2010-07-15 23:32:40 +00:00
XCore