summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2017-04-02 13:41:33 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-04 13:35:39 (GMT)
commit87199ea66b171708736e85989bf9b0af89a805c1 (patch)
tree14705eb749251f45f58fefcdd1dd96a218079907 /Tests
parentc92fd25661c08ff991a2482b8a5e42c8490cb3c2 (diff)
downloadCMake-87199ea66b171708736e85989bf9b0af89a805c1.zip
CMake-87199ea66b171708736e85989bf9b0af89a805c1.tar.gz
CMake-87199ea66b171708736e85989bf9b0af89a805c1.tar.bz2
CheckIPOSupported: Add Fortran support
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CheckIPOSupported/user-lang-fortran-result.txt1
-rw-r--r--Tests/RunCMake/CheckIPOSupported/user-lang-fortran-stderr.txt6
-rw-r--r--Tests/RunCMake/CheckIPOSupported/user-lang-fortran.cmake1
4 files changed, 0 insertions, 9 deletions
diff --git a/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake
index 812f79b..588a75d 100644
--- a/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CheckIPOSupported/RunCMakeTest.cmake
@@ -2,7 +2,6 @@ include(RunCMake)
run_cmake(unparsed-arguments)
run_cmake(user-lang-unknown)
-run_cmake(user-lang-fortran)
run_cmake(default-lang-none)
run_cmake(not-supported-by-cmake)
run_cmake(not-supported-by-compiler)
diff --git a/Tests/RunCMake/CheckIPOSupported/user-lang-fortran-result.txt b/Tests/RunCMake/CheckIPOSupported/user-lang-fortran-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/CheckIPOSupported/user-lang-fortran-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/CheckIPOSupported/user-lang-fortran-stderr.txt b/Tests/RunCMake/CheckIPOSupported/user-lang-fortran-stderr.txt
deleted file mode 100644
index 2cb595d..0000000
--- a/Tests/RunCMake/CheckIPOSupported/user-lang-fortran-stderr.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
- IPO is not supported \(Fortran is not supported\)\.
-Call Stack \(most recent call first\):
- .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(_ipo_not_supported\)
- user-lang-fortran\.cmake:[0-9]+ \(check_ipo_supported\)
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CheckIPOSupported/user-lang-fortran.cmake b/Tests/RunCMake/CheckIPOSupported/user-lang-fortran.cmake
deleted file mode 100644
index 275dbd9..0000000
--- a/Tests/RunCMake/CheckIPOSupported/user-lang-fortran.cmake
+++ /dev/null
@@ -1 +0,0 @@
-check_ipo_supported(LANGUAGES "Fortran")
class="hl opt">* PointerType; typedef T& ReferenceType; public: class iterator : public std::iterator<std::forward_iterator_tag, T> { friend class cmLinkedTree; cmLinkedTree* Tree; // The Position is always 'one past the end'. PositionType Position; iterator(cmLinkedTree* tree, PositionType pos) : Tree(tree) , Position(pos) { } public: iterator() : Tree(nullptr) , Position(0) { } void operator++() { assert(this->Tree); assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); assert(this->Position <= this->Tree->Data.size()); assert(this->Position > 0); this->Position = this->Tree->UpPositions[this->Position - 1]; } PointerType operator->() const { assert(this->Tree); assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); assert(this->Position <= this->Tree->Data.size()); assert(this->Position > 0); return this->Tree->GetPointer(this->Position - 1); } PointerType operator->() { assert(this->Tree); assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); assert(this->Position <= this->Tree->Data.size()); assert(this->Position > 0); return this->Tree->GetPointer(this->Position - 1); } ReferenceType operator*() const { assert(this->Tree); assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); assert(this->Position <= this->Tree->Data.size()); assert(this->Position > 0); return this->Tree->GetReference(this->Position - 1); } ReferenceType operator*() { assert(this->Tree); assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); assert(this->Position <= this->Tree->Data.size()); assert(this->Position > 0); return this->Tree->GetReference(this->Position - 1); } bool operator==(iterator other) const { assert(this->Tree); assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); assert(this->Tree == other.Tree); return this->Position == other.Position; } bool operator!=(iterator other) const { assert(this->Tree); assert(this->Tree->UpPositions.size() == this->Tree->Data.size()); return !(*this == other); } bool IsValid() const { if (!this->Tree) { return false; } return this->Position <= this->Tree->Data.size(); } bool StrictWeakOrdered(iterator other) const { assert(this->Tree); assert(this->Tree == other.Tree); return this->Position < other.Position; } }; iterator Root() const { return iterator(const_cast<cmLinkedTree*>(this), 0); } iterator Push(iterator it) { return Push_impl(it, T()); } iterator Push(iterator it, T t) { return Push_impl(it, t); } bool IsLast(iterator it) { return it.Position == this->Data.size(); } iterator Pop(iterator it) { assert(!this->Data.empty()); assert(this->UpPositions.size() == this->Data.size()); bool const isLast = this->IsLast(it); ++it; // If this is the last entry then no other entry can refer // to it so we can drop its storage. if (isLast) { this->Data.pop_back(); this->UpPositions.pop_back(); } return it; } iterator Truncate() { assert(!this->UpPositions.empty()); this->UpPositions.erase(this->UpPositions.begin() + 1, this->UpPositions.end()); assert(!this->Data.empty()); this->Data.erase(this->Data.begin() + 1, this->Data.end()); return iterator(this, 1); } void Clear() { this->UpPositions.clear(); this->Data.clear(); } private: T& GetReference(PositionType pos) { return this->Data[pos]; } T* GetPointer(PositionType pos) { return &this->Data[pos]; } iterator Push_impl(iterator it, T t) { assert(this->UpPositions.size() == this->Data.size()); assert(it.Position <= this->UpPositions.size()); this->UpPositions.push_back(it.Position); this->Data.push_back(t); return iterator(this, this->UpPositions.size()); } std::vector<T> Data; std::vector<PositionType> UpPositions; }; #endif