Add asan test for clangOmpss2

This commit is contained in:
Rodrigo Arias 2023-09-01 16:43:49 +02:00
parent 18d64c352c
commit fd5fb5c055
2 changed files with 37 additions and 0 deletions

View File

@ -359,6 +359,7 @@ let
compilers.hello-cpp = callPackage ./test/compilers/hello-cpp.nix { }; compilers.hello-cpp = callPackage ./test/compilers/hello-cpp.nix { };
compilers.hello-f = callPackage ./test/compilers/hello-f.nix { }; compilers.hello-f = callPackage ./test/compilers/hello-f.nix { };
compilers.lto = callPackage ./test/compilers/lto.nix { }; compilers.lto = callPackage ./test/compilers/lto.nix { };
compilers.asan = callPackage ./test/compilers/asan.nix { };
compilers.intel2023.icx.c = compilers.hello-c.override { compilers.intel2023.icx.c = compilers.hello-c.override {
stdenv = bsc.intel2023.stdenv; stdenv = bsc.intel2023.stdenv;
}; };
@ -377,6 +378,9 @@ let
compilers.clangOmpss2.lto = compilers.lto.override { compilers.clangOmpss2.lto = compilers.lto.override {
stdenv = bsc.stdenvClangOmpss2; stdenv = bsc.stdenvClangOmpss2;
}; };
compilers.clangOmpss2.asan = compilers.asan.override {
stdenv = bsc.stdenvClangOmpss2;
};
compilers.clangOmpss2.task = callPackage ./test/compilers/ompss2.nix { compilers.clangOmpss2.task = callPackage ./test/compilers/ompss2.nix {
stdenv = bsc.stdenvClangOmpss2; stdenv = bsc.stdenvClangOmpss2;
}; };
@ -393,6 +397,7 @@ let
compilers.intel2023.ifort compilers.intel2023.ifort
compilers.clangOmpss2.lto compilers.clangOmpss2.lto
compilers.clangOmpss2.task compilers.clangOmpss2.task
compilers.clangOmpss2.asan
compilers.clangNodes.task compilers.clangNodes.task
]; ];

32
test/compilers/asan.nix Normal file
View File

@ -0,0 +1,32 @@
{ stdenv, writeText, which, strace }:
let
hello_c = writeText "hello.c" ''
#include <stdio.h>
int main()
{
printf("Hello world!\n");
return 0;
}
'';
in
stdenv.mkDerivation rec {
version = "0.0.1";
name = "asan-c";
buildInputs = [ stdenv which strace ];
src = hello_c;
dontUnpack = true;
dontConfigure = true;
NIX_DEBUG = 0;
buildPhase = ''
cp ${hello_c} hello.c
$CC -v -fsanitize=address hello.c -o hello
./hello
'';
installPhase = ''
touch $out
'';
}