// { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "A\n" }
+// { dg-output "A\r*\n" }
#[rustc_builtin_macro]
macro_rules! cfg {
() => {{}};
fn print(s: &str) {
unsafe {
printf(
- "%s\n" as *const str as *const i8,
+ "%s\n\0" as *const str as *const i8,
s as *const str as *const i8,
);
}
fn main() -> i32 {
let cfg = cfg!(A);
if cfg {
- print("A");
+ print("A\0");
}
let cfg = cfg!(B);
if cfg {
- print("B");
+ print("B\0");
}
0
-// { dg-output "\ntest10btrue2.15\ntest10bfalse2.151\n" }
+// { dg-output "\r*\ntest10btrue2.15\r*\ntest10bfalse2.151\r*\n" }
#[rustc_builtin_macro]
macro_rules! concat {
() => {{}};
-// { dg-output "VALUE\nVALUE\n" }
+// { dg-output "VALUE\r*\nVALUE\r*\n" }
// { dg-set-compiler-env-var ENV_MACRO_TEST "VALUE" }
#[rustc_builtin_macro]
macro_rules! env {
-// { dg-output "104\n33\n1\n" }
+// { dg-output "104\r*\n33\r*\n1\r*\n" }
#[rustc_builtin_macro]
macro_rules! include_bytes {
() => {{}};
-// { dg-output "hello, include!\n" }
+// { dg-output "hello, include!\r*\n" }
#[rustc_builtin_macro]
macro_rules! include_str {
() => {{}};
-// { dg-output "18\n21\n" }
+// { dg-output "18\r*\n21\r*\n" }
extern "C" {
fn printf(fmt: *const i8, ...);
}
-// { dg-output "rust/execute/torture/builtin_macros1.rs" }
+// { dg-output "rust/execute/torture/builtin_macros1.rs\r*" }
#[rustc_builtin_macro]
macro_rules! file {
() => {{}};
-// { dg-output "14\n42\n" }
+// { dg-output "14\r*\n42\r*\n" }
#[rustc_builtin_macro]
macro_rules! column {
() => {{}};
print(c0);
- let c1 = column!();
+ let c1 = /* --------------------- */ column!();
print(c1);
0
}
-
// { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "test1\n" }
+// { dg-output "test1\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "test1\n" }
+// { dg-output "test1\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "test1\n" }
+// { dg-output "test1\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "test1\ntest2\n" }
+// { dg-output "test1\r*\ntest2\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "3\n" }
+// { dg-output "3\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "3\n" }
+// { dg-output "3\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123\n123\n" } */
+/* { dg-output "123\r*\n123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123\n123\n" } */
+/* { dg-output "123\r*\n123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w" }
-// { dg-output "12" }
+// { dg-output "12\r*" }
mod modules;
extern "C" {
-/* { dg-output "Hello World" }*/
+/* { dg-output "Hello World\r*" }*/
extern "C" {
fn puts(s: *const i8);
}
-/* { dg-output "Hello World 123\n" }*/
+/* { dg-output "Hello World 123\r*\n" }*/
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "foo_deref\nimm_deref\n123\n" } */
+/* { dg-output "foo_deref\r*\nimm_deref\r*\n123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w" }
-// { dg-output "outer\ninner\n" }
+// { dg-output "outer\r*\ninner\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w" }
-// { dg-output "slice_access=3\n" }
+// { dg-output "slice_access=3\r*\n" }
extern "rust-intrinsic" {
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
fn offset<T>(dst: *const T, offset: isize) -> *const T;
// { dg-options "-w" }
-// { dg-output "1\n2\n" }
+// { dg-output "1\r*\n2\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
// { dg-options "-w" }
-// { dg-output "" }
mod intrinsics {
extern "rust-intrinsic" {
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
-/* { dg-output "foo_deref\nimm_deref\n123\n" } */
+/* { dg-output "foo_deref\r*\nimm_deref\r*\n123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "Hello World 123\n" }*/
+/* { dg-output "Hello World 123\r*\n" }*/
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "Foo::bar\n" }
+// { dg-output "Foo::bar\r*\n" }
// { dg-additional-options "-w" }
extern "C" {
fn printf(s: *const i8, ...);
-/* { dg-output "Result: 123\n" } */
+/* { dg-output "Result: 123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "Result: 123\n" } */
+/* { dg-output "Result: 123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "hi" } */
+/* { dg-output "hi\r*" } */
fn main() -> i32 {
{
extern "C" {
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
pub fn test() -> u64 {
let mut n = 113383; // #20 in https://oeis.org/A006884
while n != 1 {
-// { dg-output "18\n" }
+// { dg-output "18\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "2" }
+// { dg-output "2\r*" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "0\n" }
+// { dg-output "0\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "18\n" }
+// { dg-output "18\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "15\n" }
+// { dg-output "15\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "arg\narg\narg\n" }
+// { dg-output "arg\r*\narg\r*\narg\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "1\n2\nNaN\n3\n" }
+// { dg-output "1\r*\n2\r*\nNaN\r*\n3\r*\n" }
macro_rules! print_num {
($l:literal) => {{
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
#[rustc_builtin_macro]
macro_rules! concat {
() => {{}};
-// { dg-output "invok\ninvok\ninvok\ninvok\ninvok\n" }
+// { dg-output "invok\r*\ninvok\r*\ninvok\r*\ninvok\r*\ninvok\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
#[rustc_builtin_macro]
macro_rules! concat {
() => {{}};
// { dg-additional-options "-w -frust-cfg=A" }
-// { dg-output "A\nB\n" }
+// { dg-output "A\r*\nB\r*\n" }
#[rustc_builtin_macro]
macro_rules! cfg {
() => {{}};
-// { dg-output "any\nany\nany\n" }
+// { dg-output "any\r*\nany\r*\nany\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "zo1\nzo1\n" }
+// { dg-output "zo1\r*\nzo1\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "oom\noom\noom\n" }
+// { dg-output "oom\r*\noom\r*\noom\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "Foo::A\nFoo::B\nFoo::C x\nFoo::D 20 80\n" }
+// { dg-output "Foo::A\r*\nFoo::B\r*\nFoo::C x\r*\nFoo::D 20 80\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "123\n80\n" }
+// { dg-output "123\r*\n80\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "Foo::A\nwildcard\nwildcard\nFoo::D 20 80\n" }
+// { dg-output "Foo::A\r*\nwildcard\r*\nwildcard\r*\nFoo::D 20 80\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "182 is more than 100\n55 is less than 100\n" }
+// { dg-output "182 is more than 100\r*\n55 is less than 100\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
-// { dg-output "a\nseven\nquote\nelse" }
+// { dg-output "a\r*\nseven\r*\nquote\r*\nelse" }
extern "C" {
fn printf(s: *const i8, ...);
-// { dg-output "amazing\nwildcard\ncompiler\nproductivity\n" }
+// { dg-output "amazing\r*\nwildcard\r*\ncompiler\r*\nproductivity\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
-// { dg-output "other!\nother!\nother!\nfifteen!\nfifteen!\nother!\nother!\nfifteen!\n" }
+// { dg-output "other!\r*\nother!\r*\nother!\r*\nfifteen!\r*\nfifteen!\r*\nother!\r*\nother!\r*\nfifteen!\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
-// { dg-output "E::One\nE::Two\nbreak!\n" }
+// { dg-output "E::One\r*\nE::Two\r*\nbreak!\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
-// { dg-output "zero to END_RANGE\nzero to END_RANGE\nelse\n" }
+// { dg-output "zero to END_RANGE\r*\nzero to END_RANGE\r*\nelse\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
-// { dg-output "lowercase\nuppercase\nother\n" }
+// { dg-output "lowercase\r*\nuppercase\r*\nother\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
-// { dg-output "x:15\ny:20\n" }
+// { dg-output "x:15\r*\ny:20\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
-/* { dg-output "124\n458" } */
+/* { dg-output "124\r*\n458" } */
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w" }
-// { dg-output "foo_deref\nimm_deref\n" }
+// { dg-output "foo_deref\r*\nimm_deref\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w" }
-// { dg-output "mut_deref\nfoobar: 123\n" }
+// { dg-output "mut_deref\r*\nfoobar: 123\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w" }
-// { dg-output "mut_deref\nfoobar: 123\n" }
+// { dg-output "mut_deref\r*\nfoobar: 123\r*\n" }
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "foo_deref\n123\n" } */
+/* { dg-output "foo_deref\r*\n123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
// { dg-additional-options "-w" }
extern "C" {
fn printf(s: *const i8, ...);
-// { dg-output "1\n" }
+// { dg-output "1\r*\n" }
// { dg-additional-options "-w" }
extern "C" {
fn printf(s: *const i8, ...);
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "3\n3\n" } */
+/* { dg-output "3\r*\n3\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "neg\n" } */
+/* { dg-output "neg\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "not\n" } */
+/* { dg-output "not\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "add_assign\n3\n" } */
+/* { dg-output "add_assign\r*\n3\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "imm_deref\n123\n" } */
+/* { dg-output "imm_deref\r*\n123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "imm_deref\n123\n" } */
+/* { dg-output "imm_deref\r*\n123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "mut_deref\n123\n" } */
+/* { dg-output "mut_deref\r*\n123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
// { dg-additional-options "-w" }
-// { dg-output "t1sz=5 t2sz=10" }
+// { dg-output "t1sz=5 t2sz=10\r*" }
mod mem {
extern "rust-intrinsic" {
#[rustc_const_stable(feature = "const_transmute", since = "1.46.0")]
-/* { dg-output "bar foo baz foobar\n" } */
-extern "C"
-{
- fn printf(s: *const i8, ...);
- fn memchr(s: *const i8, c: u8, n: usize) -> *const i8;
+/* { dg-output "bar foo baz foobar\r*\n" } */
+extern "C" {
+ fn printf(s: *const i8, ...);
+ fn memchr(s: *const i8, c: u8, n: usize) -> *const i8;
}
-pub fn main () -> i32
-{
- let f = "%s %s %s %s\n\0";
- let s = "bar\0\
+pub fn main() -> i32 {
+ let f = "%s %s %s %s\n\0";
+ let s = "bar\0\
foo\
\x00\
baz\u{0000}\
foobar\0";
- let cf = f as *const str as *const i8;
- let cs = s as *const str as *const i8;
- unsafe
- {
- let cs2 = memchr (cs, b'f', 5);
- let cs3 = memchr (cs2, b'b', 5);
- let cs4 = memchr (cs3, b'f', 5);
- printf (cf, cs, cs2, cs3, cs4);
+ let cf = f as *const str as *const i8;
+ let cs = s as *const str as *const i8;
+ unsafe {
+ let cs2 = memchr(cs, b'f', 5);
+ let cs3 = memchr(cs2, b'b', 5);
+ let cs4 = memchr(cs3, b'f', 5);
+ printf(cf, cs, cs2, cs3, cs4);
}
- 0
+ 0
}
-/* { dg-output "S::f\nT1::f\nT2::f\n" } */
+/* { dg-output "S::f\r*\nT1::f\r*\nT2::f\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123\n" } */
+/* { dg-output "123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123\n456\n" } */
+/* { dg-output "123\r*\n456\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "Bar::A = 456\n<Foo as Bar>::A = 456\n" } */
+/* { dg-output "Bar::A = 456\r*\n<Foo as Bar>::A = 456\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123, 777" } */
+/* { dg-output "123, 777\r*" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123\n" }*/
+/* { dg-output "123\r*\n" }*/
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123\n123\n" } */
+/* { dg-output "123\r*\n123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123\n" } */
+/* { dg-output "123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123\n" } */
+/* { dg-output "123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "123\n" } */
+/* { dg-output "123\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}
-/* { dg-output "3\n" } */
+/* { dg-output "3\r*\n" } */
extern "C" {
fn printf(s: *const i8, ...);
}