xref: /llvm-project/llvm/test/CodeGen/PowerPC/aix64-xcoff-roptr.ll (revision f624372ccb74f455986db799f9368dec36927696)
1; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mxcoff-roptr < %s | FileCheck %s
2; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -mxcoff-roptr -filetype=obj -o %t.o < %s
3; RUN: llvm-objdump -t --symbol-description %t.o | FileCheck %s --check-prefix=OBJ
4
5; RUN: not llc -mtriple powerpc64-ibm-aix-xcoff -mxcoff-roptr -data-sections=false \
6; RUN: < %s 2>&1 | FileCheck %s --check-prefix=DS_ERR
7; RUN: not llc -mtriple powerpc64le-unknown-linux-gnu -mxcoff-roptr \
8; RUN: < %s 2>&1 | FileCheck %s --check-prefix=OS_ERR
9
10; DS_ERR: -mxcoff-roptr option must be used with -data-sections
11; OS_ERR: -mxcoff-roptr option is only supported on AIX
12
13%union.U = type { %"struct.U::A" }
14%"struct.U::A" = type { ptr }
15
16@_ZL1p = internal constant i64 ptrtoint (ptr @_ZL1p to i64), align 8
17; CHECK:         .csect _ZL1p[RO],3
18; CHECK-NEXT:    .lglobl	_ZL1p[RO]
19; CHECK-NEXT:    .align	3
20; CHECK-NEXT:    .vbyte	8, _ZL1p[RO]
21; OBJ-DAG: {{([[:xdigit:]]{16})}} l .text {{([[:xdigit:]]{16})}} (idx: [[#]]) _ZL1p[RO]
22@q = thread_local constant ptr @_ZL1p, align 8
23; CHECK:         .csect q[TL],3
24; CHECK-NEXT:    .globl	q[TL]
25; CHECK-NEXT:    .align	3
26; CHECK-NEXT:    .vbyte	8, _ZL1p[RO]
27; OBJ-DAG: {{([[:xdigit:]]{16})}} g O .tdata {{([[:xdigit:]]{16})}} (idx: [[#]]) q[TL]
28@u = local_unnamed_addr constant [1 x %union.U] [%union.U { %"struct.U::A" { ptr @_ZL1p } }], align 8
29; CHECK:         .csect u[RO],3
30; CHECK-NEXT:    .globl	u[RO]
31; CHECK-NEXT:    .align	3
32; CHECK-NEXT:    .vbyte	8, _ZL1p[RO]
33; OBJ-DAG: {{([[:xdigit:]]{16})}} g .text {{([[:xdigit:]]{16})}} (idx: [[#]]) u[RO]
34