brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · 7e797e7 Raw
72 lines · plain
1; RUN: llc -verify-machineinstrs -code-model=small < %s | FileCheck %s2; Test with null streamer.3; RUN: llc -O0 -filetype=null < %s4target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"5target triple = "powerpc64-unknown-linux-gnu"6 7@double_array = global [32 x double] zeroinitializer, align 88@number64 = global i64 10, align 89@internal_static_var.x = internal unnamed_addr global i64 0, align 810 11define i64 @access_int64(i64 %a) nounwind readonly {12entry:13; CHECK-LABEL: access_int64:14; CHECK-NEXT: .p2align  315; CHECK-NEXT: .quad   .L[[BEGIN:.*]]16; CHECK-NEXT: .quad   .TOC.@tocbase17; CHECK-NEXT: .quad   018; CHECK-NEXT: .text19; CHECK-NEXT: .L[[BEGIN]]:20  %0 = load i64, ptr @number64, align 821; CHECK: ld {{[0-9]+}}, .LC{{[0-9]+}}@toc(2)22  %cmp = icmp eq i64 %0, %a23  %conv1 = zext i1 %cmp to i64 24  ret i64 %conv125}26 27define i64 @internal_static_var(i64 %a) nounwind {28entry:29; CHECK-LABEL: internal_static_var:30; CHECK: ld {{[0-9]+}}, .LC{{[0-9]+}}@toc(2)31  %0 = load i64, ptr @internal_static_var.x, align 832  %cmp = icmp eq i64 %0, %a33  %conv1 = zext i1 %cmp to i64 34  ret i64 %conv1 35}36 37define i32 @access_double(double %a) nounwind readnone {38entry:39; CHECK-LABEL: access_double:40; CHECK: ld {{[0-9]+}}, .LC{{[0-9]+}}@toc(2)41  %cmp = fcmp oeq double %a, 2.000000e+0042  %conv = zext i1 %cmp to i32 43  ret i32 %conv44}45 46 47define i32 @access_double_array(double %a, i32 %i) nounwind readonly {48entry:49; CHECK-LABEL: access_double_array:50  %idxprom = sext i32 %i to i6451  %arrayidx = getelementptr inbounds [32 x double], ptr @double_array, i64 0, i64 %idxprom52  %0 = load double, ptr %arrayidx, align 853; CHECK: ld {{[0-9]+}}, .LC{{[0-9]+}}@toc(2)54  %cmp = fcmp oeq double %0, %a55  %conv = zext i1 %cmp to i3256  ret i32 %conv57}58 59; Check the creation of 4 .tc entries:60; * int64_t global 'number64'61; * double constant 2.062; * double array 'double_array'63; * static int64_t 'x' accessed within '@internal_static_var'64; CHECK: .LC{{[0-9]+}}:65; CHECK-NEXT: .tc {{[\._a-zA-Z0-9]+}}[TC],{{[\._a-zA-Z0-9]+}}66; CHECK-NEXT: .LC{{[0-9]+}}:67; CHECK-NEXT: .tc {{[\._a-zA-Z0-9]+}}[TC],{{[\._a-zA-Z0-9]+}}68; CHECK-NEXT: .LC{{[0-9]+}}:69; CHECK-NEXT: .tc {{[\._a-zA-Z0-9]+}}[TC],{{[\._a-zA-Z0-9]+}}70; CHECK-NEXT: .LC{{[0-9]+}}:71; CHECK-NEXT: .tc {{[\._a-zA-Z0-9]+}}[TC],{{[\._a-zA-Z0-9]+}}72