anchor.diff:      $CXX -o cxx-check ${./cxx-main.cc}
       ./cxx-check
   
  -    ${stdenv.lib.optionalString (stdenv.isDarwin && stdenv.cc.isClang) ''
  +    ${optionalString (stdenv.isDarwin && stdenv.cc.isClang) ''
         printf "checking whether compiler can build with CoreFoundation.framework... " >&2
         mkdir -p foo/lib
         $CC -framework CoreFoundation -o core-foundation-check ${./core-foundation-main.c}
  
positive.code: { stdenv }:
  
  stdenv.mkDerivation {
    name = "cc-wrapper-test";
  
    buildCommand = ''
  
negative.code:     NIX_LDFLAGS="-L$NIX_BUILD_TOP/foo/lib -rpath $NIX_BUILD_TOP/foo/lib" $CC -lfoo -o ldflags-check ${./ldflags-main.c}
      ./ldflags-check
  
      ${optionalString (!sanitizersBroken) ''
        printf "checking whether sanitizers are fully functional... ">&2
        $CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c}
        ./sanitizers
      ''}
  
      touch $out
    '';
  
    meta.platforms = platforms.all;
  }
  