]> git.proxmox.com Git - rustc.git/blobdiff - src/tools/rustfmt/tests/target/format_strings/issue-3263.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / rustfmt / tests / target / format_strings / issue-3263.rs
diff --git a/src/tools/rustfmt/tests/target/format_strings/issue-3263.rs b/src/tools/rustfmt/tests/target/format_strings/issue-3263.rs
new file mode 100644 (file)
index 0000000..72f7e9c
--- /dev/null
@@ -0,0 +1,26 @@
+// rustfmt-format_strings: true
+// rustfmt-newline_style: Windows
+
+#[test]
+fn compile_empty_program() {
+    let result = get_result();
+    let expected = "; ModuleID = \'foo\'
+
+; Function Attrs: nounwind
+declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #0
+
+declare i32 @write(i32, i8*, i32)
+
+declare i32 @putchar(i32)
+
+declare i32 @getchar()
+
+define i32 @main() {
+entry:
+  ret i32 0
+}
+
+attributes #0 = { nounwind }
+";
+    assert_eq!(result, CString::new(expected).unwrap());
+}