@@ -2000,6 +2000,63 @@ public void testImplementationDepsLinkingContextIsPropagated() throws Exception
20002000 .contains ("bin foo/libimplementation_dep.a" );
20012001 }
20022002
2003+ @ Test
2004+ public void testImplementationDepsDebugContextIsPropagated () throws Exception {
2005+ useConfiguration (
2006+ "--experimental_cc_implementation_deps" ,
2007+ "--fission=yes" ,
2008+ "--features=per_object_debug_info" );
2009+ scratch .file (
2010+ "foo/BUILD" ,
2011+ "cc_binary(" ,
2012+ " name = 'bin'," ,
2013+ " srcs = ['bin.cc']," ,
2014+ " deps = ['lib']," ,
2015+ ")" ,
2016+ "cc_library(" ,
2017+ " name = 'lib'," ,
2018+ " srcs = ['lib.cc']," ,
2019+ " deps = ['public_dep']," ,
2020+ ")" ,
2021+ "cc_library(" ,
2022+ " name = 'public_dep'," ,
2023+ " srcs = ['public_dep.cc']," ,
2024+ " hdrs = ['public_dep.h']," ,
2025+ " implementation_deps = ['implementation_dep']," ,
2026+ " deps = ['interface_dep']," ,
2027+ ")" ,
2028+ "cc_library(" ,
2029+ " name = 'interface_dep'," ,
2030+ " srcs = ['interface_dep.cc']," ,
2031+ " hdrs = ['interface_dep.h']," ,
2032+ ")" ,
2033+ "cc_library(" ,
2034+ " name = 'implementation_dep'," ,
2035+ " srcs = ['implementation_dep.cc']," ,
2036+ " hdrs = ['implementation_dep.h']," ,
2037+ ")" );
2038+
2039+ ConfiguredTarget lib = getConfiguredTarget ("//foo:lib" );
2040+ assertThat (
2041+ lib
2042+ .get (CcInfo .PROVIDER )
2043+ .getCcDebugInfoContext ()
2044+ .getTransitiveDwoFiles ()
2045+ .toList ()
2046+ .stream ()
2047+ .map (Artifact ::getFilename ))
2048+ .contains ("public_dep.dwo" );
2049+ assertThat (
2050+ lib
2051+ .get (CcInfo .PROVIDER )
2052+ .getCcDebugInfoContext ()
2053+ .getTransitiveDwoFiles ()
2054+ .toList ()
2055+ .stream ()
2056+ .map (Artifact ::getFilename ))
2057+ .contains ("implementation_dep.dwo" );
2058+ }
2059+
20032060 @ Test
20042061 public void testImplementationDepsRunfilesArePropagated () throws Exception {
20052062 useConfiguration ("--experimental_cc_implementation_deps" );
0 commit comments