Changeset View
Changeset View
Standalone View
Standalone View
languages/clang/tests/test_duchain.cpp
Show First 20 Lines • Show All 1566 Lines • ▼ Show 20 Line(s) | 1566 | if (checked.contains(importedTop)) { | |||
---|---|---|---|---|---|
1567 | continue; | 1567 | continue; | ||
1568 | } | 1568 | } | ||
1569 | checked.insert(importedTop); | 1569 | checked.insert(importedTop); | ||
1570 | verifyNoErrors(importedTop, checked); | 1570 | verifyNoErrors(importedTop, checked); | ||
1571 | } | 1571 | } | ||
1572 | } | 1572 | } | ||
1573 | 1573 | | |||
1574 | void TestDUChain::testGccCompatibility() | 1574 | void TestDUChain::testGccCompatibility() | ||
1575 | { | 1575 | { | ||
mwolff: This should stay at .c. Actually, we should probably now run the test twice - once for .c and… | |||||
1576 | // TODO: make it easier to change the compiler provider for testing purposes | 1576 | // TODO: make it easier to change the compiler provider for testing purposes | ||
1577 | QTemporaryDir dir; | 1577 | QTemporaryDir dir; | ||
1578 | auto project = new TestProject(Path(dir.path()), this); | 1578 | auto project = new TestProject(Path(dir.path()), this); | ||
1579 | auto definesAndIncludesConfig = project->projectConfiguration()->group("CustomDefinesAndIncludes"); | 1579 | auto definesAndIncludesConfig = project->projectConfiguration()->group("CustomDefinesAndIncludes"); | ||
1580 | auto pathConfig = definesAndIncludesConfig.group("ProjectPath0"); | 1580 | auto pathConfig = definesAndIncludesConfig.group("ProjectPath0"); | ||
1581 | pathConfig.writeEntry("Path", "."); | 1581 | pathConfig.writeEntry("Path", "."); | ||
1582 | pathConfig.group("Compiler").writeEntry("Name", "GCC"); | 1582 | pathConfig.group("Compiler").writeEntry("Name", "GCC"); | ||
1583 | m_projectController->addProject(project); | 1583 | m_projectController->addProject(project); | ||
1584 | 1584 | | |||
1585 | { | 1585 | { | ||
1586 | // TODO: Also test in C mode. Currently it doesn't work (some intrinsics missing?) | ||||
1586 | TestFile file(R"( | 1587 | TestFile file(R"( | ||
1587 | #include <x86intrin.h> | 1588 | #include <x86intrin.h> | ||
1588 | 1589 | | |||
1589 | int main() { return 0; } | 1590 | int main() { return 0; } | ||
1590 | )", "c", project, dir.path()); | 1591 | )", "cpp", project, dir.path()); | ||
1591 | 1592 | | |||
1592 | file.parse(); | 1593 | file.parse(); | ||
1593 | QVERIFY(file.waitForParsed(5000)); | 1594 | QVERIFY(file.waitForParsed(5000)); | ||
1594 | 1595 | | |||
1595 | DUChainReadLocker lock; | 1596 | DUChainReadLocker lock; | ||
1596 | QSet<TopDUContext*> checked; | 1597 | QSet<TopDUContext*> checked; | ||
1597 | verifyNoErrors(file.topContext(), checked); | 1598 | verifyNoErrors(file.topContext(), checked); | ||
1598 | } | 1599 | } | ||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |
This should stay at .c. Actually, we should probably now run the test twice - once for .c and once for .cpp.