xref: /llvm-project/llvm/test/tools/llvm-objdump/X86/source-interleave-invalid-source.test (revision 71e2ca6e32105b35aeadeab25010e8f999c47c23)
1e51b9e42SJames Henderson## Test llvm-objdump's --source behaviour when a line number is greater than the
29abf668cSMichael Pozulp## file length and ensure that we emit a warning.
3e51b9e42SJames Henderson
4e51b9e42SJames Henderson# RUN: sed -e "s,SRC_COMPDIR,%/p/Inputs,g" %p/Inputs/source-interleave.ll > %t.ll
5e51b9e42SJames Henderson# RUN: sed -e "s,line: 7,line: 9999,g" %t.ll > %t2.ll
6e51b9e42SJames Henderson
7e51b9e42SJames Henderson# RUN: llc -o %t.o -filetype=obj -mtriple=x86_64-pc-linux %t.ll
8e51b9e42SJames Henderson# RUN: llc -o %t2.o -filetype=obj -mtriple=x86_64-pc-linux %t2.ll
9e51b9e42SJames Henderson
10e51b9e42SJames Henderson# RUN: llvm-objdump --source %t.o | FileCheck %s --check-prefixes=CHECK,GOOD
119abf668cSMichael Pozulp# RUN: llvm-objdump --source %t2.o 2> %t2.e | FileCheck %s --check-prefixes=CHECK --implicit-check-not="int *b = &a;"
129abf668cSMichael Pozulp# RUN: FileCheck %s --input-file %t2.e --check-prefixes=WARN
13e51b9e42SJames Henderson
14*71e2ca6eSFangrui Song# CHECK:      <main>:
15e51b9e42SJames Henderson# CHECK-NEXT: ; int main() {
16f0f38d9bSGeorge Rimar# WARN:       warning: '{{.*}}': debug info line number 9999 exceeds the number of lines in {{.*}}source-interleave-x86_64.c
17e51b9e42SJames Henderson# GOOD:       ;   int *b = &a;
18e51b9e42SJames Henderson# CHECK:      ;   return *b + foo();
19