mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 14:46:07 +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 eleventh batch of tests being updated (there are a significant number of other tests left to be updated).
45 lines
1.1 KiB
C
45 lines
1.1 KiB
C
// RUN: %clang_cc1 -x c %s -triple x86_64-linux-gnu -emit-llvm -o - | FileCheck %s
|
|
// RUN: %clang_cc1 -x c++ %s -triple x86_64-linux-gnu -emit-llvm -o - | FileCheck %s
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct __jmp_buf_tag { int n; };
|
|
int setjmp(struct __jmp_buf_tag*);
|
|
int sigsetjmp(struct __jmp_buf_tag*, int);
|
|
int _setjmp(struct __jmp_buf_tag*);
|
|
int __sigsetjmp(struct __jmp_buf_tag*, int);
|
|
|
|
typedef struct __jmp_buf_tag jmp_buf[1];
|
|
typedef struct __jmp_buf_tag sigjmp_buf[1];
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
void f(void) {
|
|
jmp_buf jb;
|
|
// CHECK: call {{.*}}@setjmp(
|
|
setjmp(jb);
|
|
// CHECK: call {{.*}}@sigsetjmp(
|
|
sigsetjmp(jb, 0);
|
|
// CHECK: call {{.*}}@_setjmp(
|
|
_setjmp(jb);
|
|
// CHECK: call {{.*}}@__sigsetjmp(
|
|
__sigsetjmp(jb, 0);
|
|
}
|
|
|
|
// CHECK: ; Function Attrs: returns_twice
|
|
// CHECK-NEXT: declare {{.*}} @setjmp(
|
|
|
|
// CHECK: ; Function Attrs: returns_twice
|
|
// CHECK-NEXT: declare {{.*}} @sigsetjmp(
|
|
|
|
// CHECK: ; Function Attrs: returns_twice
|
|
// CHECK-NEXT: declare {{.*}} @_setjmp(
|
|
|
|
// CHECK: ; Function Attrs: returns_twice
|
|
// CHECK-NEXT: declare {{.*}} @__sigsetjmp(
|
|
|