aboutsummaryrefslogtreecommitdiff
path: root/libphobos/testsuite/libphobos.exceptions/line_trace.d
blob: 70762ff227c597aeec8265399cbff8b4cb6d1ed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { dg-output "object.Exception@.*: exception" }
void main()
{
    try
    {
        f1();
    }
    catch (Exception e)
    {
        import core.stdc.stdio;
        auto str = e.toString();
        printf("%.*s\n", cast(int)str.length, str.ptr);
    }
}

void f1()
{
    throw new Exception("exception");
}