Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fixed Point] [AST] Add an AST serialization code for fixed-point lit…
…erals. Summary: This patch adds the EXPR_FIXEDPOINT_LITERAL AST code to serialize FixedPointLiterals. They were previously being serialized with the code for integer literals, which doesn't work properly. Reviewers: leonardchan, rjmccall Reviewed By: leonardchan, rjmccall Subscribers: vabridgers, JesperAntonsson, bjope, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57226
- Loading branch information
1 parent
e68f1f2
commit 161fc1d
Showing
8 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Header for PCH test fixed-point-literal.c | ||
|
||
const short _Fract sf = -0.25r; | ||
const _Fract f = 0.75r; | ||
const long _Accum la = 25.25lk; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
// Test this without pch. | ||
// RUN: %clang_cc1 -ffixed-point -include %S/Inputs/fixed-point-literal.h -fsyntax-only -ast-print -o - %s | FileCheck %s | ||
|
||
// Test with pch. | ||
// RUN: %clang_cc1 -ffixed-point -emit-pch -o %t %S/Inputs/fixed-point-literal.h | ||
// RUN: %clang_cc1 -ffixed-point -include-pch %t -fsyntax-only -ast-print -o - %s | FileCheck %s | ||
|
||
// CHECK: const short _Fract sf = -0.25r; | ||
// CHECK: const _Fract f = 0.75r; | ||
// CHECK: const long _Accum la = 25.25lk; | ||
|
||
short _Fract sf2 = sf; | ||
_Fract f2 = f; | ||
long _Accum la2 = la; |