brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.4 KiB · c95fe09 Raw
141 lines · plain
1; RUN: llc -mtriple=mips-elf < %s | FileCheck --check-prefixes=ALL,O32 %s2; RUN: llc -mtriple=mipsel-elf < %s | FileCheck --check-prefixes=ALL,O32 %s3 4; RUN-TODO: llc -mtriple=mips64-elf -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s5; RUN-TODO: llc -mtriple=mips64el-elf -target-abi o32 < %s | FileCheck --check-prefixes=ALL,O32 %s6 7; RUN: llc -mtriple=mips64-elf -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s8; RUN: llc -mtriple=mips64el-elf -target-abi n32 < %s | FileCheck --check-prefixes=ALL,N32 %s9 10; RUN: llc -mtriple=mips64-elf -target-abi n64 < %s | FileCheck --check-prefixes=ALL,N64 %s11; RUN: llc -mtriple=mips64el-elf -target-abi n64 < %s | FileCheck --check-prefixes=ALL,N64 %s12 13; Test the memory layout for all ABI's and byte orders as specified by section14; 4 of MD00305 (MIPS ABIs Described).15; Bitfields are not covered since they are not available as a type in LLVM IR.16;17; The assembly directives deal with endianness so we don't need to account for18; that.19 20; Deliberately request alignments that are too small for the target so we get21; the minimum alignment instead of the preferred alignment.22@byte = global i8 1, align 123@halfword = global i16 258, align 124@word = global i32 16909060, align 125@float = global float 1.0, align 126@dword = global i64 283686952306183, align 127@double = global double 1.0, align 128@pointer = global ptr @byte29 30; ALL-NOT:       .p2align31; ALL-LABEL: byte:32; ALL:           .byte 133; ALL:           .size byte, 134 35; ALL:           .p2align 136; ALL-LABEL: halfword:37; ALL:           .2byte 25838; ALL:           .size halfword, 239 40; ALL:           .p2align 241; ALL-LABEL: word:42; ALL:           .4byte 1690906043; ALL:           .size word, 444 45; ALL:           .p2align 246; ALL-LABEL: float:47; ALL:           .4byte 0x3f80000048; ALL:           .size float, 449 50; ALL:           .p2align 351; ALL-LABEL: dword:52; ALL:           .8byte 28368695230618353; ALL:           .size dword, 854 55; ALL:           .p2align 356; ALL-LABEL: double:57; ALL:           .8byte 0x3ff000000000000058; ALL:           .size double, 859 60; O32:           .p2align 261; N32:           .p2align 262; N64:           .p2align 363; ALL-LABEL: pointer:64; O32:           .4byte byte65; O32:           .size pointer, 466; N32:           .4byte byte67; N32:           .size pointer, 468; N64:           .8byte byte69; N64:           .size pointer, 870 71@byte_array = global [2 x i8] [i8 1, i8 2], align 172@halfword_array = global [2 x i16] [i16 1, i16 2], align 173@word_array = global [2 x i32] [i32 1, i32 2], align 174@float_array = global [2 x float] [float 1.0, float 2.0], align 175@dword_array = global [2 x i64] [i64 1, i64 2], align 176@double_array = global [2 x double] [double 1.0, double 2.0], align 177@pointer_array = global [2 x ptr] [ptr @byte, ptr @byte]78 79; ALL-NOT:       .p2align80; ALL-LABEL: byte_array:81; ALL:           .ascii "\001\002"82; ALL:           .size byte_array, 283 84; ALL:           .p2align 185; ALL-LABEL: halfword_array:86; ALL:           .2byte 187; ALL:           .2byte 288; ALL:           .size halfword_array, 489 90; ALL:           .p2align 291; ALL-LABEL: word_array:92; ALL:           .4byte 193; ALL:           .4byte 294; ALL:           .size word_array, 895 96; ALL:           .p2align 297; ALL-LABEL: float_array:98; ALL:           .4byte 0x3f80000099; ALL:           .4byte 0x40000000100; ALL:           .size float_array, 8101 102; ALL:           .p2align 3103; ALL-LABEL: dword_array:104; ALL:           .8byte 1105; ALL:           .8byte 2106; ALL:           .size dword_array, 16107 108; ALL:           .p2align 3109; ALL-LABEL: double_array:110; ALL:           .8byte 0x3ff0000000000000111; ALL:           .8byte 0x4000000000000000112; ALL:           .size double_array, 16113 114; O32:           .p2align 2115; N32:           .p2align 2116; N64:           .p2align 3117; ALL-LABEL: pointer_array:118; O32:           .4byte byte119; O32:           .4byte byte120; O32:           .size pointer_array, 8121; N32:           .4byte byte122; N32:           .4byte byte123; N32:           .size pointer_array, 8124; N64:           .8byte byte125; N64:           .8byte byte126; N64:           .size pointer_array, 16127 128%mixed = type { i8, double, i16 }129@mixed = global %mixed { i8 1, double 1.0, i16 515 }, align 1130 131; ALL:           .p2align 3132; ALL-LABEL: mixed:133; ALL:           .byte 1134; ALL:           .space 7135; ALL:           .8byte 0x3ff0000000000000136; ALL:           .2byte 515137; ALL:           .space 6138; ALL:           .size mixed, 24139 140; Bitfields are not available in LLVM IR so we can't test them here.141