1 // RUN: %clang_cc1 -no-opaque-pointers -triple powerpc64-unknown-linux-gnu -emit-llvm -x c++ \ 2 // RUN: -o - %s | FileCheck %s -check-prefix=CHECK-BE 3 // RUN: %clang_cc1 -no-opaque-pointers -triple powerpc64le-unknown-linux-gnu -emit-llvm -x c++ \ 4 // RUN: -o - %s | FileCheck %s -check-prefix=CHECK-LE 5 6 class agg_float_class { float a; }; 7 // CHECK-BE-LABEL: define{{.*}} void @_Z20pass_agg_float_class15agg_float_class(%class.agg_float_class* noalias sret(%class.agg_float_class) align 4 %{{.*}}, float inreg %{{.*}}) 8 // CHECK-LE-LABEL: define{{.*}} [1 x float] @_Z20pass_agg_float_class15agg_float_class(float inreg %{{.*}}) 9 agg_float_class pass_agg_float_class(agg_float_class arg) { return arg; } 10 11 class agg_double_class { double a; }; 12 // CHECK-BE-LABEL: define{{.*}} void @_Z21pass_agg_double_class16agg_double_class(%class.agg_double_class* noalias sret(%class.agg_double_class) align 8 %{{.*}}, double inreg %{{.*}}) 13 // CHECK-LE-LABEL: define{{.*}} [1 x double] @_Z21pass_agg_double_class16agg_double_class(double inreg %{{.*}}) 14 agg_double_class pass_agg_double_class(agg_double_class arg) { return arg; } 15 16 struct agg_float_cpp { float a; int : 0; }; 17 // CHECK-BE-LABEL: define{{.*}} void @_Z18pass_agg_float_cpp13agg_float_cpp(%struct.agg_float_cpp* noalias sret(%struct.agg_float_cpp) align 4 %{{.*}}, float inreg %{{.*}}) 18 // CHECK-LE-LABEL: define{{.*}} [1 x float] @_Z18pass_agg_float_cpp13agg_float_cpp(float inreg %{{.*}}) 19 agg_float_cpp pass_agg_float_cpp(agg_float_cpp arg) { return arg; } 20 21 struct empty { }; 22 struct agg_nofloat_empty { float a; empty dummy; }; 23 // CHECK-BE-LABEL: define{{.*}} void @_Z22pass_agg_nofloat_empty17agg_nofloat_empty(%struct.agg_nofloat_empty* noalias sret(%struct.agg_nofloat_empty) align 4 %{{.*}}, i64 %{{.*}}) 24 // CHECK-LE-LABEL: define{{.*}} i64 @_Z22pass_agg_nofloat_empty17agg_nofloat_empty(i64 %{{.*}}) 25 agg_nofloat_empty pass_agg_nofloat_empty(agg_nofloat_empty arg) { return arg; } 26 27 struct agg_float_empty { float a; [[no_unique_address]] empty dummy; }; 28 // CHECK-BE-LABEL: define{{.*}} void @_Z20pass_agg_float_empty15agg_float_empty(%struct.agg_float_empty* noalias sret(%struct.agg_float_empty) align 4 %{{.*}}, float inreg %{{.*}}) 29 // CHECK-LE-LABEL: define{{.*}} [1 x float] @_Z20pass_agg_float_empty15agg_float_empty(float inreg %{{.*}}) 30 agg_float_empty pass_agg_float_empty(agg_float_empty arg) { return arg; } 31 32 struct agg_nofloat_emptyarray { float a; [[no_unique_address]] empty dummy[3]; }; 33 // CHECK-BE-LABEL: define{{.*}} void @_Z27pass_agg_nofloat_emptyarray22agg_nofloat_emptyarray(%struct.agg_nofloat_emptyarray* noalias sret(%struct.agg_nofloat_emptyarray) align 4 %{{.*}}, i64 %{{.*}}) 34 // CHECK-LE-LABEL: define{{.*}} i64 @_Z27pass_agg_nofloat_emptyarray22agg_nofloat_emptyarray(i64 %{{.*}}) 35 agg_nofloat_emptyarray pass_agg_nofloat_emptyarray(agg_nofloat_emptyarray arg) { return arg; } 36 37 struct noemptybase { empty dummy; }; 38 struct agg_nofloat_emptybase : noemptybase { float a; }; 39 // CHECK-BE-LABEL: define{{.*}} void @_Z26pass_agg_nofloat_emptybase21agg_nofloat_emptybase(%struct.agg_nofloat_emptybase* noalias sret(%struct.agg_nofloat_emptybase) align 4 %{{.*}}, i64 %{{.*}}) 40 // CHECK-LE-LABEL: define{{.*}} i64 @_Z26pass_agg_nofloat_emptybase21agg_nofloat_emptybase(i64 %{{.*}}) 41 agg_nofloat_emptybase pass_agg_nofloat_emptybase(agg_nofloat_emptybase arg) { return arg; } 42 43 struct emptybase { [[no_unique_address]] empty dummy; }; 44 struct agg_float_emptybase : emptybase { float a; }; 45 // CHECK-BE-LABEL: define{{.*}} void @_Z24pass_agg_float_emptybase19agg_float_emptybase(%struct.agg_float_emptybase* noalias sret(%struct.agg_float_emptybase) align 4 %{{.*}}, float inreg %{{.*}}) 46 // CHECK-LE-LABEL: define{{.*}} [1 x float] @_Z24pass_agg_float_emptybase19agg_float_emptybase(float inreg %{{.*}}) 47 agg_float_emptybase pass_agg_float_emptybase(agg_float_emptybase arg) { return arg; } 48 49 struct noemptybasearray { [[no_unique_address]] empty dummy[3]; }; 50 struct agg_nofloat_emptybasearray : noemptybasearray { float a; }; 51 // CHECK-BE-LABEL: define{{.*}} void @_Z31pass_agg_nofloat_emptybasearray26agg_nofloat_emptybasearray(%struct.agg_nofloat_emptybasearray* noalias sret(%struct.agg_nofloat_emptybasearray) align 4 %{{.*}}, i64 %{{.*}}) 52 // CHECK-LE-LABEL: define{{.*}} i64 @_Z31pass_agg_nofloat_emptybasearray26agg_nofloat_emptybasearray(i64 %{{.*}}) 53 agg_nofloat_emptybasearray pass_agg_nofloat_emptybasearray(agg_nofloat_emptybasearray arg) { return arg; } 54 55 // CHECK-BE: call void @_Z24pass_agg_float_emptybase19agg_float_emptybase(%struct.agg_float_emptybase* sret(%struct.agg_float_emptybase) align 4 %{{.*}}, float inreg %{{.*}}) 56 // CHECK-LE: call [1 x float] @_Z24pass_agg_float_emptybase19agg_float_emptybase(float inreg %{{.*}}) 57 void pass_agg_float_emptybase_ptr(agg_float_emptybase* arg) { pass_agg_float_emptybase(*arg); } 58 // CHECK-BE: call void @_Z26pass_agg_nofloat_emptybase21agg_nofloat_emptybase(%struct.agg_nofloat_emptybase* sret(%struct.agg_nofloat_emptybase) align 4 %{{.*}}, i64 %{{.*}}) 59 // CHECK-LE: call i64 @_Z26pass_agg_nofloat_emptybase21agg_nofloat_emptybase(i64 %{{.*}}) 60 void pass_agg_nofloat_emptybase_ptr(agg_nofloat_emptybase* arg) { pass_agg_nofloat_emptybase(*arg); } 61