def test_multiply_defined_symbols(self):
    create_test_file('a1.c', 'int f() { return 1; }')
    create_test_file('a2.c', 'void x() {}')
    create_test_file('b1.c', 'int f() { return 2; }')
    create_test_file('b2.c', 'void y() {}')
    create_test_file('main.c', '\n      #include <stdio.h>\n      int f();\n      int main() {\n        printf("result: %d\\n", f());\n        return 0;\n      }\n    ')
    building.emcc('a1.c')
    building.emcc('a2.c')
    building.emcc('b1.c')
    building.emcc('b2.c')
    building.emcc('main.c')
    building.emar('cr', 'liba.a', ['a1.c.o', 'a2.c.o'])
    building.emar('cr', 'libb.a', ['b1.c.o', 'b2.c.o'])
    building.link_to_object(['main.c.o', 'liba.a', 'libb.a'], 'all.o')
    self.do_run_object('all.o', 'result: 1')
def test_multiply_defined_symbols(self):
    create_test_file('a1.c', 'int f() { return 1; }')
    create_test_file('a2.c', 'void x() {}')
    create_test_file('b1.c', 'int f() { return 2; }')
    create_test_file('b2.c', 'void y() {}')
    create_test_file('main.c', '\n      #include <stdio.h>\n      int f();\n      int main() {\n        printf("result: %d\\n", f());\n        return 0;\n      }\n    ')
    building.emcc('a1.c')
    building.emcc('a2.c')
    building.emcc('b1.c')
    building.emcc('b2.c')
    building.emcc('main.c')
    building.emar('cr', 'liba.a', ['a1.c.o', 'a2.c.o'])
    building.emar('cr', 'libb.a', ['b1.c.o', 'b2.c.o'])
    building.link_to_object(['main.c.o', 'liba.a', 'libb.a'], 'all.o')
    self.do_run_object('all.o', 'result: 1')