[clang] 0c5db3e - Fix test from 5f1f4a5
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu May 14 08:22:22 PDT 2020
Author: Erich Keane
Date: 2020-05-14T08:22:08-07:00
New Revision: 0c5db3e4aa197bab6e4d9f8c02ca0edf4fa9dce3
URL: https://github.com/llvm/llvm-project/commit/0c5db3e4aa197bab6e4d9f8c02ca0edf4fa9dce3
DIFF: https://github.com/llvm/llvm-project/commit/0c5db3e4aa197bab6e4d9f8c02ca0edf4fa9dce3.diff
LOG: 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.
Added:
clang/test/SemaCXX/ext-int-asm.cpp
Modified:
clang/test/SemaCXX/ext-int.cpp
Removed:
################################################################################
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<int Bounds>
struct HasExtInt {
@@ -275,13 +275,3 @@ void ImplicitCasts(_ExtInt(31) s31, _ExtInt(33) s33, int i) {
// expected-warning at +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}}
-
-}
More information about the cfe-commits
mailing list