Skip to content

Commit ccb73bc

Browse files
tambryvinay-deshmukh
authored andcommitted
[NFCI][lldb][test] Enable GNU POSIX extensions where necessary (llvm#166768)
Otherwise these tests are reliant on the compiler defaulting to having the extensions on. Rest of LLVM's codebase doesn't seem to make such assumptions. Tested by building with `-std=c2y` in Clang's C frotend's config file.
1 parent 7547224 commit ccb73bc

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ ifeq "$(MAKE_DEBUG_NAMES)" "YES"
294294
CFLAGS += -gpubnames
295295
endif
296296

297+
# Enable GNU POSIX extensions (e.g. kill(), usleep(), getpgid(), ...)
298+
ifeq "$(OS)" "Linux"
299+
CFLAGS += -D_DEFAULT_SOURCE
300+
endif
301+
297302
ifeq "$(USE_PRIVATE_MODULE_CACHE)" "YES"
298303
THE_CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/private-module-cache
299304
else

lldb/test/Shell/Commands/Inputs/sigchld.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#if defined(__linux__)
2+
#define _XOPEN_SOURCE 500 /* for CLD_EXITED */
3+
#endif
4+
15
#include <assert.h>
26
#include <signal.h>
37
#include <stdio.h>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# RUN: %lldb %t.out -b -s %s 2>&1 | FileCheck %s
55

66
list
7-
# CHECK: note: No source available
7+
# CHECK: note: No source available
88

99
b main
1010
# CHECK: Breakpoint 1:
@@ -18,7 +18,7 @@ list
1818
list -
1919
# CHECK: int main()
2020

21-
list -10
21+
list -13
2222
# CHECK: #include <assert.h>
2323

2424
list -

0 commit comments

Comments
 (0)