• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Test llvm-objdump's --source behaviour when a line number is greater than the
2## file length and ensure that we emit a warning.
3
4# RUN: sed -e "s,SRC_COMPDIR,%/p/Inputs,g" %p/Inputs/source-interleave.ll > %t.ll
5# RUN: sed -e "s,line: 7,line: 9999,g" %t.ll > %t2.ll
6
7# RUN: llc -o %t.o -filetype=obj -mtriple=x86_64-pc-linux %t.ll
8# RUN: llc -o %t2.o -filetype=obj -mtriple=x86_64-pc-linux %t2.ll
9
10# RUN: llvm-objdump --source %t.o | FileCheck %s --check-prefixes=CHECK,GOOD
11# RUN: llvm-objdump --source %t2.o 2> %t2.e | FileCheck %s --check-prefixes=CHECK --implicit-check-not="int *b = &a;"
12# RUN: FileCheck %s --input-file %t2.e --check-prefixes=WARN
13
14# CHECK:      <main>:
15# CHECK-NEXT: ; int main() {
16# WARN:       warning: '{{.*}}': debug info line number 9999 exceeds the number of lines in {{.*}}source-interleave-x86_64.c
17# GOOD:       ;   int *b = &a;
18# CHECK:      ;   return *b + foo();
19