Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AIX] Use csect reference for function address constants
SUMMARY: We currently emit a reference for function address constants as labels; for example: foo_ptr: .long foo however, there may be no such label in the case where the function is undefined. Although the label exists when the function is defined, we will (to be consistent) also use a csect reference in that case. Reviewers: daltenty,hubert.reinterpretcast,jasonliu,Xiangling_L Subscribers: cebowleratibm, wuzish, nemanjai Differential Revision: https://reviews.llvm.org/D71144
- Loading branch information
diggerlin
committed
Jan 6, 2020
1 parent
eec0240
commit 61b5e72
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
llvm/test/CodeGen/PowerPC/aix-reference-func-addr-const.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s | ||
; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck --check-prefix=CHECK64 %s | ||
|
||
@foo_ptr = global void (...)* @foo | ||
declare void @foo(...) | ||
|
||
@bar_ptr1 = global void (...)* bitcast (void ()* @bar to void (...)*) | ||
define void @bar() { | ||
entry: | ||
ret void | ||
} | ||
|
||
|
||
;CHECK: .csect .data[RW] | ||
;CHECK-NEXT: .globl foo_ptr | ||
;CHECK-NEXT: .align 2 | ||
;CHECK-NEXT: foo_ptr: | ||
;CHECK-NEXT: .long foo[DS] | ||
;CHECK-NEXT: .globl bar_ptr1 | ||
;CHECK-NEXT: .align 2 | ||
;CHECK-NEXT: bar_ptr1: | ||
;CHECK-NEXT: .long bar[DS] | ||
|
||
;CHECK64: .csect .data[RW] | ||
;CHECK64-NEXT: .globl foo_ptr | ||
;CHECK64-NEXT: .align 3 | ||
;CHECK64-NEXT: foo_ptr: | ||
;CHECK64-NEXT: .llong foo[DS] | ||
;CHECK64-NEXT: .globl bar_ptr1 | ||
;CHECK64-NEXT: .align 3 | ||
;CHECK64-NEXT: bar_ptr1: | ||
;CHECK64-NEXT: .llong bar[DS] |