blob: 4b38d09b86757c37f98f6431cd8f1cf59edf7506 [file] [log] [blame]
NAKAMURA Takumi729be142014-10-27 12:37:26 +00001// RUN: %clang_cc1 -triple msp430-unknown-unknown -fsyntax-only -verify %s
2
Anton Korobeynikov383e8272019-01-16 13:44:01 +00003__attribute__((interrupt(1))) int t; // expected-warning {{'interrupt' attribute only applies to functions}}
NAKAMURA Takumi729be142014-10-27 12:37:26 +00004
Anton Korobeynikov383e8272019-01-16 13:44:01 +00005int i;
6__attribute__((interrupt(i))) void f(void); // expected-error {{'interrupt' attribute requires an integer constant}}
7__attribute__((interrupt(1, 2))) void f2(void); // expected-error {{'interrupt' attribute takes one argument}}
8__attribute__((interrupt(1))) int f3(void); // expected-warning {{MSP430 'interrupt' attribute only applies to functions that have a 'void' return type}}
9__attribute__((interrupt(1))) void f4(int a); // expected-warning {{MSP430 'interrupt' attribute only applies to functions that have no parameters}}
10__attribute__((interrupt(64))) void f5(void); // expected-error {{'interrupt' attribute parameter 64 is out of bounds}}
11
12__attribute__((interrupt(0))) void f6(void);
13__attribute__((interrupt(63))) void f7(void);