70 lines · c
1// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -target-feature +vector -emit-llvm \2// RUN: | FileCheck %s -check-prefix=VECIR3// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -target-feature +vector -S \4// RUN: | FileCheck %s -check-prefix=VECASM5// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -target-feature -vector -emit-llvm \6// RUN: | FileCheck %s -check-prefix=SCALIR7// RUN: %clang_cc1 -triple s390x-linux-gnu %s -o - -target-feature -vector -S \8// RUN: | FileCheck %s -check-prefix=SCALASM9// REQUIRES: systemz-registered-target10 11typedef __attribute__((vector_size(16))) signed int vec_sint;12 13volatile vec_sint GlobVsi;14 15struct S {16 int A;17 vec_sint Vsi;18} GlobS;19 20void fun() {21 GlobS.Vsi = GlobVsi;22}23 24// VECIR: %struct.S = type { i32, <4 x i32> }25// VECIR: @GlobVsi = global <4 x i32> zeroinitializer, align 826// VECIR: @GlobS = global %struct.S zeroinitializer, align 827// VECIR: %0 = load volatile <4 x i32>, ptr @GlobVsi, align 828// VECIR: store <4 x i32> %0, ptr getelementptr inbounds nuw (%struct.S, ptr @GlobS, i32 0, i32 1), align 829 30// VECASM: lgrl %r1, GlobVsi@GOT31// VECASM-NEXT: vl %v0, 0(%r1), 332// VECASM-NEXT: lgrl %r1, GlobS@GOT33// VECASM-NEXT: vst %v0, 8(%r1), 334//35// VECASM: .globl GlobVsi36// VECASM: .p2align 337// VECASM: GlobVsi:38// VECASM: .space 1639// VECASM: .globl GlobS40// VECASM: .p2align 341// VECASM: GlobS:42// VECASM: .space 2443 44// SCALIR: %struct.S = type { i32, [12 x i8], <4 x i32> }45// SCALIR: @GlobVsi = global <4 x i32> zeroinitializer, align 1646// SCALIR: @GlobS = global %struct.S zeroinitializer, align 1647// SCALIR: %0 = load volatile <4 x i32>, ptr @GlobVsi, align 1648// SCALIR: store <4 x i32> %0, ptr getelementptr inbounds nuw (%struct.S, ptr @GlobS, i32 0, i32 2), align 1649 50// SCALASM: lgrl %r1, GlobVsi@GOT51// SCALASM-NEXT: l %r0, 0(%r1)52// SCALASM-NEXT: l %r2, 4(%r1)53// SCALASM-NEXT: l %r3, 8(%r1)54// SCALASM-NEXT: l %r4, 12(%r1)55// SCALASM-NEXT: lgrl %r1, GlobS@GOT56// SCALASM-NEXT: st %r4, 28(%r1)57// SCALASM-NEXT: st %r3, 24(%r1)58// SCALASM-NEXT: st %r2, 20(%r1)59// SCALASM-NEXT: st %r0, 16(%r1)60//61// SCALASM: .globl GlobVsi62// SCALASM: .p2align 463// SCALASM: GlobVsi:64// SCALASM: .space 1665// SCALASM: .globl GlobS66// SCALASM: .p2align 467// SCALASM: GlobS:68// SCALASM: .space 3269 70