Skip to content

Commit a26095f

Browse files
delcypherrjmansfield
authored andcommitted
[BoundsSafety][LLDB] Try to Fix bounds_safety_soft_trap*_missing_reason tests on Linux
The tests were failing with: ``` /home/build-user/llvm-project/lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c:5:32: error: a parameter list without types is only allowed in a function definition 5 | int bad_call(int *__counted_by(count) ptr, int count) {} | ^ /home/build-user/llvm-project/lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c:5:39: error: expected ')' 5 | int bad_call(int *__counted_by(count) ptr, int count) {} | ^ /home/build-user/llvm-project/lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c:5:13: note: to match this '(' 5 | int bad_call(int *__counted_by(count) ptr, int count) {} | ^ 2 errors generated. ``` This is happening because `__counted_by` is a macro but the `ptrcheck.h` header that defines it is not included. This wasn't caught on macOS because the Libc headers on that platform automatically include that header. I don't have a Linux VM to hand so this is a speculative fix that should fix the include issue. rdar://165202129
1 parent 13cab7c commit a26095f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lldb/test/Shell/BoundsSafety/Inputs/boundsSafetySoftTrapsMissingReason.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <stdio.h>
22
#include <stdlib.h>
33
#include <string.h>
4+
#include <ptrcheck.h>
45

56
int bad_call(int *__counted_by(count) ptr, int count) {}
67

lldb/test/Shell/BoundsSafety/boundssafety_soft_trap_call_minimal_missing_reason.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ run
2020
bt
2121
# CHECK: frame #{{.*}}`__bounds_safety_soft_trap{{$}}
2222
# CHECK-NEXT: frame #{{.*}}`__clang_trap_msg$Bounds check failed$
23-
# CHECK-NEXT: * frame #{{.*}}`main({{.+}}) at boundsSafetySoftTrapsMissingReason.c:16
23+
# CHECK-NEXT: * frame #{{.*}}`main({{.+}}) at boundsSafetySoftTrapsMissingReason.c:17
2424

2525
# Resume execution
2626
c

lldb/test/Shell/BoundsSafety/boundssafety_soft_trap_call_with_str_missing_reason.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ run
2020
bt
2121
# CHECK: frame #{{.*}}`__bounds_safety_soft_trap_s{{$}}
2222
# CHECK-NEXT: frame #{{.*}}`__clang_trap_msg$Bounds check failed$
23-
# CHECK-NEXT: * frame #{{.*}}`main({{.+}}) at boundsSafetySoftTrapsMissingReason.c:16
23+
# CHECK-NEXT: * frame #{{.*}}`main({{.+}}) at boundsSafetySoftTrapsMissingReason.c:17
2424

2525
# Resume execution
2626
c

0 commit comments

Comments
 (0)