tests.cc-wrapper: verify building with sanitizers
This commit is contained in:
committed by
John Ericson
parent
16da44b5c1
commit
46eeef1898
@@ -38,6 +38,11 @@ stdenv.mkDerivation {
|
||||
|
||||
NIX_LDFLAGS="-L$NIX_BUILD_TOP/foo/lib -rpath $NIX_BUILD_TOP/foo/lib" $CC -lfoo -o ldflags-check ${./ldflags-main.c}
|
||||
./ldflags-check
|
||||
'' + stdenv.lib.optionalString (stdenv.cc.isCompilerRT or false) ''
|
||||
|
||||
$CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c}
|
||||
./sanitizers
|
||||
'' + ''
|
||||
|
||||
touch $out
|
||||
'';
|
||||
|
||||
8
pkgs/test/cc-wrapper/sanitizers.c
Normal file
8
pkgs/test/cc-wrapper/sanitizers.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <sanitizer/asan_interface.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
fprintf(stderr, "ok\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user