1*7c1d9b15SFangrui Song // RUN: %clang_cc1 -triple x86_64-linux -verify -emit-llvm-only %s
2*7c1d9b15SFangrui Song // RUN: %clang_cc1 -triple x86_64-apple-macosx -verify -emit-llvm-only %s
3*7c1d9b15SFangrui Song // RUN: %clang_cc1 -triple arm64-apple-macosx -verify -emit-llvm-only %s
49306ef97SDhruv Chawla // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
5acf9aa3cSJon Roelofs // RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
6acf9aa3cSJon Roelofs // RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
79306ef97SDhruv Chawla
f1_ifunc(void)89306ef97SDhruv Chawla void *f1_ifunc(void) { return nullptr; }
99306ef97SDhruv Chawla void f1(void) __attribute__((ifunc("f1_ifunc")));
109306ef97SDhruv Chawla // expected-error@-1 {{ifunc must point to a defined function}}
119306ef97SDhruv Chawla // expected-note@-2 {{must refer to its mangled name}}
129306ef97SDhruv Chawla // expected-note@-3 {{function by that name is mangled as}}
139306ef97SDhruv Chawla // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:30-[[@LINE-4]]:47}:"ifunc(\"_Z8f1_ifuncv\")"
149306ef97SDhruv Chawla
f6_resolver_resolver(void)159306ef97SDhruv Chawla void *f6_resolver_resolver(void) { return 0; }
169306ef97SDhruv Chawla void *f6_resolver(void) __attribute__((ifunc("f6_resolver_resolver")));
179306ef97SDhruv Chawla // expected-error@-1 {{ifunc must point to a defined function}}
189306ef97SDhruv Chawla // expected-note@-2 {{must refer to its mangled name}}
199306ef97SDhruv Chawla // expected-note@-3 {{function by that name is mangled as}}
209306ef97SDhruv Chawla // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:40-[[@LINE-4]]:69}:"ifunc(\"_Z20f6_resolver_resolverv\")"
219306ef97SDhruv Chawla void f6(void) __attribute__((ifunc("f6_resolver")));
229306ef97SDhruv Chawla // expected-error@-1 {{ifunc must point to a defined function}}
239306ef97SDhruv Chawla // expected-note@-2 {{must refer to its mangled name}}
249306ef97SDhruv Chawla // expected-note@-3 {{function by that name is mangled as}}
259306ef97SDhruv Chawla // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:30-[[@LINE-4]]:50}:"ifunc(\"_Z11f6_resolverv\")"
269306ef97SDhruv Chawla
279306ef97SDhruv Chawla __attribute__((unused, ifunc("resolver"), deprecated("hahahaha, isn't C great?")))
289306ef97SDhruv Chawla void func();
299306ef97SDhruv Chawla // expected-error@-2 {{ifunc must point to a defined function}}
309306ef97SDhruv Chawla // expected-note@-3 {{must refer to its mangled name}}
319306ef97SDhruv Chawla
32