| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 |
| ; RUN: opt -passes=attributor -S < %s 2>&1 | FileCheck %s |
| |
| ; When a function referenced in !inline_history metadata is deleted by a pass |
| ; that uses CallGraphUpdater (e.g. Attributor), the function must not simply |
| ; get RAUW'd with poison before being erased. Reason: this causes the |
| ; !inline_history metadata to contain "ptr poison" instead of null, which would |
| ; be the correct choice. |
| ; This test verifies that the metadata contains null instead of poison. |
| |
| define internal void @dead_fn() { |
| unreachable |
| } |
| |
| define void @live_fn() { |
| ; CHECK-LABEL: define void @live_fn() { |
| ; CHECK-NEXT: call void @ext(), !inline_history [[META0:![0-9]+]] |
| ; CHECK-NEXT: ret void |
| ; |
| call void @ext(), !inline_history !0 |
| ret void |
| } |
| |
| declare void @ext() |
| |
| !0 = !{ptr @dead_fn} |
| ;. |
| ; CHECK: [[META0]] = distinct !{null} |
| ;. |