mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-30 21:25:00 +01:00
The source line debug info generation assumed that the function would have debug info. Check for a non-null di_subprogram_ to ensure we are emitting debug info for the function. Rather than checking the di_builder_ - this way if we implement `nodebug` function attributes, it'll fall out naturally (by creating a null di_subprogram_) rather than having to come back and change this from "is debug info enabled" to "is debug info enabled for this function" later on.
23 lines
885 B
Plaintext
23 lines
885 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// ARGS: compile --no-debug-info --phase=lower --dump-llvm-ir --output=- --exclude-dump-file-prefix=%{core_package_dir} %s
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/debug/nodebug.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/debug/nodebug.carbon
|
|
|
|
fn F() {
|
|
}
|
|
|
|
// CHECK:STDOUT: ; ModuleID = 'nodebug.carbon'
|
|
// CHECK:STDOUT: source_filename = "nodebug.carbon"
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: define void @F() {
|
|
// CHECK:STDOUT: entry:
|
|
// CHECK:STDOUT: ret void
|
|
// CHECK:STDOUT: }
|