brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · bbd2acb Raw
60 lines · plain
1; RUN: llc -o - %s | FileCheck %s2 3; AsmPrinter cannot lower floating point constant expressions in global4; initializers. Check that we do not create new globals with float constant5; expressions in initializers.6 7target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"8target triple = "arm64-apple-ios14.0.0"9 10define [1 x <4 x float>] @test1() {11; CHECK-LABEL:    .p2align    4, 0x0              ; -- Begin function test112; CHECK-NEXT: lCPI0_0:13; CHECK-NEXT:     .quad   0                       ; 0x014; CHECK-NEXT:     .quad   4575657221408423936     ; 0x3f8000000000000015; CHECK-NEXT:     .section    __TEXT,__text,regular,pure_instructions16; CHECK-NEXT:     .globl  _test117; CHECK-NEXT:     .p2align    218; CHECK-NEXT: _test1:                                 ; @test119; CHECK-NEXT:     .cfi_startproc20; CHECK-NEXT: ; %bb.0:21; CHECK-NEXT: Lloh0:22; CHECK-NEXT:     adrp    x8, lCPI0_0@PAGE23; CHECK-NEXT: Lloh1:24; CHECK-NEXT:     ldr q0, [x8, lCPI0_0@PAGEOFF]25; CHECK-NEXT:     ret26 27  ret [1 x <4 x float>] [<4 x float> bitcast (<1 x i128> <i128 84405977732342157929391748327801880576> to <4 x float>)]28}29 30define [1 x <4 x float>] @test2() {31; CHECK-LABEL:    .p2align    4, 0x0              ; -- Begin function test232; CHECK-NEXT: lCPI1_0:33; CHECK-NEXT:     .long   0x80000000              ; float -034; CHECK-NEXT:     .long   0x80000000              ; float -035; CHECK-NEXT:     .long   0x80000000              ; float -036; CHECK-NEXT:     .long   0xbf800000              ; float -137; CHECK-NEXT:     .section    __TEXT,__text,regular,pure_instructions38; CHECK-NEXT:     .globl  _test239; CHECK-NEXT:     .p2align    240; CHECK-NEXT: _test2:                                 ; @test241; CHECK-NEXT:     .cfi_startproc42; CHECK-NEXT: ; %bb.0:43; CHECK-NEXT: Lloh2:44; CHECK-NEXT:     adrp    x8, lCPI1_0@PAGE45; CHECK-NEXT: Lloh3:46; CHECK-NEXT:     ldr q0, [x8, lCPI1_0@PAGEOFF]47; CHECK-NEXT:     ret48;49  %constexpr = fneg float extractelement (<4 x float> bitcast (<1 x i128> <i128 84405977732342157929391748327801880576> to <4 x float>), i32 0)50  %constexpr1 = fneg float extractelement (<4 x float> bitcast (<1 x i128> <i128 84405977732342157929391748327801880576> to <4 x float>), i32 1)51  %constexpr2 = fneg float extractelement (<4 x float> bitcast (<1 x i128> <i128 84405977732342157929391748327801880576> to <4 x float>), i32 2)52  %constexpr3 = fneg float extractelement (<4 x float> bitcast (<1 x i128> <i128 84405977732342157929391748327801880576> to <4 x float>), i32 3)53  %constexpr.ins = insertelement <4 x float> poison, float %constexpr, i32 054  %constexpr.ins4 = insertelement <4 x float> %constexpr.ins, float %constexpr1, i32 155  %constexpr.ins5 = insertelement <4 x float> %constexpr.ins4, float %constexpr2, i32 256  %constexpr.ins6 = insertelement <4 x float> %constexpr.ins5, float %constexpr3, i32 357  %constexpr.ins7 = insertvalue [1 x <4 x float>] poison, <4 x float> %constexpr.ins6, 058  ret [1 x <4 x float>] %constexpr.ins759}60