xref: /llvm-project/lld/test/MachO/lto-opt-level.ll (revision 6ef37b640daf3d768435e58333caacc89e115bd0)
1; REQUIRES: x86
2
3; RUN: rm -rf %t; mkdir %t
4; RUN: llvm-as  %s -o %t/test.o
5
6; RUN: %lld %t/test.o --lto-O0 -o %t/test
7; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes=CHECK-O0
8
9; RUN: %lld %t/test.o --lto-O2 -o %t/test
10; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes=CHECK-O2
11
12; RUN: %lld %t/test.o -o %t/test
13; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes=CHECK-O2
14
15; CHECK-O0: foo
16; CHECK-O2-NOT: foo
17
18target triple = "x86_64-apple-macosx10.15.0"
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 internal void @foo() {
22  ret void
23}
24
25define void @main() {
26  call void @foo()
27  ret void
28}
29