diff options
author | Vedant Kumar <vsk@apple.com> | 2019-07-11 00:09:16 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2019-07-11 00:09:16 +0000 |
commit | c272d4e6deaeb32baa1b73087fb3f5f53b966d88 (patch) | |
tree | 37712aeff8e6eb18ce54dccff4874eb1f625014d /test | |
parent | 5a6de7ede58f89a0cd31ac8b8e297514baab3abd (diff) | |
download | clang-c272d4e6deaeb32baa1b73087fb3f5f53b966d88.tar.gz |
[CGDebugInfo] Fix -femit-debug-entry-values crash on os_log_helpers
An os_log_helper FunctionDecl may not have a body. Ignore these for the
purposes of debug entry value emission.
Fixes an assertion failure seen in a stage2 build of clang:
Assertion failed: (FD->hasBody() && "Functions must have body here"),
function analyzeParametersModification
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/debug-info-param-modification.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/CodeGen/debug-info-param-modification.c b/test/CodeGen/debug-info-param-modification.c index ef7ff92256..f2aa4c7290 100644 --- a/test/CodeGen/debug-info-param-modification.c +++ b/test/CodeGen/debug-info-param-modification.c @@ -1,12 +1,21 @@ -// RUN: %clang -Xclang -femit-debug-entry-values -g -O2 -S -target x86_64-none-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK-ENTRY-VAL-OPT +// RUN: %clang -Xclang -femit-debug-entry-values -g -O2 -Xclang -disable-llvm-passes -S -target x86_64-none-linux-gnu -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK-ENTRY-VAL-OPT // CHECK-ENTRY-VAL-OPT: !DILocalVariable(name: "a", arg: 1, scope: {{.*}}, file: {{.*}}, line: {{.*}}, type: {{.*}}) // CHECK-ENTRY-VAL-OPT: !DILocalVariable(name: "b", arg: 2, scope: {{.*}}, file: {{.*}}, line: {{.*}}, type: {{.*}}, flags: DIFlagArgumentNotModified) // -// RUN: %clang -g -O2 -target x86_64-none-linux-gnu -S -emit-llvm %s -o - | FileCheck %s +// For the os_log_helper: +// CHECK-ENTRY-VAL-OPT: !DILocalVariable(name: "buffer", arg: 1, {{.*}}, flags: DIFlagArtificial) +// +// RUN: %clang -g -O2 -Xclang -disable-llvm-passes -target x86_64-none-linux-gnu -S -emit-llvm %s -o - | FileCheck %s // CHECK-NOT: !DILocalVariable(name: "b", arg: 2, scope: {{.*}}, file: {{.*}}, line: {{.*}}, type: {{.*}}, flags: DIFlagArgumentNotModified) // +// For the os_log_helper: +// CHECK: !DILocalVariable(name: "buffer", arg: 1, {{.*}}, flags: DIFlagArtificial) int fn2 (int a, int b) { ++a; return b; } + +void test_builtin_os_log(void *buf, int i, const char *data) { + __builtin_os_log_format(buf, "%d %{public}s %{private}.16P", i, data, data); +} |