From c73af83e23ef731e9144fcec42713060cd0e1630 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Tue, 4 Jul 2023 08:53:04 -0400 Subject: [PATCH] Attempt to fix line number differences in test traces --- test/expected/clang.txt | 48 ++++++++++++++++----------------- test/expected/gcc.txt | 48 ++++++++++++++++----------------- test/expected/windows_clang.txt | 44 +++++++++++++++--------------- test/expected/windows_msvc.txt | 44 +++++++++++++++--------------- test/test.cpp | 14 ++++++++++ 5 files changed, 106 insertions(+), 92 deletions(-) diff --git a/test/expected/clang.txt b/test/expected/clang.txt index 649cfb5..6126803 100644 --- a/test/expected/clang.txt +++ b/test/expected/clang.txt @@ -1,27 +1,27 @@ test/test.cpp||18||trace() -test/test.cpp||31||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||39||void foo(int, int) -test/test.cpp||39||void foo(int, int, int) -test/test.cpp||39||void foo(int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int, int, int, int, int) -test/test.cpp||43||function_two(int, float) -test/test.cpp||47||function_one(int) -test/test.cpp||51||main +test/test.cpp||34||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||46||void foo(int, int) +test/test.cpp||46||void foo(int, int, int) +test/test.cpp||46||void foo(int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int, int, int, int, int) +test/test.cpp||52||function_two(int, float) +test/test.cpp||58||function_one(int) +test/test.cpp||64||main ../csu/libc-start.c||308||__libc_start_main -||0|| +||0||_start ||0|| \ No newline at end of file diff --git a/test/expected/gcc.txt b/test/expected/gcc.txt index 649cfb5..6126803 100644 --- a/test/expected/gcc.txt +++ b/test/expected/gcc.txt @@ -1,27 +1,27 @@ test/test.cpp||18||trace() -test/test.cpp||31||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||33||foo(int) -test/test.cpp||39||void foo(int, int) -test/test.cpp||39||void foo(int, int, int) -test/test.cpp||39||void foo(int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int, int, int, int) -test/test.cpp||39||void foo(int, int, int, int, int, int, int, int, int, int) -test/test.cpp||43||function_two(int, float) -test/test.cpp||47||function_one(int) -test/test.cpp||51||main +test/test.cpp||34||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||38||foo(int) +test/test.cpp||46||void foo(int, int) +test/test.cpp||46||void foo(int, int, int) +test/test.cpp||46||void foo(int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int, int, int, int) +test/test.cpp||46||void foo(int, int, int, int, int, int, int, int, int, int) +test/test.cpp||52||function_two(int, float) +test/test.cpp||58||function_one(int) +test/test.cpp||64||main ../csu/libc-start.c||308||__libc_start_main -||0|| +||0||_start ||0|| \ No newline at end of file diff --git a/test/expected/windows_clang.txt b/test/expected/windows_clang.txt index 4f2bcf0..bf338e0 100644 --- a/test/expected/windows_clang.txt +++ b/test/expected/windows_clang.txt @@ -1,27 +1,27 @@ test\test.cpp||18||trace() -test\test.cpp||32||foo(int) test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||40||foo(int, int) -test\test.cpp||40||foo(int, int, int) -test\test.cpp||40||foo(int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int, int, int, int, int) -test\test.cpp||44||function_two(int, float) -test\test.cpp||48||function_one(int) -test\test.cpp||52||main() +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||47||foo(int, int) +test\test.cpp||47||foo(int, int, int) +test\test.cpp||47||foo(int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int, int, int, int, int) +test\test.cpp||53||function_two(int, float) +test\test.cpp||59||function_one(int) +test\test.cpp||65||main() D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl||79||invoke_main() D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl||288||__scrt_common_main_seh() D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl||331||__scrt_common_main() diff --git a/test/expected/windows_msvc.txt b/test/expected/windows_msvc.txt index 4f2bcf0..bf338e0 100644 --- a/test/expected/windows_msvc.txt +++ b/test/expected/windows_msvc.txt @@ -1,27 +1,27 @@ test\test.cpp||18||trace() -test\test.cpp||32||foo(int) test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||35||foo(int) -test\test.cpp||40||foo(int, int) -test\test.cpp||40||foo(int, int, int) -test\test.cpp||40||foo(int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int, int, int, int) -test\test.cpp||40||foo(int, int, int, int, int, int, int, int, int, int) -test\test.cpp||44||function_two(int, float) -test\test.cpp||48||function_one(int) -test\test.cpp||52||main() +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||39||foo(int) +test\test.cpp||47||foo(int, int) +test\test.cpp||47||foo(int, int, int) +test\test.cpp||47||foo(int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int, int, int, int) +test\test.cpp||47||foo(int, int, int, int, int, int, int, int, int, int) +test\test.cpp||53||function_two(int, float) +test\test.cpp||59||function_one(int) +test\test.cpp||65||main() D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl||79||invoke_main() D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl||288||__scrt_common_main_seh() D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl||331||__scrt_common_main() diff --git a/test/test.cpp b/test/test.cpp index 889b029..0f4ea76 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -26,27 +26,41 @@ void trace() { } } +int x; + void foo(int n) { if(n == 0) { + x = 0; trace(); + x = 0; } else { + x = 0; foo(n - 1); + x = 0; } } template void foo(int x, Args... args) { + x = 0; foo(args...); + x = 0; } void function_two(int, float) { + x = 0; foo(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + x = 0; } void function_one(int) { + x = 0; function_two(0, 0); + x = 0; } int main() { + x = 0; function_one(0); + x = 0; }