1// RUN: %clang %s -O0 -emit-llvm -S -o - | FileCheck %s
2
3// This should call rb_define_global_function, not rb_f_chop.
4void rb_define_global_function (const char*,void(*)(),int);
5static void rb_f_chop();
6void Init_String() {
7  rb_define_global_function("chop", rb_f_chop, 0);
8}
9static void rb_f_chop() {
10}
11
12// CHECK: call{{.*}}rb_define_global_function
13
14// PR10335
15typedef   void (* JSErrorCallback)(void);
16void js_GetErrorMessage(void);
17void JS_ReportErrorNumber(JSErrorCallback errorCallback, ...);
18void Interpret() {
19  JS_ReportErrorNumber(js_GetErrorMessage, 0);
20
21  // CHECK: call void ({{.*}}, ...)* @JS_ReportErrorNumber({{.*}}@js_GetErrorMessage
22}
23
24
25
26
27// PR10337
28struct sigaction { int (*_sa_handler)(int); };
29typedef int SigHandler ();
30typedef struct sigaction sighandler_cxt;
31SigHandler *rl_set_sighandler(ohandler)
32sighandler_cxt *ohandler;  {
33  return 0;
34}
35
36void rl_set_signals() {
37  SigHandler *oh;
38  oh = rl_set_sighandler(0);
39}
40