Summary: This patch implements the backend implementation of adding global variables directly to the table of contents (TOC), rather than adding the address of the variable to the TOC. Currently, this patch will look for the "toc-data" attribute on symbols in the IR, and then add those symbols to the TOC. ATM, this is implemented for 32 bit AIX. Reviewers: sfertile Differential Revision: https://reviews.llvm.org/D101178
16 lines
550 B
LLVM
16 lines
550 B
LLVM
; RUN: llc -mtriple powerpc-ibm-aix-xcoff -verify-machineinstrs < %s | FileCheck %s
|
|
; RUN: not --crash llc -filetype=obj -mtriple powerpc-ibm-aix-xcoff \
|
|
; RUN: -verify-machineinstrs < %s 2>&1 | \
|
|
; RUN: FileCheck %s --check-prefix=OBJ
|
|
|
|
@i = global i32 55, align 4 #0
|
|
|
|
attributes #0 = { "toc-data" }
|
|
; CHECK: .toc
|
|
; CHECK-NEXT: .csect i[TD],2
|
|
; CHECK-NEXT: .globl i[TD]
|
|
; CHECK-NEXT: .align 2
|
|
; CHECK-NEXT: .vbyte 4, 55
|
|
|
|
; OBJ: LLVM ERROR: toc-data not yet supported when writing object files.
|