1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -S -passes=ipsccp < %s | FileCheck %s
3 @g = external global i8
5 define internal noundef i32 @ret_noundef() {
6 ; CHECK-LABEL: define internal i32 @ret_noundef() {
7 ; CHECK-NEXT: ret i32 poison
12 define internal dereferenceable(1) ptr @ret_dereferenceable() {
13 ; CHECK-LABEL: define internal ptr @ret_dereferenceable() {
14 ; CHECK-NEXT: ret ptr poison
19 define internal dereferenceable_or_null(1) ptr @ret_dereferenceable_or_null() {
20 ; CHECK-LABEL: define internal ptr @ret_dereferenceable_or_null() {
21 ; CHECK-NEXT: ret ptr poison
26 ; Non-null is fine, because it does not cause immediate UB.
27 define internal nonnull ptr @ret_nonnull() {
28 ; CHECK-LABEL: define internal nonnull ptr @ret_nonnull() {
29 ; CHECK-NEXT: ret ptr poison
34 define internal nonnull ptr @ret_nonnull_noundef() {
35 ; CHECK-LABEL: define internal nonnull ptr @ret_nonnull_noundef() {
36 ; CHECK-NEXT: ret ptr poison
42 ; CHECK-LABEL: define void @test() {
43 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @ret_noundef()
44 ; CHECK-NEXT: [[TMP2:%.*]] = call ptr @ret_dereferenceable()
45 ; CHECK-NEXT: [[TMP3:%.*]] = call ptr @ret_dereferenceable_or_null()
46 ; CHECK-NEXT: [[TMP4:%.*]] = call nonnull ptr @ret_nonnull()
47 ; CHECK-NEXT: [[TMP5:%.*]] = call nonnull ptr @ret_nonnull_noundef()
48 ; CHECK-NEXT: ret void
50 call noundef i32 @ret_noundef()
51 call dereferenceable(1) ptr @ret_dereferenceable()
52 call dereferenceable_or_null(1) ptr @ret_dereferenceable_or_null()
53 call nonnull ptr @ret_nonnull()
54 call nonnull noundef ptr @ret_nonnull_noundef()