xref: /llvm-project/lld/test/MachO/lto-objc-arc-contract.ll (revision ae5efe97618355e7552b0cb3c6790f3d8e8f8554)
1; REQUIRES: x86
2
3;; Verify that we run the ObjCARCContractPass during LTO. Without that, the
4;; objc.clang.arc.use intrinsic will get passed to the instruction selector,
5;; which doesn't know how to handle it.
6
7; RUN: llvm-as %s -o %t.o
8; RUN: %lld -dylib -lSystem %t.o -o %t
9; RUN: llvm-objdump -d %t | FileCheck %s
10
11; RUN: opt -module-summary %s -o %t.o
12; RUN: %lld -dylib -lSystem %t.o -o %t
13; RUN: llvm-objdump -d %t | FileCheck %s
14
15; CHECK:      <_foo>:
16; CHECK-NEXT: retq
17
18target triple = "x86_64-apple-darwin"
19target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
20
21define void @foo(ptr %a, ptr %b) {
22  call void (...) @llvm.objc.clang.arc.use(ptr %a, ptr %b) nounwind
23  ret void
24}
25
26declare void @llvm.objc.clang.arc.use(...) nounwind
27