• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; This file tests the codegen of mergeable const in AIX assembly.
2; This file also tests mergeable const in XCOFF object file generation.
3; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff -data-sections=false < %s | \
4; RUN:   FileCheck --check-prefixes=CHECK,CHECK32 %s
5; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc64-ibm-aix-xcoff -data-sections=false < %s | \
6; RUN:   FileCheck --check-prefixes=CHECK,CHECK64 %s
7; RUN: llc -verify-machineinstrs -mcpu=pwr4 -mattr=-altivec -mtriple powerpc-ibm-aix-xcoff -data-sections=false -filetype=obj -o %t.o < %s
8; RUN: llvm-objdump -D %t.o | FileCheck --check-prefix=CHECKOBJ %s
9; RUN: llvm-readobj -syms %t.o | FileCheck --check-prefix=CHECKSYM %s
10
11%struct.Merge_cnst32 = type { i64, i32, i64, i32 }
12%struct.Merge_cnst16 = type { i64, i32 }
13%struct.Merge_cnst8 = type { i32, i32 }
14%struct.Merge_cnst4 = type { i16, i8 }
15
16@__const.main.cnst32 = private unnamed_addr constant %struct.Merge_cnst32 { i64 4611686018427387954, i32 0, i64 0, i32 0 }
17@__const.main.cnst16 = private unnamed_addr constant %struct.Merge_cnst16 { i64 4611686018427387926, i32 0 }
18@__const.main.cnst8 = private unnamed_addr constant %struct.Merge_cnst8 { i32 1073741832, i32 0 }
19@__const.main.cnst4 = private unnamed_addr constant %struct.Merge_cnst4 { i16 16392, i8 0 }
20
21; Function Attrs: noinline nounwind optnone
22define i32 @main() #0 {
23entry:
24  ret i32 0
25}
26
27;CHECK:         .csect .rodata[RO],4
28
29;CHECK-NEXT:         .align  4
30;CHECK-NEXT: L..__const.main.cnst32:
31;CHECK32-NEXT:         .vbyte	4, 1073741824
32;CHECK32-NEXT:         .vbyte	4, 50
33;CHECK64-NEXT:         .vbyte	8, 4611686018427387954
34;CHECK-NEXT:           .vbyte	4, 0                       # 0x0
35;CHECK-NEXT:           .space  4
36;CHECK32-NEXT:         .vbyte	4, 0
37;CHECK32-NEXT:         .vbyte	4, 0
38;CHECK64-NEXT:         .vbyte	8, 0
39;CHECK-NEXT:           .vbyte	4, 0                       # 0x0
40;CHECK-NEXT:           .space  4
41
42;CHECK-NEXT:           .align  3
43;CHECK-NEXT: L..__const.main.cnst16:
44;CHECK32-NEXT:         .vbyte	4, 1073741824
45;CHECK32-NEXT:         .vbyte	4, 22
46;CHECK64-NEXT:         .vbyte	8, 4611686018427387926
47;CHECK-NEXT:           .vbyte	4, 0                       # 0x0
48;CHECK-NEXT:           .space  4
49
50;CHECK-NEXT:         .align  3
51;CHECK-NEXT: L..__const.main.cnst8:
52;CHECK-NEXT:         .vbyte	4, 1073741832              # 0x40000008
53;CHECK-NEXT:         .vbyte	4, 0                       # 0x0
54
55;CHECK-NEXT:         .align  3
56;CHECK-NEXT: L..__const.main.cnst4:
57;CHECK-NEXT:         .vbyte	2, 16392                   # 0x4008
58;CHECK-NEXT:         .byte   0                       # 0x0
59;CHECK-NEXT:         .space  1
60
61
62;CHECKOBJ:      00000000 <.text>:
63;CHECKOBJ-NEXT:        0: 38 60 00 00                    li 3, 0
64;CHECKOBJ-NEXT:        4: 4e 80 00 20                    blr
65;CHECKOBJ-NEXT:          ...{{[[:space:]] *}}
66;CHECKOBJ-NEXT: 00000010 <.rodata>:
67;CHECKOBJ-NEXT:        10: 40 00 00 00
68;CHECKOBJ-NEXT:        14: 00 00 00 32
69;CHECKOBJ-NEXT:          ...{{[[:space:]] *}}
70;CHECKOBJ-SAME:       30: 40 00 00 00
71;CHECKOBJ-NEXT:       34: 00 00 00 16
72;CHECKOBJ-NEXT:          ...{{[[:space:]] *}}
73;CHECKOBJ-SAME:       40: 40 00 00 08
74;CHECKOBJ-NEXT:       44: 00 00 00 00
75;CHECKOBJ-NEXT:       48: 40 08 00 00
76
77
78;CHECKSYM:        Symbol {{[{][[:space:]] *}}Index: [[#Index:]]{{[[:space:]] *}}Name: .rodata
79;CHECKSYM-NEXT:     Value (RelocatableAddress): 0x10
80;CHECKSYM-NEXT:     Section: .text
81;CHECKSYM-NEXT:     Type: 0x0
82;CHECKSYM-NEXT:     StorageClass: C_HIDEXT (0x6B)
83;CHECKSYM-NEXT:     NumberOfAuxEntries: 1
84;CHECKSYM-NEXT:     CSECT Auxiliary Entry {
85;CHECKSYM-NEXT:       Index: [[#Index+1]]
86;CHECKSYM-NEXT:       SectionLen: 60
87;CHECKSYM-NEXT:       ParameterHashIndex: 0x0
88;CHECKSYM-NEXT:       TypeChkSectNum: 0x0
89;CHECKSYM-NEXT:       SymbolAlignmentLog2: 4
90;CHECKSYM-NEXT:       SymbolType: XTY_SD (0x1)
91;CHECKSYM-NEXT:       StorageMappingClass: XMC_RO (0x1)
92;CHECKSYM-NEXT:       StabInfoIndex: 0x0
93;CHECKSYM-NEXT:       StabSectNum: 0x0
94;CHECKSYM-NEXT:     }
95;CHECKSYM-NEXT:   }
96