Skip to content

Commit 365c159

Browse files
committed
Add comments to the intrinsic-unreachable test programs.
The return value in these tests is just being used to generate extra code so that it can be detected in the test script, which is just counting lines in the assembly output.
1 parent 626d93b commit 365c159

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/test/run-make/intrinsic-unreachable/exit-ret.rs

+3
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ pub fn exit(n: usize) -> i32 {
1818
asm!("" :: "r"(n) :: "volatile");
1919
// Can't actually reach this point, but rustc doesn't know that.
2020
}
21+
// This return value is just here to generate some extra code for a return
22+
// value, making it easier for the test script to detect whether the
23+
// compiler deleted it.
2124
42
2225
}

src/test/run-make/intrinsic-unreachable/exit-unreachable.rs

+3
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ pub fn exit(n: usize) -> i32 {
2020
asm!("" :: "r"(n) :: "volatile");
2121
intrinsics::unreachable()
2222
}
23+
// This return value is just here to generate some extra code for a return
24+
// value, making it easier for the test script to detect whether the
25+
// compiler deleted it.
2326
42
2427
}

0 commit comments

Comments
 (0)