1 ; RUN: llc -verify-machineinstrs -code-model=small < %s | FileCheck %s
2 ; Test with null streamer.
3 ; RUN: llc -O0 -filetype=null < %s
4 target 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"
5 target triple = "powerpc64-unknown-linux-gnu"
7 @double_array = global [32 x double] zeroinitializer, align 8
8 @number64 = global i64 10, align 8
9 @internal_static_var.x = internal unnamed_addr global i64 0, align 8
11 define i64 @access_int64(i64 %a) nounwind readonly {
13 ; CHECK-LABEL: access_int64:
14 ; CHECK-NEXT: .p2align 3
15 ; CHECK-NEXT: .quad .L[[BEGIN:.*]]
16 ; CHECK-NEXT: .quad .TOC.@tocbase
19 ; CHECK-NEXT: .L[[BEGIN]]:
20 %0 = load i64, ptr @number64, align 8
21 ; CHECK: ld {{[0-9]+}}, .LC{{[0-9]+}}@toc(2)
22 %cmp = icmp eq i64 %0, %a
23 %conv1 = zext i1 %cmp to i64
27 define i64 @internal_static_var(i64 %a) nounwind {
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 8
32 %cmp = icmp eq i64 %0, %a
33 %conv1 = zext i1 %cmp to i64
37 define i32 @access_double(double %a) nounwind readnone {
39 ; CHECK-LABEL: access_double:
40 ; CHECK: ld {{[0-9]+}}, .LC{{[0-9]+}}@toc(2)
41 %cmp = fcmp oeq double %a, 2.000000e+00
42 %conv = zext i1 %cmp to i32
47 define i32 @access_double_array(double %a, i32 %i) nounwind readonly {
49 ; CHECK-LABEL: access_double_array:
50 %idxprom = sext i32 %i to i64
51 %arrayidx = getelementptr inbounds [32 x double], ptr @double_array, i64 0, i64 %idxprom
52 %0 = load double, ptr %arrayidx, align 8
53 ; CHECK: ld {{[0-9]+}}, .LC{{[0-9]+}}@toc(2)
54 %cmp = fcmp oeq double %0, %a
55 %conv = zext i1 %cmp to i32
59 ; Check the creation of 4 .tc entries:
60 ; * int64_t global 'number64'
61 ; * double constant 2.0
62 ; * 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]+}}