-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C++: Tests for cc_binary linking shared libraries
This is guarded behind the --experimental_cc_shared_library flag PiperOrigin-RevId: 283982821 Change-Id: Ifec330c01d7b480b641f8432ce94175291e79238
- Loading branch information
1 parent
01d4a48
commit cd7e8a6
Showing
18 changed files
with
104 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
#include "examples/test_cc_shared_library/bar2.h" | ||
|
||
int bar2() { return 42; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef EXAMPLES_TEST_CC_SHARED_LIBRARY_BAR_2_H_ | ||
#define EXAMPLES_TEST_CC_SHARED_LIBRARY_BAR_2_H_ | ||
|
||
int bar2(); | ||
|
||
#endif // EXAMPLES_TEST_CC_SHARED_LIBRARY_BAR_2_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
#include "examples/test_cc_shared_library/bar3.h" | ||
|
||
int bar3() { return 42; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef EXAMPLES_TEST_CC_SHARED_LIBRARY_BAR_3_H_ | ||
#define EXAMPLES_TEST_CC_SHARED_LIBRARY_BAR_3_H_ | ||
|
||
int bar3(); | ||
|
||
#endif // EXAMPLES_TEST_CC_SHARED_LIBRARY_BAR_3_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
#include "examples/test_cc_shared_library/bar4.h" | ||
|
||
int bar4() { return 42; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef EXAMPLES_TEST_CC_SHARED_LIBRARY_BAR_4_H_ | ||
#define EXAMPLES_TEST_CC_SHARED_LIBRARY_BAR_4_H_ | ||
|
||
int bar4(); | ||
|
||
#endif // EXAMPLES_TEST_CC_SHARED_LIBRARY_BAR_4_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
#include "examples/test_cc_shared_library/baz.h" | ||
|
||
int baz() { return 42; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef EXAMPLES_TEST_CC_SHARED_LIBRARY_BAZ_H_ | ||
#define EXAMPLES_TEST_CC_SHARED_LIBRARY_BAZ_H_ | ||
|
||
int baz(); | ||
|
||
#endif // EXAMPLES_TEST_CC_SHARED_LIBRARY_BAZ_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#include "examples/test_cc_shared_library/bar.h" | ||
#include "examples/test_cc_shared_library/baz.h" | ||
#include "examples/test_cc_shared_library/preloaded_dep.h" | ||
#include "examples/test_cc_shared_library/qux.h" | ||
|
||
int foo() { | ||
bar(); | ||
baz(); | ||
qux(); | ||
preloaded_dep(); | ||
return 42; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef EXAMPLES_TEST_CC_SHARED_LIBRARY_FOO_H_ | ||
#define EXAMPLES_TEST_CC_SHARED_LIBRARY_FOO_H_ | ||
|
||
int foo(); | ||
|
||
#endif // EXAMPLES_TEST_CC_SHARED_LIBRARY_FOO_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <iostream> | ||
|
||
#include "examples/test_cc_shared_library/foo.h" | ||
|
||
int main() { | ||
std::cout << "hello " << foo() << std::endl; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "examples/test_cc_shared_library/preloaded_dep.h" | ||
|
||
int preloaded_dep() { return 42; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef EXAMPLES_TEST_CC_SHARED_LIBRARY_PRELOADED_DEP_H_ | ||
#define EXAMPLES_TEST_CC_SHARED_LIBRARY_PRELOADED_DEP_H_ | ||
|
||
int preloaded_dep(); | ||
|
||
#endif // EXAMPLES_TEST_CC_SHARED_LIBRARY_PRELOADED_DEP_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
#include "examples/test_cc_shared_library/qux.h" | ||
|
||
int qux() { return 42; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef EXAMPLES_TEST_CC_SHARED_LIBRARY_QUX_H_ | ||
#define EXAMPLES_TEST_CC_SHARED_LIBRARY_QUX_H_ | ||
|
||
int qux(); | ||
|
||
#endif // EXAMPLES_TEST_CC_SHARED_LIBRARY_QUX_H_ |