Files
clang-p2996/llvm/test/CodeGen/PowerPC/toc-data-const.ll
Yousuf Ali dad2b6e797 [PowerPC][AIX] Support toc-data attribute for read-only globals.
The patch handles the addition of constant global variables to the table
of contents.

Differential Revision: https://reviews.llvm.org/D116181
2022-01-27 10:47:22 -05:00

27 lines
572 B
LLVM

; RUN: llc -mtriple powerpc-ibm-aix-xcoff < %s | FileCheck %s --check-prefix CHECK
; RUN: llc -mtriple powerpc64-ibm-aix-xcoff < %s | FileCheck %s --check-prefix CHECK
@i1 = external constant i32 #0
@i2 = constant i32* @i1 #0
define i32 @read() {
%1 = load i32, i32* @i1, align 4
ret i32 %1
}
define i32** @retptr() {
ret i32** @i2
}
; CHECK: .read:
; CHECK: la 3, i1[TD](2)
; CHECK: .retptr:
; CHECK: la 3, i2[TD](2)
; CHECK-DAG: .toc
; CHECK: .extern i1[TD]
; CHECK: .csect i2[TD]
attributes #0 = { "toc-data" }