forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb] Fix TestModuleLoadedNotifys API test to work correctly on most…
… of Linux targets (llvm#94672) The different build configuration and target Linux system can load a different number of .so libraries. Add and check own libraries.
- Loading branch information
Showing
7 changed files
with
84 additions
and
18 deletions.
There are no files selected for viewing
26 changes: 23 additions & 3 deletions
26
lldb/test/API/functionalities/target-new-solib-notifications/Makefile
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,3 +1,23 @@ | ||
CXX_SOURCES := main.cpp | ||
|
||
include Makefile.rules | ||
CXX_SOURCES := main.cpp | ||
LD_EXTRAS := -L. -l_d -l_c -l_a -l_b | ||
|
||
a.out: lib_b lib_a lib_c lib_d | ||
|
||
include Makefile.rules | ||
|
||
lib_a: lib_b | ||
$(MAKE) -f $(MAKEFILE_RULES) \ | ||
DYLIB_ONLY=YES DYLIB_CXX_SOURCES=a.cpp DYLIB_NAME=_a \ | ||
LD_EXTRAS="-L. -l_b" | ||
|
||
lib_b: | ||
$(MAKE) -f $(MAKEFILE_RULES) \ | ||
DYLIB_ONLY=YES DYLIB_CXX_SOURCES=b.cpp DYLIB_NAME=_b | ||
|
||
lib_c: | ||
$(MAKE) -f $(MAKEFILE_RULES) \ | ||
DYLIB_ONLY=YES DYLIB_CXX_SOURCES=c.cpp DYLIB_NAME=_c | ||
|
||
lib_d: | ||
$(MAKE) -f $(MAKEFILE_RULES) \ | ||
DYLIB_ONLY=YES DYLIB_CXX_SOURCES=d.cpp DYLIB_NAME=_d |
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
3 changes: 3 additions & 0 deletions
3
lldb/test/API/functionalities/target-new-solib-notifications/a.cpp
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 @@ | ||
extern "C" int b_function(); | ||
|
||
extern "C" int a_function() { return b_function(); } |
1 change: 1 addition & 0 deletions
1
lldb/test/API/functionalities/target-new-solib-notifications/b.cpp
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 @@ | ||
extern "C" int b_function() { return 500; } |
1 change: 1 addition & 0 deletions
1
lldb/test/API/functionalities/target-new-solib-notifications/c.cpp
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 @@ | ||
extern "C" int c_function() { return 600; } |
1 change: 1 addition & 0 deletions
1
lldb/test/API/functionalities/target-new-solib-notifications/d.cpp
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 @@ | ||
extern "C" int d_function() { return 700; } |
22 changes: 16 additions & 6 deletions
22
lldb/test/API/functionalities/target-new-solib-notifications/main.cpp
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,16 @@ | ||
#include <stdio.h> | ||
int main () | ||
{ | ||
puts("running"); // breakpoint here | ||
return 0; | ||
} | ||
#include <stdio.h> | ||
|
||
extern "C" int a_function(); | ||
extern "C" int c_function(); | ||
extern "C" int b_function(); | ||
extern "C" int d_function(); | ||
|
||
int main() { | ||
a_function(); | ||
b_function(); | ||
c_function(); | ||
d_function(); | ||
|
||
puts("running"); // breakpoint here | ||
return 0; | ||
} |