Clang Project

clang_source_code/test/CodeGen/mips-unsupported-nan.c
1// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips2 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
2// RUN: FileCheck -check-prefix=CHECK-MIPS2 %s < %t
3//
4// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips3 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
5// RUN: FileCheck -check-prefix=CHECK-MIPS3 %s < %t
6//
7// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips4 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
8// RUN: FileCheck -check-prefix=CHECK-MIPS4 %s < %t
9//
10// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips32 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
11// RUN: FileCheck -check-prefix=CHECK-MIPS32 %s < %t
12//
13// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips32r2 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
14// RUN: FileCheck -allow-empty -check-prefix=NO-WARNINGS %s < %t
15//
16// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips32r3 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
17// RUN: FileCheck -allow-empty -check-prefix=NO-WARNINGS %s < %t
18//
19// RUN: %clang -target mipsel-unknown-linux -mnan=legacy -march=mips32r6 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
20// RUN: FileCheck -check-prefix=CHECK-MIPS32R6 %s < %t
21//
22// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips64 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
23// RUN: FileCheck -check-prefix=CHECK-MIPS64 %s < %t
24//
25// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips64r2 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
26// RUN: FileCheck -allow-empty -check-prefix=NO-WARNINGS %s < %t
27//
28// RUN: %clang -target mips64el-unknown-linux -mnan=legacy -march=mips64r6 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
29// RUN: FileCheck -check-prefix=CHECK-MIPS64R6 %s < %t
30
31// NO-WARNINGS-NOT: warning: ignoring '-mnan=legacy' option
32// NO-WARNINGS-NOT: warning: ignoring '-mnan=2008' option
33
34// CHECK-MIPS2: warning: ignoring '-mnan=2008' option because the 'mips2' architecture does not support it
35// CHECK-MIPS3: warning: ignoring '-mnan=2008' option because the 'mips3' architecture does not support it
36// CHECK-MIPS4: warning: ignoring '-mnan=2008' option because the 'mips4' architecture does not support it
37// CHECK-MIPS32: warning: ignoring '-mnan=2008' option because the 'mips32' architecture does not support it
38// CHECK-MIPS32R6: warning: ignoring '-mnan=legacy' option because the 'mips32r6' architecture does not support it
39// CHECK-MIPS64: warning: ignoring '-mnan=2008' option because the 'mips64' architecture does not support it
40// CHECK-MIPS64R6: warning: ignoring '-mnan=legacy' option because the 'mips64r6' architecture does not support it
41
42// CHECK-NANLEGACY: float 0x7FF4000000000000
43// CHECK-NAN2008: float 0x7FF8000000000000
44
45float f =  __builtin_nan("");
46