3
3
#![ crate_type = "lib" ]
4
4
#![ feature( rustc_attrs) ]
5
5
6
- use std:: mem:: MaybeUninit ;
7
-
8
6
pub struct S {
9
7
_field : [ i32 ; 8 ] ,
10
8
}
@@ -13,79 +11,68 @@ pub struct UnsafeInner {
13
11
_field : std:: cell:: UnsafeCell < i16 > ,
14
12
}
15
13
16
- // CHECK: noundef zeroext i1 @boolean(i1 noundef zeroext %x)
14
+ // CHECK: zeroext i1 @boolean(i1 zeroext %x)
17
15
#[ no_mangle]
18
16
pub fn boolean ( x : bool ) -> bool {
19
17
x
20
18
}
21
19
22
- // CHECK: i8 @maybeuninit_boolean(i8 %x)
23
- #[ no_mangle]
24
- pub fn maybeuninit_boolean ( x : MaybeUninit < bool > ) -> MaybeUninit < bool > {
25
- x
26
- }
27
-
28
- // CHECK: @readonly_borrow(i32* noalias noundef readonly align 4 dereferenceable(4) %_1)
20
+ // CHECK: @readonly_borrow(i32* noalias readonly align 4 dereferenceable(4) %_1)
29
21
// FIXME #25759 This should also have `nocapture`
30
22
#[ no_mangle]
31
23
pub fn readonly_borrow ( _: & i32 ) {
32
24
}
33
25
34
- // CHECK: @static_borrow(i32* noalias noundef readonly align 4 dereferenceable(4) %_1)
26
+ // CHECK: @static_borrow(i32* noalias readonly align 4 dereferenceable(4) %_1)
35
27
// static borrow may be captured
36
28
#[ no_mangle]
37
29
pub fn static_borrow ( _: & ' static i32 ) {
38
30
}
39
31
40
- // CHECK: @named_borrow(i32* noalias noundef readonly align 4 dereferenceable(4) %_1)
32
+ // CHECK: @named_borrow(i32* noalias readonly align 4 dereferenceable(4) %_1)
41
33
// borrow with named lifetime may be captured
42
34
#[ no_mangle]
43
35
pub fn named_borrow < ' r > ( _: & ' r i32 ) {
44
36
}
45
37
46
- // CHECK: @unsafe_borrow(i16* noundef align 2 dereferenceable(2) %_1)
38
+ // CHECK: @unsafe_borrow(i16* align 2 dereferenceable(2) %_1)
47
39
// unsafe interior means this isn't actually readonly and there may be aliases ...
48
40
#[ no_mangle]
49
41
pub fn unsafe_borrow ( _: & UnsafeInner ) {
50
42
}
51
43
52
- // CHECK: @mutable_unsafe_borrow(i16* noalias noundef align 2 dereferenceable(2) %_1)
44
+ // CHECK: @mutable_unsafe_borrow(i16* noalias align 2 dereferenceable(2) %_1)
53
45
// ... unless this is a mutable borrow, those never alias
54
46
#[ no_mangle]
55
47
pub fn mutable_unsafe_borrow ( _: & mut UnsafeInner ) {
56
48
}
57
49
58
- // CHECK: @mutable_borrow(i32* noalias noundef align 4 dereferenceable(4) %_1)
50
+ // CHECK: @mutable_borrow(i32* noalias align 4 dereferenceable(4) %_1)
59
51
// FIXME #25759 This should also have `nocapture`
60
52
#[ no_mangle]
61
53
pub fn mutable_borrow ( _: & mut i32 ) {
62
54
}
63
55
64
- // CHECK: @indirect_struct(%S* noalias nocapture noundef dereferenceable(32) %_1)
56
+ // CHECK: @indirect_struct(%S* noalias nocapture dereferenceable(32) %_1)
65
57
#[ no_mangle]
66
58
pub fn indirect_struct ( _: S ) {
67
59
}
68
60
69
- // CHECK: @borrowed_struct(%S* noalias noundef readonly align 4 dereferenceable(32) %_1)
61
+ // CHECK: @borrowed_struct(%S* noalias readonly align 4 dereferenceable(32) %_1)
70
62
// FIXME #25759 This should also have `nocapture`
71
63
#[ no_mangle]
72
64
pub fn borrowed_struct ( _: & S ) {
73
65
}
74
66
75
- // CHECK: @raw_struct(%S* %_1)
76
- #[ no_mangle]
77
- pub fn raw_struct ( _: * const S ) {
78
- }
79
-
80
67
// `Box` can get deallocated during execution of the function, so it should
81
68
// not get `dereferenceable`.
82
- // CHECK: noalias noundef nonnull align 4 i32* @_box(i32* noalias noundef nonnull align 4 %x)
69
+ // CHECK: noalias nonnull align 4 i32* @_box(i32* noalias nonnull align 4 %x)
83
70
#[ no_mangle]
84
71
pub fn _box ( x : Box < i32 > ) -> Box < i32 > {
85
72
x
86
73
}
87
74
88
- // CHECK: @struct_return(%S* noalias nocapture noundef sret(%S) dereferenceable(32){{( %0)?}})
75
+ // CHECK: @struct_return(%S* noalias nocapture sret(%S) dereferenceable(32){{( %0)?}})
89
76
#[ no_mangle]
90
77
pub fn struct_return ( ) -> S {
91
78
S {
@@ -99,58 +86,48 @@ pub fn struct_return() -> S {
99
86
pub fn helper ( _: usize ) {
100
87
}
101
88
102
- // CHECK: @slice([0 x i8]* noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] %_1.1)
89
+ // CHECK: @slice([0 x i8]* noalias nonnull readonly align 1 %_1.0, [[USIZE]] %_1.1)
103
90
// FIXME #25759 This should also have `nocapture`
104
91
#[ no_mangle]
105
92
pub fn slice ( _: & [ u8 ] ) {
106
93
}
107
94
108
- // CHECK: @mutable_slice([0 x i8]* noalias noundef nonnull align 1 %_1.0, [[USIZE]] %_1.1)
95
+ // CHECK: @mutable_slice([0 x i8]* noalias nonnull align 1 %_1.0, [[USIZE]] %_1.1)
109
96
// FIXME #25759 This should also have `nocapture`
110
97
#[ no_mangle]
111
98
pub fn mutable_slice ( _: & mut [ u8 ] ) {
112
99
}
113
100
114
- // CHECK: @unsafe_slice([0 x i16]* noundef nonnull align 2 %_1.0, [[USIZE]] %_1.1)
101
+ // CHECK: @unsafe_slice([0 x i16]* nonnull align 2 %_1.0, [[USIZE]] %_1.1)
115
102
// unsafe interior means this isn't actually readonly and there may be aliases ...
116
103
#[ no_mangle]
117
104
pub fn unsafe_slice ( _: & [ UnsafeInner ] ) {
118
105
}
119
106
120
- // CHECK: @raw_slice([0 x i8]* %_1.0, [[USIZE]] %_1.1)
121
- #[ no_mangle]
122
- pub fn raw_slice ( _: * const [ u8 ] ) {
123
- }
124
-
125
- // CHECK: @str([0 x i8]* noalias noundef nonnull readonly align 1 %_1.0, [[USIZE]] %_1.1)
107
+ // CHECK: @str([0 x i8]* noalias nonnull readonly align 1 %_1.0, [[USIZE]] %_1.1)
126
108
// FIXME #25759 This should also have `nocapture`
127
109
#[ no_mangle]
128
110
pub fn str ( _: & [ u8 ] ) {
129
111
}
130
112
131
- // CHECK: @trait_borrow({}* noundef nonnull align 1 %_1.0, [3 x [[USIZE]]]* noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
113
+ // CHECK: @trait_borrow({}* nonnull align 1 %_1.0, [3 x [[USIZE]]]* noalias readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
132
114
// FIXME #25759 This should also have `nocapture`
133
115
#[ no_mangle]
134
116
pub fn trait_borrow ( _: & Drop ) {
135
117
}
136
118
137
- // CHECK: @trait_raw({}* %_1.0, [3 x [[USIZE]]]* noalias noundef readonly align {{.*}} dereferenceable({{.*}}) %_1.1)
138
- #[ no_mangle]
139
- pub fn trait_raw ( _: * const Drop ) {
140
- }
141
-
142
- // CHECK: @trait_box({}* noalias noundef nonnull align 1{{( %0)?}}, [3 x [[USIZE]]]* noalias noundef readonly align {{.*}} dereferenceable({{.*}}){{( %1)?}})
119
+ // CHECK: @trait_box({}* noalias nonnull align 1{{( %0)?}}, [3 x [[USIZE]]]* noalias readonly align {{.*}} dereferenceable({{.*}}){{( %1)?}})
143
120
#[ no_mangle]
144
121
pub fn trait_box ( _: Box < Drop > ) {
145
122
}
146
123
147
- // CHECK: { i8*, i8* } @trait_option(i8* noalias noundef align 1 %x.0, i8* %x.1)
124
+ // CHECK: { i8*, i8* } @trait_option(i8* noalias align 1 %x.0, i8* %x.1)
148
125
#[ no_mangle]
149
126
pub fn trait_option ( x : Option < Box < Drop > > ) -> Option < Box < Drop > > {
150
127
x
151
128
}
152
129
153
- // CHECK: { [0 x i16]*, [[USIZE]] } @return_slice([0 x i16]* noalias noundef nonnull readonly align 2 %x.0, [[USIZE]] %x.1)
130
+ // CHECK: { [0 x i16]*, [[USIZE]] } @return_slice([0 x i16]* noalias nonnull readonly align 2 %x.0, [[USIZE]] %x.1)
154
131
#[ no_mangle]
155
132
pub fn return_slice ( x : & [ u16 ] ) -> & [ u16 ] {
156
133
x
@@ -162,7 +139,7 @@ pub fn enum_id_1(x: Option<Result<u16, u16>>) -> Option<Result<u16, u16>> {
162
139
x
163
140
}
164
141
165
- // CHECK: { i8, i8 } @enum_id_2(i1 noundef zeroext %x.0, i8 %x.1)
142
+ // CHECK: { i8, i8 } @enum_id_2(i1 zeroext %x.0, i8 %x.1)
166
143
#[ no_mangle]
167
144
pub fn enum_id_2 ( x : Option < u8 > ) -> Option < u8 > {
168
145
x
0 commit comments