Skip to content

Commit

Permalink
Adapt some compiler tests to OpenBSD pecularities
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Mar 2, 2024
1 parent ea90c4a commit dd8d59e
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions compiler/test/compilable/stdcheaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ float x = NAN;
#ifndef __DMC__
#ifndef __linux__
#ifndef __APPLE__
#ifndef __OpenBSD__
#ifndef _MSC_VER
#include <threads.h>
#endif
#endif
#endif
#endif
#endif

#include <time.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source tools/common_funcs.sh
# strip out Dmain since it's symbol differs between windows and non-windows
# strip out _d_arraycatnTX and _d_arraysetlengthT since they are part of the
# lowering of the array concatenation operator
grep -v 'Dmain\|_d_arraycatnTX\|_d_arraysetlengthT' ${OUTPUT_BASE}.d.trace.def > ${OUTPUT_BASE}.d.trace.def2
grep -Ev 'Dmain|_d_arraycatnTX|_d_arraysetlengthT' ${OUTPUT_BASE}.d.trace.def > ${OUTPUT_BASE}.d.trace.def2

diff -up --strip-trailing-cr ${EXTRA_FILES}/${TEST_NAME}.d.trace.def ${OUTPUT_BASE}.d.trace.def2

Expand Down
1 change: 1 addition & 0 deletions compiler/test/runnable/test12.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// PERMUTE_ARGS: -unittest -O -release -inline -fPIC -g
// TRANSFORM_OUTPUT: remove_lines("warning: sprintf\(\) is often misused")

extern(C) int printf(const char*, ...);
extern(C) int sprintf(char*, const char*, ...);
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable/test17559.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRED_ARGS: -g
// REQUIRED_ARGS(linux freebsd dragonflybsd): -L-export-dynamic
// REQUIRED_ARGS(linux freebsd openbsd dragonflybsd): -L-export-dynamic
// PERMUTE_ARGS:
// DISABLED: osx

Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable/test19086.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRED_ARGS: -g
// REQUIRED_ARGS(linux freebsd dragonflybsd): -L-export-dynamic
// REQUIRED_ARGS(linux freebsd openbsd dragonflybsd): -L-export-dynamic
// PERMUTE_ARGS:
// DISABLED: osx

Expand Down
1 change: 1 addition & 0 deletions compiler/test/runnable/test22597.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// https://issues.dlang.org/show_bug.cgi?id=22597
// TRANSFORM_OUTPUT: remove_lines("warning: vsprintf\(\) is often misused")

typedef __builtin_va_list va_list;
int vsprintf(char *s, const char *format, va_list va);
Expand Down
1 change: 1 addition & 0 deletions compiler/test/runnable/testthread2.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// PERMUTE_ARGS:
// TRANSFORM_OUTPUT: remove_lines("warning: rand\(\) may return deterministic values")

// Quick, dirty and inefficient AA using linear search, useful for testing.
struct LinearAA(K, V) {
Expand Down
2 changes: 2 additions & 0 deletions compiler/test/runnable/variadic.d
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TRANSFORM_OUTPUT: remove_lines("warning: vsprintf\(\) is often misused")

alias TypeTuple(T...) = T;

class A { }
Expand Down
1 change: 1 addition & 0 deletions compiler/test/runnable/whetstone.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
PERMUTE_ARGS: -O
TRANSFORM_OUTPUT: remove_lines("warning: sprintf\(\) is often misused")
*/

/*
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/runnable_cxx/cpp_abi_tests.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// EXTRA_CPP_SOURCES: cpp_abi_tests.cpp
// CXXFLAGS(linux freebsd osx netbsd dragonflybsd): -std=c++11
// CXXFLAGS(linux freebsd osx openbsd netbsd dragonflybsd): -std=c++11

// N.B MSVC doesn't have a C++11 switch, but it defaults to the latest fully-supported standard
// N.B MSVC 2013 doesn't support char16_t/char32_t
Expand Down
3 changes: 2 additions & 1 deletion compiler/test/runnable_cxx/cppa.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// PERMUTE_ARGS: -g
// EXTRA_CPP_SOURCES: cppb.cpp
// EXTRA_FILES: extra-files/cppb.h
// CXXFLAGS(linux freebsd osx netbsd dragonflybsd): -std=c++11
// CXXFLAGS(linux freebsd osx openbsd netbsd dragonflybsd): -std=c++11
// druntime isn't linked, this prevents missing symbols '_d_arraybounds_slicep':
// REQUIRED_ARGS: -checkaction=C
// TRANSFORM_OUTPUT: remove_lines("warning: vsprintf\(\) is often misused")

// N.B MSVC doesn't have a C++11 switch, but it defaults to the latest fully-supported standard

Expand Down

0 comments on commit dd8d59e

Please sign in to comment.