diff --git a/src/test/shell/bazel/cc_integration_test.sh b/src/test/shell/bazel/cc_integration_test.sh index 038fe3ce939151..c6a7e7c27091e2 100755 --- a/src/test/shell/bazel/cc_integration_test.sh +++ b/src/test/shell/bazel/cc_integration_test.sh @@ -1752,4 +1752,27 @@ EOF bazel build //:main --repo_env=CC=clang || fail "Expected compiler flag to have value 'clang'" } +function test_clang_resource_dir_dependency() { + type -P clang || return 0 + + cat > BUILD.bazel <<'EOF' +cc_binary( + name = "lib", + srcs = ["lib.cc"], + copts = [ + "-fsanitize=address", + ], + linkshared = True, + linkstatic = True, +) +EOF + cat > lib.cc <<'EOF' +int lib() { + return 42; +} +EOF + + bazel build //:lib --repo_env=CC=clang || fail "Build should succeed" +} + run_suite "cc_integration_test"