
clang/lib/CodeGen/CodeGenModule sets dso_local on applicable function declarations, we don't need to duplicate the work in TargetMachine:shouldAssumeDSOLocal. (Actually the long-term goal (started by r324535) is to drop TargetMachine::shouldAssumeDSOLocal.) By not implying dso_local, we will respect dso_local/dso_preemptable specifiers set by the frontend. This allows the proposed -fno-direct-access-external-data option to work with -fno-pic and prevent a canonical PLT entry (SHN_UNDEF with non-zero st_value) when taking the address of a function symbol. This patch should be NFC in terms of the Clang emitted assembly because the case we don't set dso_local is a case Clang sets dso_local. However, some tests don't set dso_local on some function declarations and expose some differences. Most tests have been fixed to be more robust in the previous commit.
16 lines
417 B
LLVM
16 lines
417 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc < %s -mtriple=i686-- | FileCheck %s --check-prefix=ALL
|
|
; RUN: llc < %s -mtriple=i686-- -mcpu=yonah | FileCheck %s --check-prefix=ALL
|
|
|
|
declare double @foo()
|
|
|
|
define double @bar() {
|
|
; ALL-LABEL: bar:
|
|
; ALL: # %bb.0: # %entry
|
|
; ALL-NEXT: jmp foo@PLT # TAILCALL
|
|
entry:
|
|
%tmp5 = tail call double @foo()
|
|
ret double %tmp5
|
|
}
|
|
|