From f8c3b30a62c09c71cef97c78f635b6d2772036cb Mon Sep 17 00:00:00 2001 From: Philip Craig Date: Thu, 3 Oct 2024 14:43:13 +1000 Subject: [PATCH] Add testoutput/dwarf/cold (#330) No functionality changes yet. --- testinput | 2 +- testoutput/dwarf/cold | 111 ++++++++++++++++++++++++++++++++++++++++++ tests/testinput.rs | 13 +++-- 3 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 testoutput/dwarf/cold diff --git a/testinput b/testinput index 76d453e..c51252f 160000 --- a/testinput +++ b/testinput @@ -1 +1 @@ -Subproject commit 76d453e88cdf8cdeecae9283c6b34a834c9977b8 +Subproject commit c51252fb9b550d8e1398886620a2ffb3dab2c24e diff --git a/testoutput/dwarf/cold b/testoutput/dwarf/cold new file mode 100644 index 0000000..8446f06 --- /dev/null +++ b/testoutput/dwarf/cold @@ -0,0 +1,111 @@ +0x0000000000001060 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:29 +0x0000000000001067 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:29 +0x000000000000106e +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:20 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:29 +0x0000000000001075 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:21 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:29 +0x0000000000001078 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:20 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:29 +0x000000000000107c +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:20 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:29 +0x0000000000001081 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:30 +0x0000000000001082 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:18 +0x0000000000001086 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:20 +0x0000000000001094 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:21 +0x0000000000001097 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:20 +0x000000000000109b +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:20 +0x00000000000010a0 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:22 +0x00000000000010b0 +main +/object/testfiles/dwarf/cold.cpp:32 +0x00000000000010ba +main +/object/testfiles/dwarf/cold.cpp:36 +0x00000000000010bf +main +/object/testfiles/dwarf/cold.cpp:32 +0x00000000000010c3 +main +/object/testfiles/dwarf/cold.cpp:35 +0x00000000000010e4 +main +/object/testfiles/dwarf/cold.cpp:36 +0x00000000000010f2 +main +/object/testfiles/dwarf/cold.cpp:37 +0x00000000000010f8 +main +/object/testfiles/dwarf/cold.cpp:38 +0x0000000000001102 +main +/object/testfiles/dwarf/cold.cpp:37 +0x0000000000001107 +main +/object/testfiles/dwarf/cold.cpp:40 +0x000000000000111f +main +/object/testfiles/dwarf/cold.cpp:40 +0x0000000000001122 +main +/object/testfiles/dwarf/cold.cpp:40 +0x0000000000001130 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:25 +0x0000000000001134 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:26 +0x000000000000113c +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:20 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:27 +0x0000000000001160 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:21 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:27 +0x0000000000001163 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:21 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:27 +0x0000000000001167 +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:21 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:27 +0x000000000000116b +_ZN3Foo3barEPKc +/object/testfiles/dwarf/cold.cpp:20 +_ZN3Foo3fooEi +/object/testfiles/dwarf/cold.cpp:27 diff --git a/tests/testinput.rs b/tests/testinput.rs index 122e029..6c33f5b 100644 --- a/tests/testinput.rs +++ b/tests/testinput.rs @@ -67,9 +67,16 @@ fn run_test(in_path: PathBuf, out_path: PathBuf) -> Result<(), Failed> { if out_data != expect_out_data { let out_str = String::from_utf8_lossy(&out_data); let expect_out_str = String::from_utf8_lossy(&expect_out_data); - return Err( - format!("output mismatch\nexpected:\n{expect_out_str}\nactual:\n{out_str}").into(), - ); + return Err(format!( + "\ + output mismatch\n\ + expected:\n\ + {expect_out_str}\n\ + actual:\n\ + {out_str}\n\ + Set ADDR2LINE_TESTOUTPUT_UPDATE=1 to update expected output" + ) + .into()); } Ok(())