llvm-project/llvm/test/tools/llvm-link/archive-only-needed.ll
Nikita Popov 41d5033eb1 [IR] Enable opaque pointers by default
This enabled opaque pointers by default in LLVM. The effect of this
is twofold:

* If IR that contains *neither* explicit ptr nor %T* types is passed
  to tools, we will now use opaque pointer mode, unless
  -opaque-pointers=0 has been explicitly passed.
* Users of LLVM as a library will now default to opaque pointers.
  It is possible to opt-out by calling setOpaquePointers(false) on
  LLVMContext.

A cmake option to toggle this default will not be provided. Frontends
or other tools that want to (temporarily) keep using typed pointers
should disable opaque pointers via LLVMContext.

Differential Revision: https://reviews.llvm.org/D126689
2022-06-02 09:40:56 +02:00

16 lines
498 B
LLVM

; RUN: llvm-as %S/Inputs/f.ll -o %t.f.bc
; RUN: llvm-as %S/Inputs/g.ll -o %t.g.bc
; RUN: llvm-as %S/Inputs/i.ll -o %t.i.bc
; RUN: rm -f %t.lib
; RUN: llvm-ar cr %t.lib %t.f.bc %t.g.bc %t.i.bc
; RUN: llvm-link %s %t.lib -o %t.linked.bc --only-needed
; RUN: llvm-nm %t.linked.bc | FileCheck %s
; CHECK: -------- T f
; CHECK: -------- T i
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@i = external global ptr
@llvm.used = appending global [1 x ptr] [ptr @i], section "llvm.metadata"