--- /dev/null
+// error-pattern:some control paths may return
+/* Make sure a loop{} with a break in it can't be
+ the tailexpr in the body of a diverging function */
+fn forever() -> ! {
+ loop {
+ break;
+ }
+ ret 42;
+}
+
+fn main() {
+ if (1 == 2) { forever(); }
+}
\ No newline at end of file
--- /dev/null
+/* Make sure a loop{} can be the tailexpr in the body
+of a diverging function */
+
+fn forever() -> ! {
+ loop{}
+}
+
+fn main() {
+ if (1 == 2) { forever(); }
+}
\ No newline at end of file