Test extracting static objects into a shared library

This was previously broken and we didn't know it. See #1169
pull/1171/head
Nirbheek Chauhan 8 years ago
parent 038b15a7b2
commit 3fad3cbb81
  1. 6
      test cases/common/128 extract all shared library/extractor.h
  2. 5
      test cases/common/128 extract all shared library/four.c
  3. 5
      test cases/common/128 extract all shared library/func1234.def
  4. 10
      test cases/common/128 extract all shared library/meson.build
  5. 5
      test cases/common/128 extract all shared library/one.c
  6. 10
      test cases/common/128 extract all shared library/prog.c
  7. 5
      test cases/common/128 extract all shared library/three.c
  8. 5
      test cases/common/128 extract all shared library/two.c

@ -0,0 +1,6 @@
#pragma once
int func1();
int func2();
int func3();
int func4();

@ -0,0 +1,5 @@
#include"extractor.h"
int func4() {
return 4;
}

@ -0,0 +1,10 @@
project('extract all', 'c', 'cpp')
a = static_library('a', 'one.c', 'two.c')
b = static_library('b', 'three.c', 'four.c')
c = shared_library('c',
objects : [a.extract_all_objects(), b.extract_all_objects()],
vs_module_defs : 'func1234.def')
e = executable('proggie', 'prog.c', link_with : c)
test('extall', e)

@ -0,0 +1,5 @@
#include"extractor.h"
int func1() {
return 1;
}

@ -0,0 +1,10 @@
#include"extractor.h"
#include<stdio.h>
int main(int argc, char **argv) {
if((1+2+3+4) != (func1() + func2() + func3() + func4())) {
printf("Arithmetic is fail.\n");
return 1;
}
return 0;
}

@ -0,0 +1,5 @@
#include"extractor.h"
int func3() {
return 3;
}

@ -0,0 +1,5 @@
#include"extractor.h"
int func2() {
return 2;
}
Loading…
Cancel
Save