aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/NVPTX/fsin-no-fast-math.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/NVPTX/fsin-no-fast-math.ll')
-rw-r--r--test/CodeGen/NVPTX/fsin-no-fast-math.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/NVPTX/fsin-no-fast-math.ll b/test/CodeGen/NVPTX/fsin-no-fast-math.ll
new file mode 100644
index 000000000000..56396b849250
--- /dev/null
+++ b/test/CodeGen/NVPTX/fsin-no-fast-math.ll
@@ -0,0 +1,14 @@
+; RUN: not llc < %s -march=nvptx -mcpu=sm_20 2>&1 | FileCheck %s
+
+; Check that we fail to select fsin without fast-math enabled
+
+declare float @llvm.sin.f32(float)
+
+; CHECK: LLVM ERROR: Cannot select: {{.*}}: f32 = fsin
+; CHECK: In function: test_fsin_safe
+define float @test_fsin_safe(float %a) #0 {
+ %r = tail call float @llvm.sin.f32(float %a)
+ ret float %r
+}
+
+attributes #0 = { "unsafe-fp-math" = "false" }