1 // RUN: %clang_cc1 -triple arm64-apple-darwin -fsyntax-only -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
3 typedef unsigned char uint8_t;
5 uint8_t constraint_r(uint8_t *addr
) {
8 __asm__
volatile("ldrb %0, [%1]" : "=r" (byte
) : "r" (addr
) : "memory");
9 // CHECK: warning: value size does not match register size specified by the constraint and modifier
10 // CHECK: note: use constraint modifier "w"
11 // CHECK: fix-it:{{.*}}:{8:26-8:28}:"%w0"
16 uint8_t constraint_r_symbolic(uint8_t *addr
) {
19 __asm__
volatile("ldrb %[s0], [%[s1]]" : [s0
] "=r" (byte
) : [s1
] "r" (addr
) : "memory");
20 // CHECK: warning: value size does not match register size specified by the constraint and modifier
21 // CHECK: note: use constraint modifier "w"
22 // CHECK: fix-it:{{.*}}:{19:26-19:31}:"%w[s0]"
29 uint8_t constraint_r_symbolic_macro(uint8_t *addr
) {
32 __asm__
volatile("ldrb "PERCENT
"[s0], [%[s1]]" : [s0
] "=r" (byte
) : [s1
] "r" (addr
) : "memory");
33 // CHECK: warning: value size does not match register size specified by the constraint and modifier
34 // CHECK: note: use constraint modifier "w"
40 // CHECK: warning: value size does not match register size specified by the constraint and modifier
41 // CHECK: asm ("%w0 %w1 %2" : "+r" (one) : "r" (wide_two));
42 // CHECK: note: use constraint modifier "w"
43 // CHECK: fix-it:{{.*}}:{47:17-47:19}:"%w2"
45 void read_write_modifier0(int one
, int two
) {
47 asm ("%w0 %w1 %2" : "+r" (one
) : "r" (wide_two
));
50 // CHECK-NOT: warning:
51 void read_write_modifier1(int one
, int two
) {
53 asm ("%w0 %1" : "+r" (one
), "+r" (wide_two
));