1 // REQUIRES: m68k-registered-target
2 // RUN: %clang_cc1 -triple m68k -fsyntax-only -verify %s -DINVALID
3 // RUN: %clang_cc1 -triple m68k -fsyntax-only -verify %s
7 // Invalid constraint usages that can be blocked by frontend
10 static const int BelowMin
= 0;
11 static const int AboveMax
= 9;
12 asm ("" :: "I"(BelowMin
)); // expected-error{{value '0' out of range for constraint 'I'}}
13 asm ("" :: "I"(AboveMax
)); // expected-error{{value '9' out of range for constraint 'I'}}
17 static const int BelowMin
= -0x8001;
18 static const int AboveMax
= 0x8000;
19 asm ("" :: "J"(BelowMin
)); // expected-error{{value '-32769' out of range for constraint 'J'}}
20 asm ("" :: "J"(AboveMax
)); // expected-error{{value '32768' out of range for constraint 'J'}}
24 static const int BelowMin
= -9;
25 static const int AboveMax
= 0;
26 asm ("" :: "L"(BelowMin
)); // expected-error{{value '-9' out of range for constraint 'L'}}
27 asm ("" :: "L"(AboveMax
)); // expected-error{{value '0' out of range for constraint 'L'}}
31 static const int BelowMin
= 23;
32 static const int AboveMax
= 32;
33 asm ("" :: "N"(BelowMin
)); // expected-error{{value '23' out of range for constraint 'N'}}
34 asm ("" :: "N"(AboveMax
)); // expected-error{{value '32' out of range for constraint 'N'}}
38 // Valid only if it's 16
39 static const int IncorrectVal
= 18;
40 asm ("" :: "O"(IncorrectVal
)); // expected-error{{value '18' out of range for constraint 'O'}}
44 static const int BelowMin
= 7;
45 static const int AboveMax
= 16;
46 asm ("" :: "P"(BelowMin
)); // expected-error{{value '7' out of range for constraint 'P'}}
47 asm ("" :: "P"(AboveMax
)); // expected-error{{value '16' out of range for constraint 'P'}}
51 // Valid only if it's 0
52 static const int IncorrectVal
= 1;
53 asm ("" :: "C0"(IncorrectVal
)); // expected-error{{value '1' out of range for constraint 'C0'}}
57 // Valid constraint usages.
58 // Note that these constraints can not be fully validated by frontend.
59 // So we're only testing the availability of their letters here.
60 // expected-no-diagnostics
63 asm ("" :: "K"(0x80));
67 asm ("" :: "M"(0x100));
74 asm ("" :: "Cj"(0x8000));
77 // Register constraints