1 // Tests without serialization:
2 // RUN: %clang_cc1 -ast-dump -ffixed-point %s | FileCheck %s
3 // RUN: %clang_cc1 -ast-dump -ffixed-point -fpadding-on-unsigned-fixed-point %s | FileCheck %s
4 //
5 // Tests with serialization:
6 // RUN: %clang_cc1 -ffixed-point -emit-pch -o %t %s
7 // 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 %s
10 //
11 // RUN: %clang_cc1 -ffixed-point -fpadding-on-unsigned-fixed-point -emit-pch -o %t %s
12 // 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 %s
15 
16 /**
17  * Check the same values are printed in the AST regardless of if unsigned types
18  * have the same number of fractional bits as signed types.
19  */
20 
21 unsigned short _Accum u_short_accum = 0.5uhk;
22 unsigned _Accum u_accum = 0.5uk;
23 unsigned long _Accum u_long_accum = 0.5ulk;
24 unsigned short _Fract u_short_fract = 0.5uhr;
25 unsigned _Fract u_fract = 0.5ur;
26 unsigned long _Fract u_long_fract = 0.5ulr;
27 
28 //CHECK: FixedPointLiteral {{.*}} 'unsigned short _Accum' 0.5
29 //CHECK: FixedPointLiteral {{.*}} 'unsigned _Accum' 0.5
30 //CHECK: FixedPointLiteral {{.*}} 'unsigned long _Accum' 0.5
31 //CHECK: FixedPointLiteral {{.*}} 'unsigned short _Fract' 0.5
32 //CHECK: FixedPointLiteral {{.*}} 'unsigned _Fract' 0.5
33 //CHECK: FixedPointLiteral {{.*}} 'unsigned long _Fract' 0.5
34