63 lines · plain
1; RUN: llc -o - %s -mtriple=x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK2; RUN: llc -o - %s -mtriple=x86_64-windows-msvc | FileCheck %s --check-prefixes=CHECK3; RUN: llc -o - %s -mtriple=x86_64-apple-darwin | FileCheck %s --check-prefixes=CHECK,NO_TRAP_AFTER_NORETURN4 5; On PS4/PS5, always emit trap instructions regardless of of trap-unreachable or no-trap-after-noreturn.6; RUN: llc -o - %s -mtriple=x86_64-scei-ps4 -trap-unreachable | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN7; RUN: llc -o - %s -mtriple=x86_64-sie-ps5 -trap-unreachable | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN8; RUN: llc -o - %s -mtriple=x86_64-scei-ps4 -trap-unreachable=false | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN9; RUN: llc -o - %s -mtriple=x86_64-sie-ps5 -trap-unreachable=false | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN10; RUN: llc -o - %s -mtriple=x86_64-scei-ps4 -trap-unreachable -no-trap-after-noreturn=false | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN11; RUN: llc -o - %s -mtriple=x86_64-sie-ps5 -trap-unreachable -no-trap-after-noreturn=false | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN12 13; RUN: llc --trap-unreachable -o - %s -mtriple=x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN14; RUN: llc --trap-unreachable -global-isel -o - %s -mtriple=x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN15; RUN: llc --trap-unreachable -fast-isel -o - %s -mtriple=x86_64-linux-gnu | FileCheck %s --check-prefixes=CHECK,TRAP_AFTER_NORETURN16 17; CHECK-LABEL: call_exit:18; CHECK: callq {{_?}}exit19; TRAP_AFTER_NORETURN: ud220; CHECK-NOT: ud221define i32 @call_exit() noreturn nounwind {22 tail call void @exit(i32 0)23 unreachable24}25 26; CHECK-LABEL: trap:27; CHECK: ud228; CHECK-NOT: ud229define i32 @trap() noreturn nounwind {30 tail call void @llvm.trap()31 unreachable32}33 34; CHECK-LABEL: trap_fn_attr:35; CHECK: callq {{_?}}trap_func36; TRAP_AFTER_NORETURN: ud237; CHECK-NOT: ud238define i32 @trap_fn_attr() noreturn nounwind {39 tail call void @llvm.trap() "trap-func-name"="trap_func"40 unreachable41}42 43; CHECK-LABEL: noreturn_indirect:44; CHECK: callq *%r{{.+}}45; TRAP_AFTER_NORETURN: ud246; CHECK-NOT: ud247define i32 @noreturn_indirect(ptr %fptr) noreturn nounwind {48 tail call void (...) %fptr() noreturn nounwind49 unreachable50}51 52; CHECK-LABEL: unreachable:53; TRAP_AFTER_NORETURN: ud254; NO_TRAP_AFTER_NORETURN: ud255; CHECK-NOT: ud256; CHECK: # -- End function57define i32 @unreachable() noreturn nounwind {58 unreachable59}60 61declare void @llvm.trap() nounwind noreturn62declare void @exit(i32 %rc) nounwind noreturn63