Skip to content

Commit 00552cf

Browse files
Ailin Nemuidcbaker
authored andcommitted
tests: Test extern'd globals on MacOS with the Apple Archiver
This is a regression test for: #11165. The test was initially merged as part of: #10628, but had to be reverted. A second attempt at fixing the root cause also had to be reverted: #10699. A 3rd attempt got merged but missed this unit test: #11742. Co-authored-by: Dylan Baker <[email protected]>
1 parent 8369dbb commit 00552cf

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Source: https://lists.gnu.org/archive/html/libtool/2002-07/msg00025.html
2+
3+
#include <stdio.h>
4+
5+
extern int l2;
6+
void l1(void)
7+
{
8+
printf("l1 %d\n", l2);
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Source: https://lists.gnu.org/archive/html/libtool/2002-07/msg00025.html
2+
3+
int l2;
4+
void l2_func(void)
5+
{
6+
l2 = 77;
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Source: https://lists.gnu.org/archive/html/libtool/2002-07/msg00025.html
2+
3+
project('global variable test', 'c')
4+
5+
lib = static_library('mylib', 'libfile.c', 'libfile2.c')
6+
test('global variable', executable('prog', 'prog.c', link_with: lib))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[binaries]
2+
ar = 'ar'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Source: https://lists.gnu.org/archive/html/libtool/2002-07/msg00025.html
2+
3+
extern void l1(void);
4+
int main(void)
5+
{
6+
l1();
7+
}

0 commit comments

Comments
 (0)