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 Split big test into multiple directories to cater to 2010-04-07 20:43:35 +00:00
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 Split big test into multiple directories to cater to 2010-04-07 20:43:35 +00:00
Mips Start function numbering at 0. 2010-04-17 16:29:15 +00:00
MSP430 Insert ANY_EXTEND node instead of invalid truncate during DAG Combining (X & 1), 2010-05-01 12:52:34 +00:00
PIC16 Remove XFAIL for vg_leak as the leaks are fixed by 100601. 2010-04-07 07:06:48 +00:00
PowerPC Handle code gen for the unreachable instruction if it's the only instruction in 2010-07-15 23:32:40 +00:00
SPARC Split big test into multiple directories to cater to 2010-04-07 20:43:35 +00:00
SystemZ SystemZ really does mean "has calls" and not just "adjusts stack." Go ahead and 2010-05-14 22:17:42 +00:00
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 Start function numbering at 0. 2010-04-17 16:29:15 +00:00