[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / AMDGPU / elf-lds.s
blobb2b4ad6120f1bed4b7eaabaf97e469392f5b57fd
1 // RUN: llvm-mc -filetype=obj -triple amdgcn-- -mcpu gfx900 %s -o - | llvm-readobj -r --syms - | FileCheck %s
3 .text
4 .globl test_kernel
5 .p2align 8
6 .type test_kernel,@function
7 test_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
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
19 .globl lds0
20 .amdgpu_lds lds0, 192, 16
22 .globl lds1
23 .amdgpu_lds lds1,387,8
25 ; Weird whitespace cases
26 .globl lds2
27 .amdgpu_lds lds2, 12
29 ; No alignment or .globl directive, not mentioned anywhere
30 .amdgpu_lds lds3, 16
32 ; No alignment or .globl directive, size 0, but mentioned in .text
33 .amdgpu_lds lds4, 0
35 // CHECK: Relocations [
36 // CHECK: Section (3) .rel.text {
37 // CHECK-NEXT: 0x4 R_AMDGPU_ABS32 lds0
38 // CHECK-NEXT: 0x1C R_AMDGPU_ABS32 lds4
39 // CHECK-NEXT: }
40 // CHECK: ]
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: }
52 // CHECK: Symbol {
53 // CHECK: Name: lds4 (39)
54 // CHECK-NEXT: Value: 0x4
55 // CHECK-NEXT: Size: 0
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: }
62 // CHECK: Symbol {
63 // CHECK: Name: lds1 (49)
64 // CHECK-NEXT: Value: 0x8
65 // CHECK-NEXT: Size: 387
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: }
72 // CHECK: Symbol {
73 // CHECK: Name: lds2 (44)
74 // CHECK-NEXT: Value: 0x4
75 // CHECK-NEXT: Size: 12
76 // CHECK-NEXT: Binding: Global (0x1)
77 // CHECK-NEXT: Type: Object (0x1)
78 // CHECK-NEXT: Other: 0
79 // CHECK-NEXT: Section: Processor Specific (0xFF00)
80 // CHECK-NEXT: }
82 // CHECK-NOT: Name: lds3