--- /dev/null
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=armv8-eabi | FileCheck %s
+
+declare float @llvm.minnum.f32(float, float)
+declare float @llvm.maxnum.f32(float, float)
+declare float @llvm.minimum.f32(float, float)
+declare float @llvm.maximum.f32(float, float)
+
+define float @test_minnum_const_nan(float %x) {
+; CHECK-LABEL: test_minnum_const_nan:
+; CHECK: @ %bb.0:
+; CHECK-NEXT: vldr s0, .LCPI0_0
+; CHECK-NEXT: vmov s2, r0
+; CHECK-NEXT: vminnm.f32 s0, s2, s0
+; CHECK-NEXT: vmov r0, s0
+; CHECK-NEXT: bx lr
+; CHECK-NEXT: .p2align 2
+; CHECK-NEXT: @ %bb.1:
+; CHECK-NEXT: .LCPI0_0:
+; CHECK-NEXT: .long 0x7ff80000 @ float NaN
+ %r = call float @llvm.minnum.f32(float %x, float 0x7fff000000000000)
+ ret float %r
+}
+
+define float @test_maxnum_const_nan(float %x) {
+; CHECK-LABEL: test_maxnum_const_nan:
+; CHECK: @ %bb.0:
+; CHECK-NEXT: vldr s0, .LCPI1_0
+; CHECK-NEXT: vmov s2, r0
+; CHECK-NEXT: vmaxnm.f32 s0, s2, s0
+; CHECK-NEXT: vmov r0, s0
+; CHECK-NEXT: bx lr
+; CHECK-NEXT: .p2align 2
+; CHECK-NEXT: @ %bb.1:
+; CHECK-NEXT: .LCPI1_0:
+; CHECK-NEXT: .long 0x7ff80000 @ float NaN
+ %r = call float @llvm.maxnum.f32(float %x, float 0x7fff000000000000)
+ ret float %r
+}
+
+define float @test_maximum_const_nan(float %x) {
+; CHECK-LABEL: test_maximum_const_nan:
+; CHECK: @ %bb.0:
+; CHECK-NEXT: vldr s0, .LCPI2_0
+; CHECK-NEXT: vmov s2, r0
+; CHECK-NEXT: vmax.f32 d0, d1, d0
+; CHECK-NEXT: vmov r0, s0
+; CHECK-NEXT: bx lr
+; CHECK-NEXT: .p2align 2
+; CHECK-NEXT: @ %bb.1:
+; CHECK-NEXT: .LCPI2_0:
+; CHECK-NEXT: .long 0x7ff80000 @ float NaN
+ %r = call float @llvm.maximum.f32(float %x, float 0x7fff000000000000)
+ ret float %r
+}
+
+define float @test_minimum_const_nan(float %x) {
+; CHECK-LABEL: test_minimum_const_nan:
+; CHECK: @ %bb.0:
+; CHECK-NEXT: vldr s0, .LCPI3_0
+; CHECK-NEXT: vmov s2, r0
+; CHECK-NEXT: vmin.f32 d0, d1, d0
+; CHECK-NEXT: vmov r0, s0
+; CHECK-NEXT: bx lr
+; CHECK-NEXT: .p2align 2
+; CHECK-NEXT: @ %bb.1:
+; CHECK-NEXT: .LCPI3_0:
+; CHECK-NEXT: .long 0x7ff80000 @ float NaN
+ %r = call float @llvm.minimum.f32(float %x, float 0x7fff000000000000)
+ ret float %r
+}