blob: 541c190e6116d797653e836f7e31bcc79feba022 [file] [log] [blame]
Tim Northovera2ee4332014-03-29 15:09:45 +00001// RUN: %clang_cc1 -triple arm64-apple-ios7.1 -fsyntax-only -verify %s
James Molloy8bdd24b2014-04-23 10:26:19 +00002
Tim Northovera2ee4332014-03-29 15:09:45 +00003void foo() {
4 asm volatile("USE(%0)" :: "z"(0LL));
5 asm volatile("USE(%x0)" :: "z"(0LL));
6 asm volatile("USE(%w0)" :: "z"(0));
7
Akira Hatanaka987f1862014-08-22 06:05:21 +00008 asm volatile("USE(%0)" :: "z"(0)); // expected-warning {{value size does not match register size specified by the constraint and modifier}} expected-note {{use constraint modifier "w"}}
Tim Northovera2ee4332014-03-29 15:09:45 +00009}
Mikhail Maltsev89f7b462018-04-30 09:11:08 +000010
11void test_clobber_conflict(void) {
12 register long x asm("x1");
13 asm volatile("nop" :: "r"(x) : "%x1"); // expected-error {{conflicts with asm clobber list}}
14 asm volatile("nop" : "=r"(x) :: "%x1"); // expected-error {{conflicts with asm clobber list}}
15}