| 1 |
// RUN: %clang_cc1 -E -dM -triple=x86_64-none-none %s -o - \ |
| 2 |
// RUN: | FileCheck %s -strict-whitespace |
| 3 |
|
| 4 |
// RUN: %clang_cc1 -E -dM -triple=x86_64-none-none -target-feature -sse \ |
| 5 |
// RUN: %s -o - | FileCheck %s -check-prefix=EXT -strict-whitespace |
| 6 |
|
| 7 |
// RUN: %clang_cc1 -E -dM -triple=arm64e-apple-ios -target-feature -sse \ |
| 8 |
// RUN: %s -o - | FileCheck %s -strict-whitespace |
| 9 |
|
| 10 |
// RUN: %clang_cc1 -E -dM -triple=arm64e-apple-ios -target-feature +sse \ |
| 11 |
// RUN: %s -o - | FileCheck %s -strict-whitespace |
| 12 |
|
| 13 |
// RUN: %clang_cc1 -E -dM -triple=arm64_32-apple-ios %s -o - \ |
| 14 |
// RUN: | FileCheck %s -strict-whitespace |
| 15 |
|
| 16 |
// RUN: %clang_cc1 -E -dM -triple=arm64_32-apple-ios -target-feature -sse \ |
| 17 |
// RUN: %s -o - | FileCheck %s -strict-whitespace |
| 18 |
|
| 19 |
// RUN: %clang_cc1 -E -dM -triple=x86_64-apple-macos13.0 -ffast-math \ |
| 20 |
// RUN: %s -o - | FileCheck %s -check-prefix=CHECK -strict-whitespace |
| 21 |
|
| 22 |
// RUN: %clang_cc1 -E -dM -triple i386-pc-windows -target-cpu pentium4 %s -o - \ |
| 23 |
// RUN: | FileCheck %s -strict-whitespace |
| 24 |
|
| 25 |
// RUN: %clang_cc1 -E -dM -triple i386-pc-windows -target-cpu pentium4 \ |
| 26 |
// RUN: -target-feature -sse %s -o - | FileCheck -check-prefix=EXT %s \ |
| 27 |
// RUN: -strict-whitespace |
| 28 |
|
| 29 |
#ifdef __FLT_EVAL_METHOD__ |
| 30 |
#if __FLT_EVAL_METHOD__ == 3 |
| 31 |
#define __GLIBC_FLT_EVAL_METHOD 2 |
| 32 |
#else |
| 33 |
#define __GLIBC_FLT_EVAL_METHOD __FLT_EVAL_METHOD__ |
| 34 |
#endif |
| 35 |
#elif defined __x86_64__ |
| 36 |
#define __GLIBC_FLT_EVAL_METHOD 0 |
| 37 |
#else |
| 38 |
#define __GLIBC_FLT_EVAL_METHOD 2 |
| 39 |
#endif |
| 40 |
|
| 41 |
#if __GLIBC_FLT_EVAL_METHOD == -1 |
| 42 |
#define Name "MinusOne" |
| 43 |
#elif __GLIBC_FLT_EVAL_METHOD == 0 || __GLIBC_FLT_EVAL_METHOD == 16 |
| 44 |
#define Name "One" |
| 45 |
#elif __GLIBC_FLT_EVAL_METHOD == 1 |
| 46 |
#define Name "Two" |
| 47 |
#elif __GLIBC_FLT_EVAL_METHOD == 2 |
| 48 |
#define Name "Three" |
| 49 |
#elif __GLIBC_FLT_EVAL_METHOD == 32 |
| 50 |
#define Name "Four" |
| 51 |
#elif __GLIBC_FLT_EVAL_METHOD == 33 |
| 52 |
#define Name "Five" |
| 53 |
#elif __GLIBC_FLT_EVAL_METHOD == 64 |
| 54 |
#define Name "Six" |
| 55 |
#elif __GLIBC_FLT_EVAL_METHOD == 65 |
| 56 |
#define Name "Seven" |
| 57 |
#elif __GLIBC_FLT_EVAL_METHOD == 128 |
| 58 |
#define Name "Eight" |
| 59 |
#elif __GLIBC_FLT_EVAL_METHOD == 129 |
| 60 |
#define Name "Nine" |
| 61 |
#else |
| 62 |
#error "Unknown __GLIBC_FLT_EVAL_METHOD" |
| 63 |
#endif |
| 64 |
|
| 65 |
int foo() { |
| 66 |
// CHECK: #define Name "One" |
| 67 |
// EXT: #define Name "Three" |
| 68 |
return Name; |
| 69 |
} |
| 70 |
|
| 71 |
#pragma fp eval_method(double) |
| 72 |
|
| 73 |
#if __FLT_EVAL_METHOD__ == 3 |
| 74 |
#define Val "Unset" |
| 75 |
#elif __FLT_EVAL_METHOD__ == 0 |
| 76 |
#define Val "val0" |
| 77 |
#elif __FLT_EVAL_METHOD__ == 1 |
| 78 |
#define Val "val1" |
| 79 |
#elif __FLT_EVAL_METHOD__ == 2 |
| 80 |
#define Val "val2" |
| 81 |
#endif |
| 82 |
|
| 83 |
int goo() { |
| 84 |
// CHECK: #define Val "val0" |
| 85 |
// EXT: #define Val "val2" |
| 86 |
return Val; |
| 87 |
} |