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