Skip to content

Commit c8d099f

Browse files
authored
Merge pull request #6856 from apple/bugfix/bitfield-after-vptr-lldb-to-5.9
[cherry-pick][swift/release/5.9] [lldb][Test] Fix TestFrameFormatNameWithArgs.test on Linux
2 parents 7557a46 + dd918d8 commit c8d099f

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
#include <functional>
2-
31
namespace detail {
42
template <typename T> struct Quux {};
53
} // namespace detail
64

75
using FuncPtr = detail::Quux<double> (*(*)(int))(float);
86

97
struct Foo {
10-
template <typename T> void foo(T const &t) const noexcept(true) {}
8+
template <typename T> void foo(T arg) const noexcept(true) {}
119

12-
template <size_t T> void operator<<(size_t) {}
10+
template <int T> void operator<<(int) {}
1311

1412
template <typename T> FuncPtr returns_func_ptr(detail::Quux<int> &&) const noexcept(false) { return nullptr; }
1513
};
1614

1715
namespace ns {
18-
template <typename T> int foo(T const &t) noexcept(false) { return 0; }
16+
template <typename T> int foo(char const *str) noexcept(false) { return 0; }
17+
template <typename T> int foo(T t) { return 1; }
1918

2019
template <typename T> FuncPtr returns_func_ptr(detail::Quux<int> &&) { return nullptr; }
2120
} // namespace ns
@@ -24,20 +23,20 @@ int bar() { return 1; }
2423

2524
namespace {
2625
int anon_bar() { return 1; }
27-
auto anon_lambda = [](std::function<int(int (*)(int))>) mutable {};
26+
auto anon_lambda = [] {};
2827
} // namespace
2928

3029
int main() {
31-
ns::foo(bar);
32-
ns::foo(std::function{bar});
30+
ns::foo<decltype(bar)>(bar);
31+
ns::foo<decltype(bar)>("bar");
3332
ns::foo(anon_lambda);
34-
ns::foo(std::function{anon_bar});
35-
ns::foo(&Foo::foo<std::function<int(int)>>);
33+
ns::foo(anon_bar);
34+
ns::foo<decltype(&Foo::foo<int(int)>)>("method");
3635
ns::returns_func_ptr<int>(detail::Quux<int>{});
3736
Foo f;
38-
f.foo(std::function{bar});
39-
f.foo(std::function{anon_bar});
37+
f.foo(anon_bar);
4038
f.operator<< <(2 > 1)>(0);
4139
f.returns_func_ptr<int>(detail::Quux<int>{});
40+
4241
return 0;
4342
}
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# UNSUPPORTED: system-windows
12
# RUN: %clangxx_host -g -O0 %S/Inputs/names.cpp -std=c++17 -o %t.out
23
# RUN: %lldb -b -s %s %t.out | FileCheck %s
34
settings set -f frame-format "frame ${function.name-with-args}\n"
@@ -7,21 +8,19 @@ break set -n returns_func_ptr
78
run
89
# CHECK: frame int ns::foo<int ()>(t={{.*}})
910
c
10-
# CHECK: frame int ns::foo<std::__1::function<int ()>>(t= Function = bar() )
11+
# CHECK: frame int ns::foo<int ()>(str="bar")
1112
c
12-
# CHECK: frame int ns::foo<(anonymous namespace)::$_0>(t={{.*}})
13+
# CHECK: frame int ns::foo<(anonymous namespace)::$_0>(t=(anonymous namespace)::(unnamed class) @ {{.*}})
1314
c
14-
# CHECK: frame int ns::foo<std::__1::function<int ()>>(t= Function = (anonymous namespace)::anon_bar() )
15+
# CHECK: frame int ns::foo<int (*)()>(t=({{.*}}`(anonymous namespace)::anon_bar() at {{.*}}))
1516
c
16-
# CHECK: frame int ns::foo<void (Foo::*)(std::__1::function<int (int)> const&) const noexcept>(t={{.*}})
17+
# CHECK: frame int ns::foo<void (Foo::*)(int (*)(int)) const noexcept>(str="method")
1718
c
1819
# CHECK: frame ns::returns_func_ptr<int>((null)={{.*}})
1920
c
20-
# CHECK: frame void Foo::foo<std::__1::function<int ()>>(this={{.*}}, t= Function = bar() ) const
21+
# CHECK: frame void Foo::foo<int (*)()>(this={{.*}}, arg=({{.*}}`(anonymous namespace)::anon_bar() at {{.*}}))
2122
c
22-
# CHECK: frame void Foo::foo<std::__1::function<int ()>>(this={{.*}}, t= Function = (anonymous namespace)::anon_bar() ) const
23-
c
24-
# CHECK: frame void Foo::operator<<<1ul>(this={{.*}}, (null)=0)
23+
# CHECK: frame void Foo::operator<<<1>(this={{.*}}, (null)=0)
2524
c
2625
# CHECK: frame Foo::returns_func_ptr<int>(this={{.*}}, (null)={{.*}})
2726
q

0 commit comments

Comments
 (0)