1// RUN: llvm-mc -filetype=obj -triple amdgcn-- -mcpu gfx900 %s -o - | llvm-readobj -t -r - | FileCheck %s 2 3 .text 4 .globl test_kernel 5 .p2align 8 6 .type test_kernel,@function 7test_kernel: 8 s_mov_b32 s0, lds0@abs32@lo 9 v_lshl_add_u32 v3, v0, 2, s0 10 ds_read2_b32 v[1:2], v3 offset1:1 11 12 s_mov_b32 s0, lds4@abs32@lo 13 v_lshl_add_u32 v3, v0, 2, s0 14 ds_write_b32 v3, v1 15 s_endpgm 16.Lfunc_end: 17 .size test_kernel, .Lfunc_end-test_kernel 18 19 .globl lds0 20 .amdgpu_lds lds0, 192, 16 21 22 .globl lds1 23 .amdgpu_lds lds1,387,8 24 25 ; Weird whitespace cases 26 .globl lds2 27 .amdgpu_lds lds2, 12 28 29 ; No alignment or .globl directive, not mentioned anywhere 30 .amdgpu_lds lds3, 16 31 32 ; No alignment or .globl directive, size 0, but mentioned in .text 33 .amdgpu_lds lds4, 0 34 35// CHECK: Relocations [ 36// CHECK: Section (3) .rel.text { 37// CHECK-NEXT: 0x4 R_AMDGPU_ABS32 lds0 0x0 38// CHECK-NEXT: 0x1C R_AMDGPU_ABS32 lds4 0x0 39// CHECK-NEXT: } 40// CHECK: ] 41 42// CHECK: Symbol { 43// CHECK: Name: lds0 (54) 44// CHECK-NEXT: Value: 0x10 45// CHECK-NEXT: Size: 192 46// CHECK-NEXT: Binding: Global (0x1) 47// CHECK-NEXT: Type: Object (0x1) 48// CHECK-NEXT: Other: 0 49// CHECK-NEXT: Section: Processor Specific (0xFF00) 50// CHECK-NEXT: } 51 52// CHECK: Symbol { 53// CHECK: Name: lds1 (49) 54// CHECK-NEXT: Value: 0x8 55// CHECK-NEXT: Size: 387 56// CHECK-NEXT: Binding: Global (0x1) 57// CHECK-NEXT: Type: Object (0x1) 58// CHECK-NEXT: Other: 0 59// CHECK-NEXT: Section: Processor Specific (0xFF00) 60// CHECK-NEXT: } 61 62// CHECK: Symbol { 63// CHECK: Name: lds2 (44) 64// CHECK-NEXT: Value: 0x4 65// CHECK-NEXT: Size: 12 66// CHECK-NEXT: Binding: Global (0x1) 67// CHECK-NEXT: Type: Object (0x1) 68// CHECK-NEXT: Other: 0 69// CHECK-NEXT: Section: Processor Specific (0xFF00) 70// CHECK-NEXT: } 71 72// CHECK-NOT: Name: lds3 73 74// CHECK: Symbol { 75// CHECK: Name: lds4 (39) 76// CHECK-NEXT: Value: 0x4 77// CHECK-NEXT: Size: 0 78// CHECK-NEXT: Binding: Global (0x1) 79// CHECK-NEXT: Type: Object (0x1) 80// CHECK-NEXT: Other: 0 81// CHECK-NEXT: Section: Processor Specific (0xFF00) 82// CHECK-NEXT: } 83