about debug

I wish to get the line number of source code in IR code. And I know that debuginfo.h will suit to me. However, I met some problem about using the -g option.
I have writtern a pass ,but I don’t know how to run the pass with debug information. While I want to get the bc file with the debug information ,I have to use the
command “llvm-gcc -g -c -emit-llvm test.c -o test.bc”. But I don’t know what to do next. I try to run the command “lli test.bc”. It will run error as follow
0 lli 0x0864a9d9
Stack dump:
0. Program arguments: lli t2.bc

  1. Running pass ‘X86 Machine Code Emitter’ on function ‘@main’
    If you follow the steps above ,there will be an error for all the test file .Would you please explain the right steps for me?