[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / AST / fixed_point_to_string.c
blob8f4f3703ef6f596dd8bf889e8754e6d61b6753bd
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
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
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.
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;
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