Amy Huang | ab76cfd | 2019-10-31 09:15:53 -0700 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited \ |
| 2 | // RUN: -gno-inline-line-tables -emit-llvm -o - %s | FileCheck %s |
| 3 | // RUN: %clang -gno-inline-line-tables -S -emit-llvm -o - %s | FileCheck %s \ |
| 4 | // RUN: -check-prefix=INLINE-FLAG |
| 5 | // RUN: %clang -S -emit-llvm -o - %s | FileCheck %s -check-prefix=NO-FLAG |
| 6 | |
| 7 | int x; |
| 8 | __attribute((always_inline)) void f() { |
| 9 | x += 1; |
| 10 | } |
| 11 | int main() { |
| 12 | f(); |
| 13 | x += 2; |
| 14 | return x; |
| 15 | } |
| 16 | |
| 17 | // Check that clang emits the location of the call site and not the inlined |
| 18 | // function in the debug info. |
| 19 | // CHECK: define dso_local i32 @main() |
| 20 | // CHECK: %{{.+}} = load i32, i32* @x, align 4, !dbg [[DbgLoc:![0-9]+]] |
| 21 | |
| 22 | // Check that the no-inline-line-tables attribute is added. |
| 23 | // CHECK: attributes #0 = {{.*}}"no-inline-line-tables"{{.*}} |
| 24 | // CHECK: attributes #1 = {{.*}}"no-inline-line-tables"{{.*}} |
| 25 | |
| 26 | // CHECK: [[DbgLoc]] = !DILocation(line: 12, |
| 27 | // CHECK-NOT: inlinedAt: |
| 28 | |
| 29 | // INLINE-FLAG: attributes #0 = {{.*}}"no-inline-line-tables"{{.*}} |
| 30 | // INLINE-FLAG: attributes #1 = {{.*}}"no-inline-line-tables"{{.*}} |
| 31 | // NO-FLAG-NOT: "no-inline-line-tables" |