| 1 |
// Check that DebugLoc attached to a builtin call is preserved after translation. |
| 2 |
|
| 3 |
// RUN: %clang_cc1 -triple spir -fdeclare-opencl-builtins -finclude-default-header %s -disable-llvm-passes -emit-llvm-bc -debug-info-kind=line-tables-only -o %t.bc |
| 4 |
// RUN: llvm-spirv %t.bc -spirv-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 5 |
// RUN: llvm-spirv %t.bc -o %t.spv |
| 6 |
// RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM |
| 7 |
|
| 8 |
// CHECK-SPIRV: Label |
| 9 |
// CHECK-SPIRV: ExtInst {{.*}} DebugScope |
| 10 |
// CHECK-SPIRV: ExtInst {{.*}} sin |
| 11 |
// CHECK-LLVM: call spir_func float @_Z3sinf(float %{{.*}}) {{.*}} !dbg ![[loc:[0-9]+]] |
| 12 |
// CHECK-LLVM: ![[loc]] = !DILocation(line: 14, column: 10, scope: !{{.*}}) |
| 13 |
float f(float x) { |
| 14 |
return sin(x); |
| 15 |
} |