mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-01 17:16:06 +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.
12 lines
568 B
C
12 lines
568 B
C
// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name casts.c %s | FileCheck %s
|
|
|
|
int main(void) { // CHECK: File 0, [[@LINE]]:16 -> [[@LINE+4]]:2 = #0
|
|
// CHECK: File 0, [[@LINE+1]]:41 -> [[@LINE+1]]:54 = #1
|
|
int window_size = (sizeof(int) <= 2 ? (unsigned)512 : 1024); // CHECK-NEXT: File 0, [[@LINE]]:57 -> [[@LINE]]:61 = (#0 - #1)
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|