33#![ crate_type = "lib" ]
44#![ feature( rustc_attrs) ]
55
6- use std:: mem:: MaybeUninit ;
7-
86pub struct S {
97 _field : [ i32 ; 8 ] ,
108}
@@ -13,79 +11,68 @@ pub struct UnsafeInner {
1311 _field : std:: cell:: UnsafeCell < i16 > ,
1412}
1513
16- // CHECK: noundef zeroext i1 @boolean(i1 noundef zeroext %x)
14+ // CHECK: zeroext i1 @boolean(i1 zeroext %x)
1715#[ no_mangle]
1816pub fn boolean ( x : bool ) -> bool {
1917 x
2018}
2119
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)
2921// FIXME #25759 This should also have `nocapture`
3022#[ no_mangle]
3123pub fn readonly_borrow ( _: & i32 ) {
3224}
3325
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)
3527// static borrow may be captured
3628#[ no_mangle]
3729pub fn static_borrow ( _: & ' static i32 ) {
3830}
3931
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)
4133// borrow with named lifetime may be captured
4234#[ no_mangle]
4335pub fn named_borrow < ' r > ( _: & ' r i32 ) {
4436}
4537
46- // CHECK: @unsafe_borrow(i16* noundef align 2 dereferenceable(2) %_1)
38+ // CHECK: @unsafe_borrow(i16* align 2 dereferenceable(2) %_1)
4739// unsafe interior means this isn't actually readonly and there may be aliases ...
4840#[ no_mangle]
4941pub fn unsafe_borrow ( _: & UnsafeInner ) {
5042}
5143
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)
5345// ... unless this is a mutable borrow, those never alias
5446#[ no_mangle]
5547pub fn mutable_unsafe_borrow ( _: & mut UnsafeInner ) {
5648}
5749
58- // CHECK: @mutable_borrow(i32* noalias noundef align 4 dereferenceable(4) %_1)
50+ // CHECK: @mutable_borrow(i32* noalias align 4 dereferenceable(4) %_1)
5951// FIXME #25759 This should also have `nocapture`
6052#[ no_mangle]
6153pub fn mutable_borrow ( _: & mut i32 ) {
6254}
6355
64- // CHECK: @indirect_struct(%S* noalias nocapture noundef dereferenceable(32) %_1)
56+ // CHECK: @indirect_struct(%S* noalias nocapture dereferenceable(32) %_1)
6557#[ no_mangle]
6658pub fn indirect_struct ( _: S ) {
6759}
6860
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)
7062// FIXME #25759 This should also have `nocapture`
7163#[ no_mangle]
7264pub fn borrowed_struct ( _: & S ) {
7365}
7466
75- // CHECK: @raw_struct(%S* %_1)
76- #[ no_mangle]
77- pub fn raw_struct ( _: * const S ) {
78- }
79-
8067// `Box` can get deallocated during execution of the function, so it should
8168// 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)
8370#[ no_mangle]
8471pub fn _box ( x : Box < i32 > ) -> Box < i32 > {
8572 x
8673}
8774
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)?}})
8976#[ no_mangle]
9077pub fn struct_return ( ) -> S {
9178 S {
@@ -99,58 +86,48 @@ pub fn struct_return() -> S {
9986pub fn helper ( _: usize ) {
10087}
10188
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)
10390// FIXME #25759 This should also have `nocapture`
10491#[ no_mangle]
10592pub fn slice ( _: & [ u8 ] ) {
10693}
10794
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)
10996// FIXME #25759 This should also have `nocapture`
11097#[ no_mangle]
11198pub fn mutable_slice ( _: & mut [ u8 ] ) {
11299}
113100
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)
115102// unsafe interior means this isn't actually readonly and there may be aliases ...
116103#[ no_mangle]
117104pub fn unsafe_slice ( _: & [ UnsafeInner ] ) {
118105}
119106
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)
126108// FIXME #25759 This should also have `nocapture`
127109#[ no_mangle]
128110pub fn str ( _: & [ u8 ] ) {
129111}
130112
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)
132114// FIXME #25759 This should also have `nocapture`
133115#[ no_mangle]
134116pub fn trait_borrow ( _: & Drop ) {
135117}
136118
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)?}})
143120#[ no_mangle]
144121pub fn trait_box ( _: Box < Drop > ) {
145122}
146123
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)
148125#[ no_mangle]
149126pub fn trait_option ( x : Option < Box < Drop > > ) -> Option < Box < Drop > > {
150127 x
151128}
152129
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)
154131#[ no_mangle]
155132pub fn return_slice ( x : & [ u16 ] ) -> & [ u16 ] {
156133 x
@@ -162,7 +139,7 @@ pub fn enum_id_1(x: Option<Result<u16, u16>>) -> Option<Result<u16, u16>> {
162139 x
163140}
164141
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)
166143#[ no_mangle]
167144pub fn enum_id_2 ( x : Option < u8 > ) -> Option < u8 > {
168145 x
0 commit comments