From 0c5db3e4aa197bab6e4d9f8c02ca0edf4fa9dce3 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Thu, 14 May 2020 08:21:03 -0700 Subject: [PATCH] Fix test from 5f1f4a5 My test needs a requires target clause to support inline assembly. This patch splits out the asm tests into a separate test so we don't skip the rest of the conditions. --- clang/test/SemaCXX/ext-int-asm.cpp | 11 +++++++++++ clang/test/SemaCXX/ext-int.cpp | 12 +----------- 2 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 clang/test/SemaCXX/ext-int-asm.cpp diff --git a/clang/test/SemaCXX/ext-int-asm.cpp b/clang/test/SemaCXX/ext-int-asm.cpp new file mode 100644 index 000000000000..c7434d29eff3 --- /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 a5e87eb878d3..14f11a6bb961 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}} - -}