34 lines · c
1// Tests without serialization:2// RUN: %clang_cc1 -ast-dump -ffixed-point %s | FileCheck %s3// RUN: %clang_cc1 -ast-dump -ffixed-point -fpadding-on-unsigned-fixed-point %s | FileCheck %s4//5// Tests with serialization:6// RUN: %clang_cc1 -ffixed-point -emit-pch -o %t %s7// RUN: %clang_cc1 -x c -ffixed-point -include-pch %t -ast-dump-all /dev/null \8// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \9// RUN: | FileCheck %s10//11// RUN: %clang_cc1 -ffixed-point -fpadding-on-unsigned-fixed-point -emit-pch -o %t %s12// RUN: %clang_cc1 -x c -ffixed-point -fpadding-on-unsigned-fixed-point -include-pch %t -ast-dump-all /dev/null \13// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \14// RUN: | FileCheck %s15 16/**17 * Check the same values are printed in the AST regardless of if unsigned types18 * have the same number of fractional bits as signed types.19 */20 21unsigned short _Accum u_short_accum = 0.5uhk;22unsigned _Accum u_accum = 0.5uk;23unsigned long _Accum u_long_accum = 0.5ulk;24unsigned short _Fract u_short_fract = 0.5uhr;25unsigned _Fract u_fract = 0.5ur;26unsigned long _Fract u_long_fract = 0.5ulr;27 28//CHECK: FixedPointLiteral {{.*}} 'unsigned short _Accum' 0.529//CHECK: FixedPointLiteral {{.*}} 'unsigned _Accum' 0.530//CHECK: FixedPointLiteral {{.*}} 'unsigned long _Accum' 0.531//CHECK: FixedPointLiteral {{.*}} 'unsigned short _Fract' 0.532//CHECK: FixedPointLiteral {{.*}} 'unsigned _Fract' 0.533//CHECK: FixedPointLiteral {{.*}} 'unsigned long _Fract' 0.534