brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 12c02d1 Raw
55 lines · plain
1; RUN: llc -relocation-model=static -verify-machineinstrs -O1 -mcpu=pwr7 -code-model=medium -filetype=obj %s -o - | \2; RUN: llvm-readobj -r - | FileCheck %s3 4; FIXME: When asm-parse is available, could make this an assembly test.5 6target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"7target triple = "powerpc64-unknown-linux-gnu"8 9@test_fn_static.si = internal global i32 0, align 410 11define dso_local signext i32 @test_fn_static() nounwind {12entry:13  %0 = load i32, ptr @test_fn_static.si, align 414  %inc = add nsw i32 %0, 115  store i32 %inc, ptr @test_fn_static.si, align 416  ret i32 %017}18 19; Verify generation of R_PPC64_TOC16_HA and R_PPC64_TOC16_LO for20; accessing function-scoped variable si.21;22; CHECK: Relocations [23; CHECK:   Section {{.*}} .rela.text {24; CHECK:     0x{{[0-9,A-F]+}} R_PPC64_TOC16_HA [[SYM2:[^ ]+]]25; CHECK:     0x{{[0-9,A-F]+}} R_PPC64_TOC16_LO_DS [[SYM2]]26; CHECK:     0x{{[0-9,A-F]+}} R_PPC64_TOC16_LO [[SYM2]]27 28@gi = dso_local global i32 5, align 429 30define dso_local signext i32 @test_file_static() nounwind {31entry:32  %0 = load i32, ptr @gi, align 433  %inc = add nsw i32 %0, 134  store i32 %inc, ptr @gi, align 435  ret i32 %036}37 38; Verify generation of R_PPC64_TOC16_HA and R_PPC64_TOC16_LO for39; accessing file-scope variable gi.40;41; CHECK:     0x{{[0-9,A-F]+}} R_PPC64_TOC16_HA [[SYM3:[^ ]+]]42; CHECK:     0x{{[0-9,A-F]+}} R_PPC64_TOC16_LO_DS [[SYM3]]43; CHECK:     0x{{[0-9,A-F]+}} R_PPC64_TOC16_LO [[SYM3]]44 45define double @test_double_const() nounwind {46entry:47  ret double 0x3F4FD4920B498CF048}49 50; Verify generation of R_PPC64_TOC16_HA and R_PPC64_TOC16_LO for51; accessing a constant.52;53; CHECK:     0x{{[0-9,A-F]+}} R_PPC64_TOC16_HA [[SYM4:[^ ]+]]54; CHECK:     0x{{[0-9,A-F]+}} R_PPC64_TOC16_LO [[SYM4]]55