1 ; RUN: llc -o - %s -mtriple=x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,NORMAL
2 ; RUN: llc -o - %s -mtriple=x86_64-windows-msvc | FileCheck %s --check-prefixes=CHECK,NORMAL
3 ; RUN: llc -o - %s -mtriple=x86_64-scei-ps4 | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN
4 ; RUN: llc -o - %s -mtriple=x86_64-apple-darwin | FileCheck %s --check-prefixes=CHECK,NO_TRAP_AFTER_NORETURN
6 ; CHECK-LABEL: call_exit:
7 ; CHECK: callq {{_?}}exit
8 ; TRAP_AFTER_NORETURN: ud2
9 ; NO_TRAP_AFTER_NORETURN-NOT: ud2
11 define i32 @call_exit() noreturn nounwind {
12 tail call void @exit(i32 0)
18 ; TRAP_AFTER_NORETURN: ud2
19 ; NO_TRAP_AFTER_NORETURN-NOT: ud2
21 define i32 @trap() noreturn nounwind {
22 tail call void @llvm.trap()
26 ; CHECK-LABEL: unreachable:
27 ; TRAP_AFTER_NORETURN: ud2
28 ; NO_TRAP_AFTER_NORETURN: ud2
30 ; NORMAL: # -- End function
31 define i32 @unreachable() noreturn nounwind {
35 declare void @llvm.trap() nounwind noreturn
36 declare void @exit(i32 %rc) nounwind noreturn