blob: eda9e0fed6aa9837dde207fd71ae0aa16efe36de [file] [log] [blame]
Steven Wucb0d13f2015-01-16 23:05:28 +00001// RUN: %clang_cc1 %s -triple i686-apple-darwin -verify -fsyntax-only -fno-gnu-inline-asm
2
Volodymyr Sapsai44a7abe2019-05-13 22:11:10 +00003#if __has_extension(gnu_asm)
4#error Expected extension 'gnu_asm' to be disabled
5#endif
6
Steven Wu2baa53a2015-04-28 21:49:09 +00007asm ("INST r1, 0"); // expected-error {{GNU-style inline assembly is disabled}}
Steven Wu6b72a672015-05-11 21:14:09 +00008
9void foo() __asm("__foo_func"); // AsmLabel is OK
10int foo1 asm("bar1") = 0; // OK
11
Steven Wu18bbe192015-05-12 00:16:37 +000012asm(" "); // Whitespace is OK
13
Steven Wucb0d13f2015-01-16 23:05:28 +000014void f (void) {
15 long long foo = 0, bar;
16 asm volatile("INST %0, %1" : "=r"(foo) : "r"(bar)); // expected-error {{GNU-style inline assembly is disabled}}
Steven Wu18bbe192015-05-12 00:16:37 +000017 asm (""); // Empty is OK
Steven Wucb0d13f2015-01-16 23:05:28 +000018 return;
19}