Skip to content

Commit 10d4cfc

Browse files
committed
Added tests for issue #51
The linker is expected to issue a warning when the duplicate shared object names are used in linking. This commit adds testcase to re-produce the issue (no warning). Signed-off-by: Pitchumani Sivanupandi <[email protected]>
1 parent 3eb164f commit 10d4cfc

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#---DuplicateSOName.test------------------------ SharedLibrary -----------------#
2+
#BIGIN_COMMENT
3+
# Test that linker issues a warning for duplicate shared object names.
4+
#END_COMMENT
5+
#START_TEST
6+
RUN: %clang -c %p/Inputs/1.c -ffunction-sections -shared -o %t1.o
7+
RUN: %clang -c %p/Inputs/2.c -ffunction-sections -shared -o %t2.o
8+
RUN: %link -shared -soname=foo -o %libt1.so %t1.o
9+
RUN: %link -shared -soname=foo -o %libt2.so %t2.o
10+
RUN: %link -o %t.out %libt1.so %libt2.so
11+
#END_TEST
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
int foo() {
2+
return 1;
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
int bar() {
2+
return 3;
3+
}

0 commit comments

Comments
 (0)