xref: /llvm-project/lld/test/MachO/lto-codemodel.ll (revision f01fdd17b4d202727023da23bdd120eb0bd94f9f)
176f73404SNico Weber; REQUIRES: x86
276f73404SNico Weber; RUN: llvm-as %s -o %t.o
376f73404SNico Weber; RUN: %lld -lSystem %t.o -o %ts -mllvm -code-model=small
476f73404SNico Weber; RUN: %lld -lSystem %t.o -o %tl -mllvm -code-model=large
575cdab6dSDaniel Thornburgh; RUN: llvm-objdump --no-print-imm-hex -d %ts | FileCheck %s --check-prefix=CHECK-SMALL
675cdab6dSDaniel Thornburgh; RUN: llvm-objdump --no-print-imm-hex -d %tl | FileCheck %s --check-prefix=CHECK-LARGE
776f73404SNico Weber
876f73404SNico Webertarget triple = "x86_64-apple-darwin"
976f73404SNico Webertarget datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
1076f73404SNico Weber
1176f73404SNico Weber@data = internal constant [0 x i32] []
1276f73404SNico Weber
13*f01fdd17SFangrui Songdefine ptr @main() nounwind readonly {
1476f73404SNico Weberentry:
1576f73404SNico Weber; CHECK-SMALL-LABEL: <_main>:
1676f73404SNico Weber; CHECK-SMALL:       leaq    [[#]](%rip), %rax
1776f73404SNico Weber; CHECK-LARGE-LABEL: <_main>:
1876f73404SNico Weber; CHECK-LARGE:       movabsq $[[#]], %rax
19*f01fdd17SFangrui Song  ret ptr @data
2076f73404SNico Weber}
21