Aaron Ballman ed509fe296 Use functions with prototypes when appropriate; NFC
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 tenth batch of tests being updated (there are a
significant number of other tests left to be updated).
2022-02-15 09:28:02 -05:00

22 lines
573 B
C

// RUN: %clang_cc1 -emit-llvm -triple x86_64 %s -o - | FileCheck %s --check-prefixes=CHECK,CUSED
// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin %s -o - | FileCheck %s --check-prefixes=CHECK,USED
// USED: @llvm.used =
// CUSED: @llvm.compiler.used =
// CHECK-SAME: @f0
// CHECK-SAME: @f1.l0
// CHECK-SAME: @g0
// CHECK-SAME: @a0
int g0 __attribute__((used));
static void __attribute__((used)) f0(void) {
}
void f1(void) {
static int l0 __attribute__((used)) = 5225;
}
__attribute__((used)) int a0;
void pr27535(void) { (void)a0; }