| 1 | // Tests that we can evaluate functions that Clang |
| 2 | // classifies as having clang::Linkage::UniqueExternal |
| 3 | // linkage. In this case, a function whose argument |
| 4 | // is not legally usable outside this TU. |
| 5 | |
| 6 | // XFAIL: target-windows |
| 7 | |
| 8 | // RUN: %build %s -o %t |
| 9 | // RUN: %lldb %t -o run -o "expression func(a)" -o exit | FileCheck %s |
| 10 | |
| 11 | // CHECK: expression func(a) |
| 12 | // CHECK: (int) $0 = 15 |
| 13 | |
| 14 | namespace { |
| 15 | struct InAnon {}; |
| 16 | } // namespace |
| 17 | |
| 18 | int func(InAnon a) { return 15; } |
| 19 | |
| 20 | int main() { |
| 21 | InAnon a; |
| 22 | __builtin_debugtrap(); |
| 23 | return func(a); |
| 24 | } |
| 25 | |