Using gprof with clang


I was trying to profile some C-code using clang.
This was the actual line:
clang -flto -g -pg a.o b.o -o test
but the ‘-pg’ flag was unused.

I found an archive from January 2011 that says that clang does not support gprof profiling:
The error mentioned in that is different, so I have a feeling the issue mentioned there has been resolved since then.

I looked at the current clang documentation and it says that:
‘-pg’ Enables mcount instrumentation.

I was wondering if I could get some assistance with profiling code using clang.