1 ; RUN: llc -march=mips < %s | FileCheck --check-prefixes=ALL,O32 %s
2 ; RUN: llc -march=mipsel < %s | FileCheck --check-prefixes=ALL,O32 %s
4 ; RUN-TODO: llc -march=mips64 -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s
5 ; RUN-TODO: llc -march=mips64el -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s
7 ; RUN: llc -march=mips64 -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s
8 ; RUN: llc -march=mips64el -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s
10 ; RUN: llc -march=mips64 -target-abi n64 < %s | FileCheck --check-prefixes=ALL,N64 %s
11 ; RUN: llc -march=mips64el -target-abi n64 < %s | FileCheck --check-prefixes=ALL,N64 %s
13 ; Test the memory layout for all ABI's and byte orders as specified by section
14 ; 4 of MD00305 (MIPS ABIs Described).
15 ; Bitfields are not covered since they are not available as a type in LLVM IR.
17 ; The assembly directives deal with endianness so we don't need to account for
20 ; Deliberately request alignments that are too small for the target so we get
21 ; the minimum alignment instead of the preferred alignment.
22 @byte = global i8 1, align 1
23 @halfword = global i16 258, align 1
24 @word = global i32 16909060, align 1
25 @float = global float 1.0, align 1
26 @dword = global i64 283686952306183, align 1
27 @double = global double 1.0, align 1
28 @pointer = global ptr @byte
36 ; ALL-LABEL: halfword:
38 ; ALL: .size halfword, 2
42 ; ALL: .4byte 16909060
47 ; ALL: .4byte 0x3f800000
52 ; ALL: .8byte 283686952306183
57 ; ALL: .8byte 0x3ff0000000000000
58 ; ALL: .size double, 8
65 ; O32: .size pointer, 4
67 ; N32: .size pointer, 4
69 ; N64: .size pointer, 8
71 @byte_array = global [2 x i8] [i8 1, i8 2], align 1
72 @halfword_array = global [2 x i16] [i16 1, i16 2], align 1
73 @word_array = global [2 x i32] [i32 1, i32 2], align 1
74 @float_array = global [2 x float] [float 1.0, float 2.0], align 1
75 @dword_array = global [2 x i64] [i64 1, i64 2], align 1
76 @double_array = global [2 x double] [double 1.0, double 2.0], align 1
77 @pointer_array = global [2 x ptr] [ptr @byte, ptr @byte]
80 ; ALL-LABEL: byte_array:
81 ; ALL: .ascii "\001\002"
82 ; ALL: .size byte_array, 2
85 ; ALL-LABEL: halfword_array:
88 ; ALL: .size halfword_array, 4
91 ; ALL-LABEL: word_array:
94 ; ALL: .size word_array, 8
97 ; ALL-LABEL: float_array:
98 ; ALL: .4byte 0x3f800000
99 ; ALL: .4byte 0x40000000
100 ; ALL: .size float_array, 8
103 ; ALL-LABEL: dword_array:
106 ; ALL: .size dword_array, 16
109 ; ALL-LABEL: double_array:
110 ; ALL: .8byte 0x3ff0000000000000
111 ; ALL: .8byte 0x4000000000000000
112 ; ALL: .size double_array, 16
117 ; ALL-LABEL: pointer_array:
120 ; O32: .size pointer_array, 8
123 ; N32: .size pointer_array, 8
126 ; N64: .size pointer_array, 16
128 %mixed = type { i8, double, i16 }
129 @mixed = global %mixed { i8 1, double 1.0, i16 515 }, align 1
135 ; ALL: .8byte 0x3ff0000000000000
138 ; ALL: .size mixed, 24
140 ; Bitfields are not available in LLVM IR so we can't test them here.