brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · f78d304 Raw
46 lines · plain
1; REQUIRES: arm-registered-target2 3;; Verify that the generated assembly omits the RTTI proxy and uses the correct4;; relocations and addends.5; RUN: llc %s -mtriple=armv7 -o - | FileCheck %s6 7;; Verify that the generated object uses the correct relocations and addends.8; RUN: llc %s -filetype=obj -mtriple=thumbv7 -o %t.o9; RUN: llvm-readelf --relocs --hex-dump=.rodata %t.o | FileCheck --check-prefix=OBJ %s10 11@vtable = dso_local unnamed_addr constant i32 sub (i32 ptrtoint (ptr @rtti.proxy to i32), i32 ptrtoint (ptr @vtable to i32)), align 412 13@vtable_with_offset = dso_local unnamed_addr constant [2 x i32] [i32 0, i32 sub (i32 ptrtoint (ptr @rtti.proxy to i32), i32 ptrtoint (ptr @vtable_with_offset to i32))], align 414 15@vtable_with_negative_offset = dso_local unnamed_addr constant [2 x i32] [16  i32 sub (17    i32 ptrtoint (ptr @rtti.proxy to i32),18    i32 ptrtoint (ptr getelementptr inbounds ([2 x i32], ptr @vtable_with_negative_offset, i32 0, i32 1) to i32)19  ),20  i32 021], align 422 23@rtti = external global i8, align 424@rtti.proxy = linkonce_odr hidden unnamed_addr constant ptr @rtti25 26; CHECK-NOT: rtti.proxy27 28; CHECK-LABEL: vtable:29; CHECK-NEXT:    .long   rtti(GOT_PREL)+0{{$}}30 31; CHECK-LABEL: vtable_with_offset:32; CHECK-NEXT:    .long   033; CHECK-NEXT:    .long   rtti(GOT_PREL)+4{{$}}34 35; CHECK-LABEL: vtable_with_negative_offset:36; CHECK-NEXT:    .long   rtti(GOT_PREL)-4{{$}}37; CHECK-NEXT:    .long   038 39; OBJ-LABEL: Relocation section '.rel.rodata' at offset [[#%#x,]] contains 3 entries:40; OBJ:       {{^}}00000000 [[#]] R_ARM_GOT_PREL [[#]] rtti{{$}}41; OBJ-NEXT:  {{^}}00000008 [[#]] R_ARM_GOT_PREL [[#]] rtti{{$}}42; OBJ-NEXT:  {{^}}0000000c [[#]] R_ARM_GOT_PREL [[#]] rtti{{$}}43 44; OBJ-LABEL: Hex dump of section '.rodata':45; OBJ-NEXT:  0x00000000 00000000 00000000 04000000 fcffffff46