Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -o - %s -mtriple=x86_64-windows-msvc | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN
      2 ; RUN: llc -o - %s -mtriple=x86_64-apple-darwin | FileCheck %s --check-prefixes=CHECK,NO_TRAP_AFTER_NORETURN
      3 
      4 ; CHECK-LABEL: call_exit:
      5 ; CHECK: callq {{_?}}exit
      6 ; TRAP_AFTER_NORETURN: ud2
      7 ; NO_TRAP_AFTER_NORETURN-NOT: ud2
      8 define i32 @call_exit() noreturn nounwind {
      9   tail call void @exit(i32 0)
     10   unreachable
     11 }
     12 
     13 ; CHECK-LABEL: trap:
     14 ; CHECK: ud2
     15 ; TRAP_AFTER_NORETURN: ud2
     16 ; NO_TRAP_AFTER_NORETURN-NOT: ud2
     17 define i32 @trap() noreturn nounwind {
     18   tail call void @llvm.trap()
     19   unreachable
     20 }
     21 
     22 ; CHECK-LABEL: unreachable:
     23 ; CHECK: ud2
     24 define i32 @unreachable() noreturn nounwind {
     25   unreachable
     26 }
     27 
     28 declare void @llvm.trap() nounwind noreturn
     29 declare void @exit(i32 %rc) nounwind noreturn
     30