1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
4 // RUN: -internal-isystem %S/../../lib/Headers/cuda_wrappers \
5 // RUN: -internal-isystem %S/Inputs/include \
6 // RUN: -triple x86_64-unknown-unknown \
7 // RUN: -emit-llvm %s -O1 -o - \
10 #define __host__ __attribute__((host))
11 #define __device__ __attribute__((device))
15 extern "C" bool cmp(double a, double b) { return a<b; }
17 // CHECK-LABEL: @test_std_min(
19 // CHECK-NEXT: ret double 0x7FF8000000000000
21 extern "C" double test_std_min() {
22 return std::min(__builtin_nan(""), 0.0);
25 // CHECK-LABEL: @test_std_min_cmp(
27 // CHECK-NEXT: ret double 0x7FF8000000000000
29 extern "C" double test_std_min_cmp() {
30 return std::min(__builtin_nan(""), 0.0, cmp);
33 // CHECK-LABEL: @test_std_max(
35 // CHECK-NEXT: ret double 0x7FF8000000000000
37 extern "C" double test_std_max() {
38 return std::max(__builtin_nan(""), 0.0);
41 // CHECK-LABEL: @test_std_max_cmp(
43 // CHECK-NEXT: ret double 0x7FF8000000000000
45 extern "C" double test_std_max_cmp() {
46 return std::max(__builtin_nan(""), 0.0, cmp);