|
18 | 18 | ; RUN: -xcoff-traceback-table=false --filetype=obj < %t/with-vnds.ll -o %t/with-vnds.o
|
19 | 19 | ; RUN: llvm-objdump %t/with-vnds.o -tr | FileCheck %s --check-prefix=WITHVNDS-OBJ
|
20 | 20 |
|
| 21 | +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \ |
| 22 | +; RUN: -xcoff-traceback-table=false < %t/zero-size-cnts-section.ll | FileCheck %s --check-prefixes=ZERO-SIZE-CNTS |
| 23 | +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \ |
| 24 | +; RUN: -xcoff-traceback-table=false --filetype=obj < %t/zero-size-cnts-section.ll -o %t/zero-size-cnts-section.o |
| 25 | +; RUN: llvm-objdump %t/zero-size-cnts-section.o -tr | FileCheck %s --check-prefix=ZERO-SIZE-CNTS-OBJ |
| 26 | + |
| 27 | +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \ |
| 28 | +; RUN: -xcoff-traceback-table=false < %t/zero-size-other-section.ll | FileCheck %s --check-prefixes=ZERO-SIZE-OTHER |
| 29 | +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \ |
| 30 | +; RUN: -xcoff-traceback-table=false < %t/zero-size-other-section.ll | FileCheck %s --check-prefixes=ZERO-SIZE-OTHER |
| 31 | +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff \ |
| 32 | +; RUN: -xcoff-traceback-table=false --filetype=obj < %t/zero-size-other-section.ll -o %t/zero-size-other-section.o |
| 33 | +; RUN: llvm-objdump %t/zero-size-other-section.o -tr | FileCheck %s --check-prefix=ZERO-SIZE-OTHER-OBJ |
| 34 | +; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff \ |
| 35 | +; RUN: -xcoff-traceback-table=false --filetype=obj < %t/zero-size-other-section.ll -o %t/zero-size-other-section.o |
| 36 | +; RUN: llvm-objdump %t/zero-size-other-section.o -tr | FileCheck %s --check-prefix=ZERO-SIZE-OTHER-OBJ |
| 37 | + |
| 38 | + |
21 | 39 | ;--- no-ref.ll
|
22 | 40 | ; The absence of a __llvm_prf_cnts section should stop generating the .refs.
|
23 | 41 | ;
|
@@ -120,3 +138,60 @@ entry:
|
120 | 138 | ; WITHVNDS-OBJ-NEXT: 00000000 R_REF __llvm_prf_vnds
|
121 | 139 | ; WITHVNDS-OBJ-NEXT: 00000100 R_POS .main
|
122 | 140 | ; WITHVNDS-OBJ-NEXT: 00000104 R_POS TOC
|
| 141 | + |
| 142 | +;--- zero-size-cnts-section.ll |
| 143 | +; If __llvm_prf_cnts is of zero size, do not generate the .ref directive. |
| 144 | +; The size of the other sections does not matter. |
| 145 | + |
| 146 | +@dummy_cnts = private global [0 x i32] zeroinitializer, section "__llvm_prf_cnts", align 4 |
| 147 | +@dummy_data = private global [1 x i64] zeroinitializer, section "__llvm_prf_data", align 8 |
| 148 | +@dummy_name = private constant [0 x i32] zeroinitializer, section "__llvm_prf_names", align 4 |
| 149 | + |
| 150 | +@llvm.used = appending global [3 x ptr] |
| 151 | + [ptr @dummy_cnts, |
| 152 | + ptr @dummy_data, |
| 153 | + ptr @dummy_name], section "llvm.metadata" |
| 154 | + |
| 155 | +define i32 @main() #0 { |
| 156 | +entry: |
| 157 | + ret i32 1 |
| 158 | +} |
| 159 | + |
| 160 | +; ZERO-SIZE-CNTS-NOT: .ref __llvm_prf_data[RW] |
| 161 | +; ZERO-SIZE-CNTS-NOT: .ref __llvm_prf_names[RO] |
| 162 | +; ZERO-SIZE-CNTS-NOT: .ref __llvm_prf_vnds |
| 163 | + |
| 164 | +; ZERO-SIZE-CNTS-OBJ-NOT: R_REF __llvm_prf_data |
| 165 | +; ZERO-SIZE-CNTS-OBJ-NOT: R_REF __llvm_prf_names |
| 166 | +; ZERO-SIZE-CNTS-OBJ-NOT: R_REF __llvm_prf_vnds |
| 167 | + |
| 168 | +;--- zero-size-other-section.ll |
| 169 | +; If __llvm_prf_cnts is of non-zero size, generate the .ref directive even if other sections |
| 170 | +; are zero-sized; |
| 171 | + |
| 172 | +@__profc_main = private global [1 x i64] zeroinitializer, section "__llvm_prf_cnts", align 8 |
| 173 | +@__profd_main = private global [0 x i64] zeroinitializer, section "__llvm_prf_data", align 8 |
| 174 | +@__llvm_prf_nm = private constant [0 x i8] zeroinitializer, section "__llvm_prf_names", align 1 |
| 175 | +@__llvm_prf_vnodes = private global [0 x { i64, i64, ptr }] zeroinitializer, section "__llvm_prf_vnds" |
| 176 | + |
| 177 | +@llvm.used = appending global [4 x ptr] |
| 178 | + [ptr @__profc_main, |
| 179 | + ptr @__profd_main, |
| 180 | + ptr @__llvm_prf_nm, |
| 181 | + ptr @__llvm_prf_vnodes], section "llvm.metadata" |
| 182 | + |
| 183 | +define i32 @main() #0 { |
| 184 | +entry: |
| 185 | + ret i32 1 |
| 186 | +} |
| 187 | + |
| 188 | +; ZERO-SIZE-OTHER: .csect __llvm_prf_cnts[RW],3 |
| 189 | +; ZERO-SIZE-OTHER: .csect __llvm_prf_cnts[RW],3 |
| 190 | +; ZERO-SIZE-OTHER-NEXT: .ref __llvm_prf_data[RW] |
| 191 | +; ZERO-SIZE-OTHER-NEXT: .ref __llvm_prf_names[RO] |
| 192 | +; ZERO-SIZE-OTHER-NEXT: .ref __llvm_prf_vnds[RW] |
| 193 | + |
| 194 | +; ZERO-SIZE-OTHER-OBJ: R_REF __llvm_prf_data |
| 195 | +; ZERO-SIZE-OTHER-OBJ-NEXT: R_REF __llvm_prf_names |
| 196 | +; ZERO-SIZE-OTHER-OBJ-NEXT: R_REF __llvm_prf_vnds |
| 197 | + |
0 commit comments