annotate clang/test/AST/fixed_point_to_string.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
1 // Tests without serialization:
150
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -ast-dump -ffixed-point %s | FileCheck %s
anatofuz
parents:
diff changeset
3 // RUN: %clang_cc1 -ast-dump -ffixed-point -fpadding-on-unsigned-fixed-point %s | FileCheck %s
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
4 //
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
5 // Tests with serialization:
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
6 // RUN: %clang_cc1 -ffixed-point -emit-pch -o %t %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 // RUN: %clang_cc1 -x c -ffixed-point -include-pch %t -ast-dump-all /dev/null \
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
8 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
9 // RUN: | FileCheck %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
10 //
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
11 // RUN: %clang_cc1 -ffixed-point -fpadding-on-unsigned-fixed-point -emit-pch -o %t %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
12 // RUN: %clang_cc1 -x c -ffixed-point -fpadding-on-unsigned-fixed-point -include-pch %t -ast-dump-all /dev/null \
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
13 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
14 // RUN: | FileCheck %s
150
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 /**
anatofuz
parents:
diff changeset
17 * Check the same values are printed in the AST regardless of if unsigned types
anatofuz
parents:
diff changeset
18 * have the same number of fractional bits as signed types.
anatofuz
parents:
diff changeset
19 */
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 unsigned short _Accum u_short_accum = 0.5uhk;
anatofuz
parents:
diff changeset
22 unsigned _Accum u_accum = 0.5uk;
anatofuz
parents:
diff changeset
23 unsigned long _Accum u_long_accum = 0.5ulk;
anatofuz
parents:
diff changeset
24 unsigned short _Fract u_short_fract = 0.5uhr;
anatofuz
parents:
diff changeset
25 unsigned _Fract u_fract = 0.5ur;
anatofuz
parents:
diff changeset
26 unsigned long _Fract u_long_fract = 0.5ulr;
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 //CHECK: FixedPointLiteral {{.*}} 'unsigned short _Accum' 0.5
anatofuz
parents:
diff changeset
29 //CHECK: FixedPointLiteral {{.*}} 'unsigned _Accum' 0.5
anatofuz
parents:
diff changeset
30 //CHECK: FixedPointLiteral {{.*}} 'unsigned long _Accum' 0.5
anatofuz
parents:
diff changeset
31 //CHECK: FixedPointLiteral {{.*}} 'unsigned short _Fract' 0.5
anatofuz
parents:
diff changeset
32 //CHECK: FixedPointLiteral {{.*}} 'unsigned _Fract' 0.5
anatofuz
parents:
diff changeset
33 //CHECK: FixedPointLiteral {{.*}} 'unsigned long _Fract' 0.5