diff --git a/clang/test/SemaCXX/ext-int-asm.cpp b/clang/test/SemaCXX/ext-int-asm.cpp new file mode 100644 index 0000000000000..c7434d29eff3d --- /dev/null +++ b/clang/test/SemaCXX/ext-int-asm.cpp @@ -0,0 +1,11 @@ +// REQUIRES: x86-registered-target +// RUN: %clang_cc1 -fsyntax-only -verify %s -Wimplicit-int-conversion -triple x86_64-gnu-linux -fasm-blocks + +void NotAllowedInInlineAsm(_ExtInt(9) in, _ExtInt(9) out) { + __asm { mov eax, in} // expected-error{{invalid type '_ExtInt(9)' in asm input}} + __asm { mov out, eax} // expected-error{{invalid type '_ExtInt(9)' in asm output}} + + asm("" : "=g" (in));// expected-error{{invalid type '_ExtInt(9)' in asm input}} + asm("" :: "r" (out));// expected-error{{invalid type '_ExtInt(9)' in asm output}} + +} diff --git a/clang/test/SemaCXX/ext-int.cpp b/clang/test/SemaCXX/ext-int.cpp index a5e87eb878d3c..14f11a6bb9614 100644 --- a/clang/test/SemaCXX/ext-int.cpp +++ b/clang/test/SemaCXX/ext-int.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -Wimplicit-int-conversion -triple x86_64-gnu-linux -fasm-blocks +// RUN: %clang_cc1 -fsyntax-only -verify %s -Wimplicit-int-conversion -triple x86_64-gnu-linux template struct HasExtInt { @@ -275,13 +275,3 @@ void ImplicitCasts(_ExtInt(31) s31, _ExtInt(33) s33, int i) { // expected-warning@+1{{implicit conversion loses integer precision}} i = s33; } - - -void NotAllowedInInlineAsm(_ExtInt(9) in, _ExtInt(9) out) { - __asm { mov eax, in} // expected-error{{invalid type '_ExtInt(9)' in asm input}} - __asm { mov out, eax} // expected-error{{invalid type '_ExtInt(9)' in asm output}} - - asm("" : "=g" (in));// expected-error{{invalid type '_ExtInt(9)' in asm input}} - asm("" :: "r" (out));// expected-error{{invalid type '_ExtInt(9)' in asm output}} - -}