File tree 1 file changed +27
-0
lines changed
tests/ui-fulldeps/stable-mir 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,23 @@ fn test_stable_mir(tcx: TyCtxt<'_>) -> ControlFlow<()> {
110
110
other => panic ! ( "{other:?}" ) ,
111
111
}
112
112
113
+ let monomorphic = get_item ( tcx, & items, ( DefKind :: Fn , "monomorphic" ) ) . unwrap ( ) ;
114
+ for block in monomorphic. body ( ) . blocks {
115
+ match & block. terminator {
116
+ stable_mir:: mir:: Terminator :: Call { func, .. } => match func {
117
+ stable_mir:: mir:: Operand :: Constant ( c) => match & c. literal {
118
+ stable_mir:: ty:: ConstantKind :: Allocated ( alloc) => {
119
+ assert ! ( alloc. bytes. is_empty( ) )
120
+ }
121
+ other => panic ! ( "{other:?}" ) ,
122
+ } ,
123
+ other => panic ! ( "{other:?}" ) ,
124
+ } ,
125
+ stable_mir:: mir:: Terminator :: Return => { }
126
+ other => panic ! ( "{other:?}" ) ,
127
+ }
128
+ }
129
+
113
130
ControlFlow :: Continue ( ( ) )
114
131
}
115
132
@@ -147,6 +164,16 @@ fn generate_input(path: &str) -> std::io::Result<()> {
147
164
write ! (
148
165
file,
149
166
r#"
167
+ fn generic<T, const U: usize>(t: T) -> [(); U] {{
168
+ _ = t;
169
+ [(); U]
170
+ }}
171
+
172
+ pub fn monomorphic() {{
173
+ generic::<(), 5>(());
174
+ generic::<u32, 0>(45);
175
+ }}
176
+
150
177
mod foo {{
151
178
pub fn bar(i: i32) -> i64 {{
152
179
i as i64
You can’t perform that action at this time.
0 commit comments