Skip to content

Commit

Permalink
[OMPT] Fix failing test cases for gcc on Ubuntu
Browse files Browse the repository at this point in the history
The compiler warns that _BSD_SOURCE is deprecated and _DEFAULT_SOURCE should
be used instead. We keep _BSD_SOURCE for older compilers, that don't know
about _DEFAULT_SOURCE.

The linker drops the tool when linking, since there is no visible need for
the library. So we need to tell the linker, that the tool should be linked
anyway.

Differential Revision: https://reviews.llvm.org/D41499

llvm-svn: 321362
  • Loading branch information
jprotze committed Dec 22, 2017
1 parent 25aa3ec commit 9c9b61d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions openmp/runtime/test/ompt/callback.h
@@ -1,4 +1,5 @@
#define _BSD_SOURCE
#define _DEFAULT_SOURCE
#include <stdio.h>
#include <inttypes.h>
#include <omp.h>
Expand Down
4 changes: 2 additions & 2 deletions openmp/runtime/test/ompt/loadtool/tool_available.c
Expand Up @@ -7,9 +7,9 @@
// RUN: %clang %flags -DTOOL -shared -fPIC %s -o %T/tool.so
// 2. "introducing a dynamically-linked library that includes the tool’s definition of ompt_start_tool into the application’s address space"
// 2.1 Link with tool during compilation
// RUN: %libomp-compile -DCODE %T/tool.so && %libomp-run | FileCheck %s
// RUN: %libomp-compile -DCODE -Wl,--no-as-needed %T/tool.so && %libomp-run | FileCheck %s
// 2.2 Link with tool during compilation, but AFTER the runtime
// RUN: %libomp-compile -DCODE -lomp %T/tool.so && %libomp-run | FileCheck %s
// RUN: %libomp-compile -DCODE -lomp -Wl,--no-as-needed %T/tool.so && %libomp-run | FileCheck %s
// 2.3 Inject tool via the dynamic loader
// RUN: %libomp-compile -DCODE && %preload-tool %libomp-run | FileCheck %s

Expand Down

0 comments on commit 9c9b61d

Please sign in to comment.