27 lines · plain
1; REQUIRES: x86_64-apple, x86-registered-target, arm-registered-target2;3; RUN: rm -rf %t && mkdir -p %t4; RUN: llc -filetype=obj -mtriple=x86_64-apple-macosx -o %t/foo.x86_64.o \5; RUN: %p/Inputs/foo-return-i32-0.ll6; RUN: llvm-ar r %t/foo.x86_64.a %t/foo.x86_64.o7; RUN: llc -filetype=obj -mtriple=arm-apple-ios -o %t/foo.arm.o \8; RUN: %p/Inputs/foo-return-i32-0.ll9; RUN: llvm-ar r %t/foo.arm.a %t/foo.arm.o10; RUN: llvm-lipo -create %t/foo.x86_64.a %t/foo.arm.a -output %t/foo.a11; RUN: lli -jit-kind=orc-lazy -extra-archive %t/foo.a %s12;13; Check that MachO universal binaries containing archives work.14; This test compiles two copies of a simple int foo() function that returns15; zero, one copy for x86_64 and one for arm. It then puts each of these in an16; archive and combines these two archives into a macho universal binary.17; Finally we execute a main function that references foo to ensure that the18; x86-64 copy is correctly found and linked.19 20declare i32 @foo()21 22define i32 @main(i32 %argc, ptr nocapture readnone %argv) {23entry:24 %0 = call i32 @foo()25 ret i32 %026}27