Skip to content

Commit b4dadb1

Browse files
committed
[lldb][test] Fix beginning/end of file test failed on Windows
1 parent 3954e9d commit b4dadb1

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include <stdio.h>
2+
void bubbleSort(int arr[], int n) {
3+
for (int i = 0; i < n - 1; i++) {
4+
int swapped = 0;
5+
for (int j = 0; j < n - i - 1; j++) {
6+
if (arr[j] > arr[j + 1]) {
7+
int temp = arr[j];
8+
arr[j] = arr[j + 1];
9+
arr[j + 1] = temp;
10+
swapped = 1;
11+
}
12+
}
13+
if (!swapped)
14+
break;
15+
}
16+
}
17+
18+
int main() {
19+
int arr[] = {64, 34, 25, 12, 22, 11, 90};
20+
int n = sizeof(arr) / sizeof(arr[0]);
21+
22+
for (int i = 0; i < n; i++)
23+
printf("%d ", arr[i]);
24+
printf("\n");
25+
26+
bubbleSort(arr, n);
27+
for (int i = 0; i < n; i++)
28+
printf("%d ", arr[i]);
29+
printf("\n");
30+
return 0;
31+
}
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Source uses unistd.h.
2-
# UNSUPPORTED: system-windows
3-
# RUN: %clang_host -g -O0 %S/Inputs/sigchld.c -o %t.out
1+
# RUN: %clang_host -g -O0 %S/Inputs/cross_platform.c -o %t.out
42
# RUN: %lldb %t.out -b -s %s 2>&1 | FileCheck %s
53

64
list
@@ -13,13 +11,13 @@ r
1311
# CHECK: int main()
1412

1513
list
16-
# CHECK: if (child_pid == 0)
14+
# CHECK: bubbleSort(arr, n);
1715

1816
list -
1917
# CHECK: int main()
2018

21-
list -10
22-
# CHECK: #include <assert.h>
19+
list -20
20+
# CHECK: #include <stdio.h>
2321

2422
list -
2523
# CHECK: note: Reached beginning of the file, no more to page
@@ -28,4 +26,4 @@ list -
2826
# CHECK: note: Reached beginning of the file, no more to page
2927

3028
list
31-
# CHECK: int main()
29+
# CHECK: bubbleSort(arr, n);

lldb/test/Shell/Commands/command-list-reach-end-of-file.test

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Source uses unistd.h.
2-
# UNSUPPORTED: system-windows
3-
# RUN: %clang_host -g -O0 %S/Inputs/sigchld.c -o %t.out
1+
# RUN: %clang_host -g -O0 %S/Inputs/cross_platform.c -o %t.out
42
# RUN: %lldb %t.out -b -s %s 2>&1 | FileCheck %s
53

64
list
@@ -13,10 +11,7 @@ r
1311
# CHECK: int main()
1412

1513
list
16-
# CHECK: if (child_pid == 0)
17-
18-
list
19-
# CHECK: printf("signo = %d\n", SIGCHLD);
14+
# CHECK: bubbleSort(arr, n);
2015

2116
list
2217
# CHECK: return 0;

0 commit comments

Comments
 (0)