aboutsummaryrefslogtreecommitdiff
path: root/test/llvm-ast-parser-tests.js
diff options
context:
space:
mode:
authorPatrick Quist <partouf@gmail.com>2022-07-20 20:43:30 +0200
committerGitHub <noreply@github.com>2022-07-20 20:43:30 +0200
commit9ee63046cd999bd02a72d6f6f078249f3c242b77 (patch)
tree0c261b73a072e377f7174767818b9476a67cda11 /test/llvm-ast-parser-tests.js
parent309ffe3ac19d17297fae42fe3801ad89ceb38b61 (diff)
parentd319bca54cb316c8f2d5002214e36a2cf8e2b98f (diff)
downloadcompiler-explorer-gh-3685.tar.gz
compiler-explorer-gh-3685.zip
Merge branch 'main' into ldcsymbolizergh-3685
Diffstat (limited to 'test/llvm-ast-parser-tests.js')
-rw-r--r--test/llvm-ast-parser-tests.js47
1 files changed, 45 insertions, 2 deletions
diff --git a/test/llvm-ast-parser-tests.js b/test/llvm-ast-parser-tests.js
index d51f05b68..07c8f1b8b 100644
--- a/test/llvm-ast-parser-tests.js
+++ b/test/llvm-ast-parser-tests.js
@@ -71,11 +71,11 @@ describe('llvm-ast', function () {
});
it('keeps reasonable-sized output', () => {
- astDumpWithCTime.length.should.be.above(100);
+ astDumpWithCTime.length.should.be.above(200);
let output = mockAstOutput(astDumpWithCTime);
let processed = astParser.processAst(output);
- processed.length.should.be.below(100);
+ processed.length.should.be.below(200);
});
it('links some source lines', () => {
@@ -106,3 +106,46 @@ describe('llvm-ast', function () {
should.exist(processed.find(l => l.text.match(/CXXRecord/)));
});
});
+
+describe('llvm-ast bug-3849a', function () {
+ let compilerProps;
+ let astParser;
+ let astDump;
+ let compilerOutput;
+
+ before(() => {
+ let fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
+ compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+
+ astParser = new LlvmAstParser(compilerProps);
+ astDump = utils.splitLines(fs.readFileSync('test/ast/bug-3849a.ast').toString());
+ compilerOutput = mockAstOutput(astDump);
+ });
+
+ it('should have more than 2 lines', () => {
+ let processed = astParser.processAst(compilerOutput);
+ processed.length.should.be.above(2);
+ });
+});
+
+describe('llvm-ast bug-3849b', function () {
+ let compilerProps;
+ let astParser;
+ let astDump;
+ let compilerOutput;
+
+ before(() => {
+ let fakeProps = new properties.CompilerProps(languages, properties.fakeProps({}));
+ compilerProps = fakeProps.get.bind(fakeProps, 'c++');
+
+ astParser = new LlvmAstParser(compilerProps);
+ astDump = utils.splitLines(fs.readFileSync('test/ast/bug-3849b.ast').toString());
+ compilerOutput = mockAstOutput(astDump);
+ });
+
+ it('should have not too many lines', () => {
+ let processed = astParser.processAst(compilerOutput);
+ processed.length.should.be.above(200);
+ processed.length.should.be.below(300);
+ });
+});