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