mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 05:58:01 -06:00
Better match gcc compilers
Allows for `foo-bar-gcc` & friends to match with gcc familly. Unlocks graph display with compilers others than native ones.
This commit is contained in:
@@ -610,9 +610,8 @@ class BaseCompiler {
|
||||
|
||||
isCfgCompiler(compilerVersion) {
|
||||
return compilerVersion.includes("clang") ||
|
||||
compilerVersion.indexOf("g++") === 0 ||
|
||||
compilerVersion.indexOf("gcc") === 0 ||
|
||||
compilerVersion.indexOf("gdc") === 0;
|
||||
compilerVersion.match(/^([\w-]*-)?g((\+\+)|(cc)|(dc))/g) !== null;
|
||||
|
||||
}
|
||||
|
||||
processAstOutput(output) {
|
||||
|
||||
@@ -64,6 +64,10 @@ describe('Basic compiler invariants', function () {
|
||||
compiler.isCfgCompiler("g++ (GCC-Explorer-Build) 8.0.1 20180223 (experimental)").should.equal(true);
|
||||
compiler.isCfgCompiler("g++ (GCC) 4.1.2").should.equal(true);
|
||||
|
||||
compiler.isCfgCompiler("foo-bar-g++ (GCC-Explorer-Build) 4.9.4").should.equal(true);
|
||||
compiler.isCfgCompiler("foo-bar-gcc (GCC-Explorer-Build) 4.9.4").should.equal(true);
|
||||
compiler.isCfgCompiler("foo-bar-gdc (GCC-Explorer-Build) 4.9.4").should.equal(true);
|
||||
|
||||
compiler.isCfgCompiler("fake-for-test (Based on g++)").should.equal(false);
|
||||
|
||||
compiler.isCfgCompiler("gdc (crosstool-NG 203be35 - 20160205-2.066.1-e95a735b97) 5.2.0").should.equal(true);
|
||||
|
||||
Reference in New Issue
Block a user