From b97de8844953260910b6c7e459d3a4735903bec1 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 18 Sep 2019 01:57:46 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372197 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/x86_64-mno-sse2.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/CodeGen/x86_64-mno-sse2.c diff --git a/test/CodeGen/x86_64-mno-sse2.c b/test/CodeGen/x86_64-mno-sse2.c new file mode 100644 index 0000000000..0c8e78edb9 --- /dev/null +++ b/test/CodeGen/x86_64-mno-sse2.c @@ -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(); +} -- 2.40.0