1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s -DNO_CALLER_SAVED_REGISTERS=1
3 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature -x87 -target-feature -mmx -target-feature -sse -fsyntax-only -verify %s -DGPRONLY=1
5 #if defined(NO_CALLER_SAVED_REGS) || defined(GPRONLY)
6 // expected-no-diagnostics
11 #ifdef NO_CALLER_SAVED_REGS
12 __attribute__((no_caller_saved_registers
))
15 // expected-note@+3 {{'foo' declared here}}
16 // expected-note@+2 {{'foo' declared here}}
18 extern void foo(void *);
20 __attribute__((no_caller_saved_registers
))
21 void no_caller_saved_registers(void *arg
) {
23 // expected-warning@+2 {{function with attribute 'no_caller_saved_registers' should only call a function with attribute 'no_caller_saved_registers' or be compiled with '-mgeneral-regs-only'}}
28 __attribute__((interrupt
))
29 void interrupt(void *arg
) {
31 // expected-warning@+2 {{interrupt service routine should only call a function with attribute 'no_caller_saved_registers' or be compiled with '-mgeneral-regs-only'}}