r372197 - [X86] Prevent assertion when calling a function that returns double with -mno-sse2 on x86-64.
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 17 18:57:46 PDT 2019
Author: ctopper
Date: Tue Sep 17 18:57:46 2019
New Revision: 372197
URL: http://llvm.org/viewvc/llvm-project?rev=372197&view=rev
Log:
[X86] Prevent assertion when calling a function that returns double with -mno-sse2 on x86-64.
As seen in the most recent updates to PR10498
Added:
cfe/trunk/test/CodeGen/x86_64-mno-sse2.c
Added: cfe/trunk/test/CodeGen/x86_64-mno-sse2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/x86_64-mno-sse2.c?rev=372197&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/x86_64-mno-sse2.c (added)
+++ cfe/trunk/test/CodeGen/x86_64-mno-sse2.c Tue Sep 17 18:57:46 2019
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple x86_64-linux -target-feature -sse2 -S -o /dev/null -verify %s
+// REQUIRES: x86-registered-target
+
+double f1(void) { // expected-error {{SSE2 register return with SSE2 disabled}}
+ return 1.4;
+}
+extern double g;
+void f2(void) { // expected-error {{SSE2 register return with SSE2 disabled}}
+ g = f1();
+}
+void take_double(double);
+void pass_double(void) {
+ // FIXME: Still asserts.
+ //take_double(1.5);
+}
+
+double return_double();
+void call_double(double *a) { // expected-error {{SSE2 register return with SSE2 disabled}}
+ *a = return_double();
+}
More information about the cfe-commits
mailing list