Stephen Peckham 282da83756 [XCOFF][AIX] Issue an error when specifying an alias for a common symbol
Summary:

There is no support in XCOFF for labels on common symbols. Therefore, an alias for a common symbol is not supported. Issue an error in the front end when an aliasee is a common symbol. Issue a similar error in the back end in case an IR specifies an alias for a common symbol.

Reviewed by: hubert.reinterpretcast, DiggerLin

Differential Revision:  https://reviews.llvm.org/D158739
2023-08-31 11:43:47 -04:00

16 lines
668 B
LLVM

; RUN: not llc -filetype=obj -mtriple powerpc-ibm-aix-xcoff -o %t.o < %s 2>&1 | FileCheck %s
; RUN: not llc -filetype=asm -mtriple powerpc-ibm-aix-xcoff -o %t.o < %s 2>&1 | FileCheck %s
; RUN: not llc -filetype=obj -mtriple powerpc64-ibm-aix-xcoff -o %t.o < %s 2>&1 | FileCheck %s
; RUN: not llc -filetype=asm -mtriple powerpc64-ibm-aix-xcoff -o %t.o < %s 2>&1 | FileCheck %s
@x= common global i32 0, align 4
@y= alias i32, ptr @x
; Function Attrs: noinline nounwind optnone
define ptr @g() #0 {
entry:
ret ptr @y
}
; CHECK: LLVM ERROR: Aliases to common variables are not allowed on AIX:
; CHECK-NEXT: Alias attribute for y is invalid because x is common.