1*2db090a2SDavid Spickett /// This test checks that the warning includes the location in the C source 2*2db090a2SDavid Spickett /// file that contains the inline asm. Instead of saying <inline asm> for both. 3*2db090a2SDavid Spickett /// Although this warning is emitted in llvm it cannot be tested from IR as 4*2db090a2SDavid Spickett /// it does not have that location information at that stage. 5*2db090a2SDavid Spickett 6*2db090a2SDavid Spickett // RUN: %clang -target arm-arm-none-eabi -march=armv7-m -c %s -o /dev/null \ 7*2db090a2SDavid Spickett // RUN: 2>&1 | FileCheck %s 8*2db090a2SDavid Spickett 9*2db090a2SDavid Spickett // REQUIRES: arm-registered-target 10*2db090a2SDavid Spickett bar(void)11*2db090a2SDavid Spickettvoid bar(void) { 12*2db090a2SDavid Spickett __asm__ __volatile__("nop" 13*2db090a2SDavid Spickett : 14*2db090a2SDavid Spickett : 15*2db090a2SDavid Spickett : "sp"); 16*2db090a2SDavid Spickett } 17*2db090a2SDavid Spickett 18*2db090a2SDavid Spickett // CHECK: inline-asm-clobber-warning.c:12:24: warning: inline asm clobber list contains reserved registers: SP [-Winline-asm] 19*2db090a2SDavid Spickett // CHECK-NEXT: __asm__ __volatile__("nop" 20*2db090a2SDavid Spickett // CHECK-NEXT: ^ 21*2db090a2SDavid Spickett // CHECK-NEXT: inline-asm-clobber-warning.c:12:24: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour. 22