xref: /llvm-project/llvm/test/Transforms/InstCombine/nothrow.ll (revision 91b82ce0233cddeb421e84fd3eb1a1cb3d9ebb6a)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals --version 2
2; RUN: opt < %s -passes=instcombine -S | FileCheck %s
3; rdar://6880732
4declare double @t1(i32) readonly willreturn
5
6define void @t2() nounwind {
7; CHECK: Function Attrs: nounwind
8; CHECK-LABEL: define void @t2
9; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
10; CHECK-NEXT:    ret void
11;
12  call double @t1(i32 42)  ;; dead call even though callee is not nothrow.
13  ret void
14}
15;.
16; CHECK: attributes #[[ATTR0:[0-9]+]] = { willreturn memory(read) }
17; CHECK: attributes #[[ATTR1]] = { nounwind }
18;.
19