From 8d78bb136ceafc05a24290e440440628fda8f468 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 11 May 2017 22:43:02 +0000 Subject: [PATCH] Issue diagnostics when returning FP values on x86_64 without SSE1/2 Avoid using report_fatal_error, because it will ask the user to file a bug. If the user attempts to disable SSE on x86_64 and them use floating point, that's a bug in their code, not a bug in the compiler. This is just a start. There are other ways to crash the backend in this configuration, but they should be updated to follow this pattern. Differential Revision: https://reviews.llvm.org/D27522 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302835 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/x86_64-mno-sse.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/CodeGen/x86_64-mno-sse.c diff --git a/test/CodeGen/x86_64-mno-sse.c b/test/CodeGen/x86_64-mno-sse.c new file mode 100644 index 000000000000..43a695ae3cd3 --- /dev/null +++ b/test/CodeGen/x86_64-mno-sse.c @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -triple x86_64-linux -target-feature -sse -target-feature -sse2 -S -o /dev/null -verify %s +// REQUIRES: x86-registered-target + +double f1(void) { // expected-error {{SSE register return with SSE disabled}} + return 1.4; +} +extern double g; +void f2(void) { // expected-error {{SSE register return with SSE disabled}} + g = f1(); +} +void take_double(double); +void pass_double(void) { + // FIXME: Still asserts. + //take_double(1.5); +}