mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-13 17:37:00 +00:00

A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the fifth batch of tests being updated (there are a significant number of other tests left to be updated). Note, the behavior of -ast-print is broken. It prints functions with a prototype (void) as if they have no prototype () in C. Some tests need to disable strict prototype checking when recompiling the results of an -ast-print invocation.
20 lines
890 B
C++
20 lines
890 B
C++
// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -mllvm -enable-name-compression=false -emit-llvm -main-file-name abspath.cpp %S/Inputs/../abspath.cpp -o - | FileCheck -check-prefix=RMDOTS %s
|
|
|
|
// RMDOTS: @__llvm_coverage_mapping = {{.*}}"\02
|
|
// RMDOTS-NOT: Inputs
|
|
// RMDOTS: "
|
|
|
|
// RUN: mkdir -p %t/test && cd %t/test
|
|
// RUN: echo "void f1(void) {}" > f1.c
|
|
// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -mllvm -enable-name-compression=false -emit-llvm -main-file-name abspath.cpp %t/test/f1.c -o - | FileCheck -check-prefix=ABSPATH %s
|
|
|
|
// RELPATH: @__llvm_coverage_mapping = {{.*}}"\02
|
|
// RELPATH: {{..(/|\\\\)test(/|\\\\)f1}}.c
|
|
// RELPATH: "
|
|
|
|
// ABSPATH: @__llvm_coverage_mapping = {{.*}}"\02
|
|
// ABSPATH: {{[/\\].*(/|\\\\)test(/|\\\\)f1}}.c
|
|
// ABSPATH: "
|
|
|
|
void f1(void) {}
|