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 @@ -110,6 +110,23 @@ fn test_stable_mir(tcx: TyCtxt<'_>) -> ControlFlow<()> {
110110 other => panic ! ( "{other:?}" ) ,
111111 }
112112
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+
113130 ControlFlow :: Continue ( ( ) )
114131}
115132
@@ -147,6 +164,16 @@ fn generate_input(path: &str) -> std::io::Result<()> {
147164 write ! (
148165 file,
149166 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+
150177 mod foo {{
151178 pub fn bar(i: i32) -> i64 {{
152179 i as i64
You can’t perform that action at this time.
0 commit comments