Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / input.output / filesystems / class.rec.dir.itr / rec.dir.itr.members / disable_recursion_pending.pass.cpp
blobbb6ff41b5bce6b42fdf11926695a066db1d9cb5b
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
10 // UNSUPPORTED: no-filesystem
11 // UNSUPPORTED: availability-filesystem-missing
13 // <filesystem>
15 // class recursive_directory_iterator
17 // void disable_recursion_pending();
19 #include "filesystem_include.h"
20 #include <type_traits>
21 #include <set>
22 #include <cassert>
24 #include "test_macros.h"
25 #include "filesystem_test_helper.h"
27 using namespace fs;
30 // NOTE: The main semantics of disable_recursion_pending are tested
31 // in the 'recursion_pending()' tests.
32 static void basic_test()
34 static_test_env static_env;
35 recursive_directory_iterator it(static_env.Dir);
36 assert(it.recursion_pending() == true);
37 it.disable_recursion_pending();
38 assert(it.recursion_pending() == false);
39 it.disable_recursion_pending();
40 assert(it.recursion_pending() == false);
43 int main(int, char**) {
44 basic_test();
46 return 0;