https://github.com/hapeeeeee updated https://github.com/llvm/llvm-project/pull/139278
>From d1b295748d5bb4666140f37ec6896d8503239cf6 Mon Sep 17 00:00:00 2001 From: hapeeeeee <623151...@qq.com> Date: Fri, 9 May 2025 22:53:03 +0800 Subject: [PATCH] [lldb][test] Fix beginning/end of file test failed on Windows --- lldb/test/Shell/Commands/Inputs/cross_platform.c | 15 +++++++++++++++ .../command-list-reach-beginning-of-file.test | 14 +++----------- .../Commands/command-list-reach-end-of-file.test | 10 +--------- 3 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 lldb/test/Shell/Commands/Inputs/cross_platform.c diff --git a/lldb/test/Shell/Commands/Inputs/cross_platform.c b/lldb/test/Shell/Commands/Inputs/cross_platform.c new file mode 100644 index 0000000000000..9349a94e0257f --- /dev/null +++ b/lldb/test/Shell/Commands/Inputs/cross_platform.c @@ -0,0 +1,15 @@ +#include <stdio.h> +void doNothing() { printf("doNothing\n"); } + +void doSomethiing() { + doNothing(); + doNothing(); + doNothing(); +} + +int main() { + doSomethiing(); + doNothing(); + doSomethiing(); + return 0; +} diff --git a/lldb/test/Shell/Commands/command-list-reach-beginning-of-file.test b/lldb/test/Shell/Commands/command-list-reach-beginning-of-file.test index fa4a93e5904aa..daa3a94892d63 100644 --- a/lldb/test/Shell/Commands/command-list-reach-beginning-of-file.test +++ b/lldb/test/Shell/Commands/command-list-reach-beginning-of-file.test @@ -1,6 +1,4 @@ -# Source uses unistd.h. -# UNSUPPORTED: system-windows -# RUN: %clang_host -g -O0 %S/Inputs/sigchld.c -o %t.out +# RUN: %clang_host -g -O0 %S/Inputs/cross_platform.c -o %t.out # RUN: %lldb %t.out -b -s %s 2>&1 | FileCheck %s list @@ -12,14 +10,8 @@ b main r # CHECK: int main() -list -# CHECK: if (child_pid == 0) - list - -# CHECK: int main() - -list -10 -# CHECK: #include <assert.h> +# CHECK: #include <stdio.h> list - # CHECK: note: Reached beginning of the file, no more to page @@ -28,4 +20,4 @@ list - # CHECK: note: Reached beginning of the file, no more to page list -# CHECK: int main() +# CHECK: doNothing(); diff --git a/lldb/test/Shell/Commands/command-list-reach-end-of-file.test b/lldb/test/Shell/Commands/command-list-reach-end-of-file.test index edf4c521a9e76..3b6b144640921 100644 --- a/lldb/test/Shell/Commands/command-list-reach-end-of-file.test +++ b/lldb/test/Shell/Commands/command-list-reach-end-of-file.test @@ -1,6 +1,4 @@ -# Source uses unistd.h. -# UNSUPPORTED: system-windows -# RUN: %clang_host -g -O0 %S/Inputs/sigchld.c -o %t.out +# RUN: %clang_host -g -O0 %S/Inputs/cross_platform.c -o %t.out # RUN: %lldb %t.out -b -s %s 2>&1 | FileCheck %s list @@ -12,12 +10,6 @@ b main r # CHECK: int main() -list -# CHECK: if (child_pid == 0) - -list -# CHECK: printf("signo = %d\n", SIGCHLD); - list # CHECK: return 0; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits