50 lines · c
1// REQUIRES: powerpc-registered-target2// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s3 4typedef struct s1 { float f; } Sf;5typedef struct s2 { double d; } Sd;6typedef struct s4 { Sf fs; } SSf;7typedef struct s5 { Sd ds; } SSd;8 9void bar(Sf a, Sd b, SSf d, SSd e) {}10 11// CHECK-LABEL: define{{.*}} void @bar12// CHECK: %a = alloca %struct.s1, align 413// CHECK: %b = alloca %struct.s2, align 814// CHECK: %d = alloca %struct.s4, align 415// CHECK: %e = alloca %struct.s5, align 816// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s1, ptr %a, i32 0, i32 017// CHECK: store float %a.coerce, ptr %{{[a-zA-Z0-9.]+}}, align 418// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s2, ptr %b, i32 0, i32 019// CHECK: store double %b.coerce, ptr %{{[a-zA-Z0-9.]+}}, align 820// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s4, ptr %d, i32 0, i32 021// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s1, ptr %{{[a-zA-Z0-9.]+}}, i32 0, i32 022// CHECK: store float %d.coerce, ptr %{{[a-zA-Z0-9.]+}}, align 423// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s5, ptr %e, i32 0, i32 024// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s2, ptr %{{[a-zA-Z0-9.]+}}, i32 0, i32 025// CHECK: store double %e.coerce, ptr %{{[a-zA-Z0-9.]+}}, align 826// CHECK: ret void27 28void foo(void) 29{30 Sf p1 = { 22.63f };31 Sd p2 = { 19.47 };32 SSf p4 = { { 22.63f } };33 SSd p5 = { { 19.47 } };34 bar(p1, p2, p4, p5);35}36 37// CHECK-LABEL: define{{.*}} void @foo38// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s1, ptr %p1, i32 0, i32 039// CHECK: %{{[0-9]+}} = load float, ptr %{{[a-zA-Z0-9.]+}}, align 440// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s2, ptr %p2, i32 0, i32 041// CHECK: %{{[0-9]+}} = load double, ptr %{{[a-zA-Z0-9.]+}}, align 842// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s4, ptr %p4, i32 0, i32 043// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s1, ptr %{{[a-zA-Z0-9.]+}}, i32 0, i32 044// CHECK: %{{[0-9]+}} = load float, ptr %{{[a-zA-Z0-9.]+}}, align 445// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s5, ptr %p5, i32 0, i32 046// CHECK: %{{[a-zA-Z0-9.]+}} = getelementptr inbounds nuw %struct.s2, ptr %{{[a-zA-Z0-9.]+}}, i32 0, i32 047// CHECK: %{{[0-9]+}} = load double, ptr %{{[a-zA-Z0-9.]+}}, align 848// CHECK: call void @bar(float inreg %{{[0-9]+}}, double inreg %{{[0-9]+}}, float inreg %{{[0-9]+}}, double inreg %{{[0-9]+}})49// CHECK: ret void50