diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
| commit | bab175ec4b075c8076ba14c762900392533f6ee4 (patch) | |
| tree | 01f4f29419a2cb10abe13c1e63cd2a66068b0137 /test/Preprocessor | |
| parent | 8b7a8012d223fac5d17d16a66bb39168a9a1dfc0 (diff) | |
Notes
Diffstat (limited to 'test/Preprocessor')
| -rw-r--r-- | test/Preprocessor/aarch64-target-features.c | 2 | ||||
| -rw-r--r-- | test/Preprocessor/arm-target-features.c | 10 | ||||
| -rw-r--r-- | test/Preprocessor/cuda-approx-transcendentals.cu | 6 | ||||
| -rw-r--r-- | test/Preprocessor/cuda-macos-includes.cu | 13 | ||||
| -rw-r--r-- | test/Preprocessor/cuda-preprocess.cu | 8 | ||||
| -rw-r--r-- | test/Preprocessor/cuda-types.cu | 45 | ||||
| -rw-r--r-- | test/Preprocessor/dump_import.h | 1 | ||||
| -rw-r--r-- | test/Preprocessor/dump_import.m | 6 | ||||
| -rw-r--r-- | test/Preprocessor/dump_include.c | 11 | ||||
| -rw-r--r-- | test/Preprocessor/dump_include.h | 2 | ||||
| -rw-r--r-- | test/Preprocessor/header_is_main_file.c | 8 | ||||
| -rw-r--r-- | test/Preprocessor/init.c | 133 | ||||
| -rw-r--r-- | test/Preprocessor/missing-include-range-check.h | 8 | ||||
| -rw-r--r-- | test/Preprocessor/pragma_microsoft.c | 28 | ||||
| -rw-r--r-- | test/Preprocessor/predefined-arch-macros.c | 12 | ||||
| -rw-r--r-- | test/Preprocessor/x86_target_features.c | 6 |
16 files changed, 246 insertions, 53 deletions
diff --git a/test/Preprocessor/aarch64-target-features.c b/test/Preprocessor/aarch64-target-features.c index 5ec9bc685d76..aef788dd083e 100644 --- a/test/Preprocessor/aarch64-target-features.c +++ b/test/Preprocessor/aarch64-target-features.c @@ -94,6 +94,8 @@ // RUN: %clang -target aarch64 -mcpu=cortex-a72 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-A72 %s // RUN: %clang -target aarch64 -mcpu=cortex-a73 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-CORTEX-A73 %s // RUN: %clang -target aarch64 -mcpu=exynos-m1 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s +// RUN: %clang -target aarch64 -mcpu=exynos-m2 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s +// RUN: %clang -target aarch64 -mcpu=exynos-m3 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-M1 %s // RUN: %clang -target aarch64 -mcpu=kryo -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-KRYO %s // RUN: %clang -target aarch64 -mcpu=vulcan -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-MCPU-VULCAN %s // CHECK-MCPU-CYCLONE: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crypto" "-target-feature" "+zcm" "-target-feature" "+zcz" diff --git a/test/Preprocessor/arm-target-features.c b/test/Preprocessor/arm-target-features.c index be235606e25a..f45c5ba07f0f 100644 --- a/test/Preprocessor/arm-target-features.c +++ b/test/Preprocessor/arm-target-features.c @@ -9,6 +9,15 @@ // CHECK-V8A: #define __ARM_FP16_ARGS 1 // CHECK-V8A: #define __ARM_FP16_FORMAT_IEEE 1 +// RUN: %clang -target armv8r-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8R %s +// CHECK-V8R: #define __ARMEL__ 1 +// CHECK-V8R: #define __ARM_ARCH 8 +// CHECK-V8R: #define __ARM_ARCH_8R__ 1 +// CHECK-V8R: #define __ARM_FEATURE_CRC32 1 +// CHECK-V8R: #define __ARM_FEATURE_DIRECTED_ROUNDING 1 +// CHECK-V8R: #define __ARM_FEATURE_NUMERIC_MAXMIN 1 +// CHECK-V8R: #define __ARM_FP 0xE + // RUN: %clang -target armv7a-none-linux-gnu -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V7 %s // CHECK-V7: #define __ARMEL__ 1 // CHECK-V7: #define __ARM_ARCH 7 @@ -380,6 +389,7 @@ // M7-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1 // M7-THUMB:#define __ARM_FEATURE_DSP 1 // M7-THUMB:#define __ARM_FP 0xE +// M7-THUMB:#define __ARM_FPV5__ 1 // Test whether predefines are as expected when targeting krait. // RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=KRAIT %s diff --git a/test/Preprocessor/cuda-approx-transcendentals.cu b/test/Preprocessor/cuda-approx-transcendentals.cu index 8d106ea27a7f..409eabb4dac0 100644 --- a/test/Preprocessor/cuda-approx-transcendentals.cu +++ b/test/Preprocessor/cuda-approx-transcendentals.cu @@ -1,7 +1,7 @@ // RUN: %clang --cuda-host-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix HOST %s -// RUN: %clang --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-NOFAST %s -// RUN: %clang -fcuda-approx-transcendentals --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s -// RUN: %clang -ffast-math --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s +// RUN: %clang --cuda-device-only -nocudainc -nocudalib -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-NOFAST %s +// RUN: %clang -fcuda-approx-transcendentals --cuda-device-only -nocudainc -nocudalib -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s +// RUN: %clang -ffast-math --cuda-device-only -nocudainc -nocudalib -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null | FileCheck --check-prefix DEVICE-FAST %s // HOST-NOT: __CLANG_CUDA_APPROX_TRANSCENDENTALS__ // DEVICE-NOFAST-NOT: __CLANG_CUDA_APPROX_TRANSCENDENTALS__ diff --git a/test/Preprocessor/cuda-macos-includes.cu b/test/Preprocessor/cuda-macos-includes.cu new file mode 100644 index 000000000000..6ef94b0e4535 --- /dev/null +++ b/test/Preprocessor/cuda-macos-includes.cu @@ -0,0 +1,13 @@ +// RUN: %clang -cc1 -fcuda-is-device -isysroot /var/empty \ +// RUN: -triple nvptx-nvidia-cuda -aux-triple i386-apple-macosx \ +// RUN: -E -fcuda-is-device -v -o /dev/null -x cuda %s 2>&1 | FileCheck %s + +// RUN: %clang -cc1 -isysroot /var/empty \ +// RUN: -triple i386-apple-macosx -aux-triple nvptx-nvidia-cuda \ +// RUN: -E -fcuda-is-device -v -o /dev/null -x cuda %s 2>&1 | FileCheck %s + +// Check that when we do CUDA host and device compiles on MacOS, we check for +// includes in /System/Library/Frameworks and /Library/Frameworks. + +// CHECK-DAG: ignoring nonexistent directory "/var/empty/System/Library/Frameworks" +// CHECK-DAG: ignoring nonexistent directory "/var/empty/Library/Frameworks" diff --git a/test/Preprocessor/cuda-preprocess.cu b/test/Preprocessor/cuda-preprocess.cu index 9751bfd6d5b3..84a7bcf2a12f 100644 --- a/test/Preprocessor/cuda-preprocess.cu +++ b/test/Preprocessor/cuda-preprocess.cu @@ -13,20 +13,20 @@ clang_unittest_cuda_arch __CUDA_ARCH__ // CHECK-NOT: PREPROCESSED_AWAY -// RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 -nocudainc %s 2>&1 \ +// RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 -nocudainc -nocudalib %s 2>&1 \ // RUN: | FileCheck -check-prefix NOARCH %s // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-host-only -nocudainc %s 2>&1 \ // RUN: | FileCheck -check-prefix NOARCH %s // NOARCH: clang_unittest_no_arch -// RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-device-only -nocudainc %s 2>&1 \ +// RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-device-only -nocudainc -nocudalib %s 2>&1 \ // RUN: | FileCheck -check-prefix SM20 %s // SM20: clang_unittest_cuda_arch 200 -// RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_30 --cuda-device-only -nocudainc %s 2>&1 \ +// RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_30 --cuda-device-only -nocudainc -nocudalib %s 2>&1 \ // RUN: | FileCheck -check-prefix SM30 %s // SM30: clang_unittest_cuda_arch 300 // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 \ -// RUN: --cuda-device-only -nocudainc %s 2>&1 \ +// RUN: --cuda-device-only -nocudainc -nocudalib %s 2>&1 \ // RUN: | FileCheck -check-prefix SM20 -check-prefix SM30 %s diff --git a/test/Preprocessor/cuda-types.cu b/test/Preprocessor/cuda-types.cu index dd8eef4aaef5..2b6160b8d6c7 100644 --- a/test/Preprocessor/cuda-types.cu +++ b/test/Preprocessor/cuda-types.cu @@ -1,27 +1,30 @@ -// Check that types, widths, etc. match on the host and device sides of CUDA -// compilations. Note that we filter out long double, as this is intentionally -// different on host and device. +// Check that types, widths, __GCC_ATOMIC* macros, etc. match on the host and +// device sides of CUDA compilations. Note that we filter out long double, as +// this is intentionally different on host and device. +// +// FIXME: We really should make __GCC_HAVE_SYNC_COMPARE_AND_SWAP identical on +// host and device, but architecturally this is difficult at the moment. -// RUN: %clang --cuda-host-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null > %T/i386-host-defines -// RUN: %clang --cuda-device-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null > %T/i386-device-defines -// RUN: grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)' %T/i386-host-defines | grep -v '__LDBL\|_LONG_DOUBLE' > %T/i386-host-defines-filtered -// RUN: grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)' %T/i386-device-defines | grep -v '__LDBL\|_LONG_DOUBLE' > %T/i386-device-defines-filtered +// RUN: %clang --cuda-host-only -nocudainc -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \ +// RUN: | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \ +// RUN: | grep -v '__LDBL\|_LONG_DOUBLE' > %T/i386-host-defines-filtered +// RUN: %clang --cuda-device-only -nocudainc -nocudalib -target i386-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \ +// RUN: | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \ +// RUN: | grep -v '__LDBL\|_LONG_DOUBLE' > %T/i386-device-defines-filtered // RUN: diff %T/i386-host-defines-filtered %T/i386-device-defines-filtered -// RUN: %clang --cuda-host-only -nocudainc -target x86_64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null > %T/x86_64-host-defines -// RUN: %clang --cuda-device-only -nocudainc -target x86_64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null > %T/x86_64-device-defines -// RUN: grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF\|WIDTH\)' %T/x86_64-host-defines | grep -v '__LDBL\|_LONG_DOUBLE' > %T/x86_64-host-defines-filtered -// RUN: grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF\|WIDTH\)' %T/x86_64-device-defines | grep -v '__LDBL\|_LONG_DOUBLE' > %T/x86_64-device-defines-filtered +// RUN: %clang --cuda-host-only -nocudainc -target x86_64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \ +// RUN: | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \ +// RUN: | grep -v '__LDBL\|_LONG_DOUBLE' > %T/x86_64-host-defines-filtered +// RUN: %clang --cuda-device-only -nocudainc -nocudalib -target x86_64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \ +// RUN: | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \ +// RUN: | grep -v '__LDBL\|_LONG_DOUBLE' > %T/x86_64-device-defines-filtered // RUN: diff %T/x86_64-host-defines-filtered %T/x86_64-device-defines-filtered -// RUN: %clang --cuda-host-only -nocudainc -target powerpc64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null > %T/powerpc64-host-defines -// RUN: %clang --cuda-device-only -nocudainc -target powerpc64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null > %T/powerpc64-device-defines -// RUN: grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF\|WIDTH\)' %T/powerpc64-host-defines | grep -v '__LDBL\|_LONG_DOUBLE' > %T/powerpc64-host-defines-filtered -// RUN: grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF\|WIDTH\)' %T/powerpc64-device-defines | grep -v '__LDBL\|_LONG_DOUBLE' > %T/powerpc64-device-defines-filtered +// RUN: %clang --cuda-host-only -nocudainc -target powerpc64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \ +// RUN: | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \ +// RUN: | grep -v '__LDBL\|_LONG_DOUBLE' > %T/powerpc64-host-defines-filtered +// RUN: %clang --cuda-device-only -nocudainc -nocudalib -target powerpc64-unknown-linux-gnu -x cuda -E -dM -o - /dev/null \ +// RUN: | grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF|WIDTH\)\|define __GCC_ATOMIC' \ +// RUN: | grep -v '__LDBL\|_LONG_DOUBLE' > %T/powerpc64-device-defines-filtered // RUN: diff %T/powerpc64-host-defines-filtered %T/powerpc64-device-defines-filtered - -// RUN: %clang --cuda-host-only -nocudainc -target nvptx-nvidia-cuda -x cuda -E -dM -o - /dev/null > %T/nvptx-host-defines -// RUN: %clang --cuda-device-only -nocudainc -target nvptx-nvidia-cuda -x cuda -E -dM -o - /dev/null > %T/nvptx-device-defines -// RUN: grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF\|WIDTH\)' %T/nvptx-host-defines | grep -v '__LDBL\|_LONG_DOUBLE' > %T/nvptx-host-defines-filtered -// RUN: grep 'define __[^ ]*\(TYPE\|MAX\|SIZEOF\|WIDTH\)' %T/nvptx-device-defines | grep -v '__LDBL\|_LONG_DOUBLE' > %T/nvptx-device-defines-filtered -// RUN: diff %T/nvptx-host-defines-filtered %T/nvptx-device-defines-filtered diff --git a/test/Preprocessor/dump_import.h b/test/Preprocessor/dump_import.h new file mode 100644 index 000000000000..fded1e52cbbf --- /dev/null +++ b/test/Preprocessor/dump_import.h @@ -0,0 +1 @@ +#define DUMP_IMPORT_TESTVAL 1 diff --git a/test/Preprocessor/dump_import.m b/test/Preprocessor/dump_import.m new file mode 100644 index 000000000000..20424ad507bd --- /dev/null +++ b/test/Preprocessor/dump_import.m @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -E -dI %s -o - | FileCheck %s +// CHECK: {{^}}#import "dump_ + +// See also `dump_include.c` which tests other inclusion cases with `-dI`. + +#import "dump_import.h" diff --git a/test/Preprocessor/dump_include.c b/test/Preprocessor/dump_include.c new file mode 100644 index 000000000000..4d7d857d5f1b --- /dev/null +++ b/test/Preprocessor/dump_include.c @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -w -E -dI -isystem %S -imacros %S/dump_include.h %s -o - | FileCheck %s +// CHECK: {{^}}#__include_macros "{{.*}}dump_ +// CHECK: {{^}}#include <dump_ +// CHECK: {{^}}#include "dump_ +// CHECK: {{^}}#include_next "dump_ + +// See also `dump_import.m` which tests the `#import` directive with `-dI`. + +#include <dump_include.h> +#include "dump_include.h" +#include_next "dump_include.h" diff --git a/test/Preprocessor/dump_include.h b/test/Preprocessor/dump_include.h new file mode 100644 index 000000000000..9dafaa50b5c5 --- /dev/null +++ b/test/Preprocessor/dump_include.h @@ -0,0 +1,2 @@ +#pragma once +#define DUMP_INCLUDE_TESTVAL 1 diff --git a/test/Preprocessor/header_is_main_file.c b/test/Preprocessor/header_is_main_file.c new file mode 100644 index 000000000000..03ade13ff333 --- /dev/null +++ b/test/Preprocessor/header_is_main_file.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -x c-header -ffreestanding -Eonly -verify %s +// expected-no-diagnostics + +#pragma once +#include_next "stdint.h" +#if !__has_include_next("stdint.h") +#error "__has_include_next failed" +#endif diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index adf5c778767e..b003404df6ff 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -64,6 +64,9 @@ // // // RUN: %clang_cc1 -std=c11 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix C11 %s +// RUN: %clang_cc1 -std=c1x -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix C11 %s +// RUN: %clang_cc1 -std=iso9899:2011 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix C11 %s +// RUN: %clang_cc1 -std=iso9899:201x -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix C11 %s // // C11:#define __STDC_UTF_16__ 1 // C11:#define __STDC_UTF_32__ 1 @@ -205,6 +208,12 @@ // O1:#define __OPTIMIZE__ 1 // // +// RUN: %clang_cc1 -Og -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix Og %s +// +// Og-NOT:#define __OPTIMIZE_SIZE__ +// Og :#define __OPTIMIZE__ 1 +// +// // RUN: %clang_cc1 -Os -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix Os %s // // Os:#define __OPTIMIZE_SIZE__ 1 @@ -247,6 +256,7 @@ // RUN: %clang_cc1 -E -dM -ffreestanding -triple=aarch64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix AARCH64 %s // RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix AARCH64 %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=arm64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix AARCH64 -check-prefix AARCH64-CXX %s // // AARCH64:#define _LP64 1 // AARCH64-NOT:#define __AARCH64EB__ 1 @@ -393,6 +403,7 @@ // AARCH64:#define __SIZE_MAX__ 18446744073709551615UL // AARCH64:#define __SIZE_TYPE__ long unsigned int // AARCH64:#define __SIZE_WIDTH__ 64 +// AARCH64-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL // AARCH64:#define __UINT16_C_SUFFIX__ // AARCH64:#define __UINT16_MAX__ 65535 // AARCH64:#define __UINT16_TYPE__ unsigned short @@ -1206,6 +1217,7 @@ // AARCH64-DARWIN: #define __aarch64__ 1 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-none-none < /dev/null | FileCheck -match-full-lines -check-prefix ARM %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=arm-none-none < /dev/null | FileCheck -match-full-lines -check-prefix ARM -check-prefix ARM-CXX %s // // ARM-NOT:#define _LP64 // ARM:#define __APCS_32__ 1 @@ -1351,6 +1363,7 @@ // ARM:#define __SIZE_MAX__ 4294967295U // ARM:#define __SIZE_TYPE__ unsigned int // ARM:#define __SIZE_WIDTH__ 32 +// ARM-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8U // ARM:#define __UINT16_C_SUFFIX__ // ARM:#define __UINT16_MAX__ 65535 // ARM:#define __UINT16_TYPE__ unsigned short @@ -2431,6 +2444,7 @@ // I386:#define i386 1 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-pc-linux-gnu -target-cpu pentium4 < /dev/null | FileCheck -match-full-lines -check-prefix I386-LINUX %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=i386-pc-linux-gnu -target-cpu pentium4 < /dev/null | FileCheck -match-full-lines -check-prefix I386-LINUX -check-prefix I386-LINUX-CXX %s // // I386-LINUX-NOT:#define _LP64 // I386-LINUX:#define __BIGGEST_ALIGNMENT__ 16 @@ -2572,6 +2586,7 @@ // I386-LINUX:#define __SIZE_MAX__ 4294967295U // I386-LINUX:#define __SIZE_TYPE__ unsigned int // I386-LINUX:#define __SIZE_WIDTH__ 32 +// I386-LINUX-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8U // I386-LINUX:#define __UINT16_C_SUFFIX__ // I386-LINUX:#define __UINT16_MAX__ 65535 // I386-LINUX:#define __UINT16_TYPE__ unsigned short @@ -2618,6 +2633,7 @@ // I386-LINUX:#define i386 1 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-netbsd < /dev/null | FileCheck -match-full-lines -check-prefix I386-NETBSD %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=i386-netbsd < /dev/null | FileCheck -match-full-lines -check-prefix I386-NETBSD -check-prefix I386-NETBSD-CXX %s // // I386-NETBSD-NOT:#define _LP64 // I386-NETBSD:#define __BIGGEST_ALIGNMENT__ 16 @@ -2759,6 +2775,7 @@ // I386-NETBSD:#define __SIZE_MAX__ 4294967295U // I386-NETBSD:#define __SIZE_TYPE__ unsigned int // I386-NETBSD:#define __SIZE_WIDTH__ 32 +// I386-NETBSD-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 4U // I386-NETBSD:#define __UINT16_C_SUFFIX__ // I386-NETBSD:#define __UINT16_MAX__ 65535 // I386-NETBSD:#define __UINT16_TYPE__ unsigned short @@ -2818,7 +2835,8 @@ // I386-DECLSPEC: #define __declspec{{.*}} // -// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS32BE %s +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS32BE -check-prefix MIPS32BE-C %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=mips-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS32BE -check-prefix MIPS32BE-CXX %s // // MIPS32BE:#define MIPSEB 1 // MIPS32BE:#define _ABIO32 1 @@ -2973,8 +2991,9 @@ // MIPS32BE:#define __SIZE_MAX__ 4294967295U // MIPS32BE:#define __SIZE_TYPE__ unsigned int // MIPS32BE:#define __SIZE_WIDTH__ 32 +// MIPS32BE-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8U // MIPS32BE:#define __STDC_HOSTED__ 0 -// MIPS32BE:#define __STDC_VERSION__ 201112L +// MIPS32BE-C:#define __STDC_VERSION__ 201112L // MIPS32BE:#define __STDC__ 1 // MIPS32BE:#define __UINT16_C_SUFFIX__ // MIPS32BE:#define __UINT16_MAX__ 65535 @@ -3235,7 +3254,10 @@ // // RUN: %clang_cc1 -E -dM -ffreestanding \ // RUN: -triple=mips64-none-none -target-abi n32 < /dev/null \ -// RUN: | FileCheck -match-full-lines -check-prefix MIPSN32BE %s +// RUN: | FileCheck -match-full-lines -check-prefix MIPSN32BE -check-prefix MIPSN32BE-C %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding \ +// RUN: -triple=mips64-none-none -target-abi n32 < /dev/null \ +// RUN: | FileCheck -match-full-lines -check-prefix MIPSN32BE -check-prefix MIPSN32BE-CXX %s // // MIPSN32BE: #define MIPSEB 1 // MIPSN32BE: #define _ABIN32 2 @@ -3304,7 +3326,7 @@ // MIPSN32BE: #define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 // MIPSN32BE: #define __GNUC_MINOR__ 2 // MIPSN32BE: #define __GNUC_PATCHLEVEL__ 1 -// MIPSN32BE: #define __GNUC_STDC_INLINE__ 1 +// MIPSN32BE-C: #define __GNUC_STDC_INLINE__ 1 // MIPSN32BE: #define __GNUC__ 4 // MIPSN32BE: #define __GXX_ABI_VERSION 1002 // MIPSN32BE: #define __ILP32__ 1 @@ -3424,10 +3446,11 @@ // MIPSN32BE: #define __SIZE_MAX__ 4294967295U // MIPSN32BE: #define __SIZE_TYPE__ unsigned int // MIPSN32BE: #define __SIZE_WIDTH__ 32 +// MIPSN32BE-CXX: #define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16U // MIPSN32BE: #define __STDC_HOSTED__ 0 // MIPSN32BE: #define __STDC_UTF_16__ 1 // MIPSN32BE: #define __STDC_UTF_32__ 1 -// MIPSN32BE: #define __STDC_VERSION__ 201112L +// MIPSN32BE-C: #define __STDC_VERSION__ 201112L // MIPSN32BE: #define __STDC__ 1 // MIPSN32BE: #define __UINT16_C_SUFFIX__ // MIPSN32BE: #define __UINT16_FMTX__ "hX" @@ -3846,6 +3869,7 @@ // MIPSN32EL: #define mips 1 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS64BE %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=mips64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MIPS64BE -check-prefix MIPS64BE-CXX %s // // MIPS64BE:#define MIPSEB 1 // MIPS64BE:#define _ABI64 3 @@ -4001,6 +4025,7 @@ // MIPS64BE:#define __SIZE_MAX__ 18446744073709551615UL // MIPS64BE:#define __SIZE_TYPE__ long unsigned int // MIPS64BE:#define __SIZE_WIDTH__ 64 +// MIPS64BE-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL // MIPS64BE:#define __UINT16_C_SUFFIX__ // MIPS64BE:#define __UINT16_MAX__ 65535 // MIPS64BE:#define __UINT16_TYPE__ unsigned short @@ -4489,6 +4514,7 @@ // MIPS-XXR6:#define __mips_nan2008 1 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=msp430-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MSP430 %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=msp430-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MSP430 -check-prefix MSP430-CXX %s // // MSP430:#define MSP430 1 // MSP430-NOT:#define _LP64 @@ -4630,6 +4656,7 @@ // MSP430:#define __SIZE_MAX__ 65535U // MSP430:#define __SIZE_TYPE__ unsigned int // MSP430:#define __SIZE_WIDTH__ 16 +// MSP430-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8U // MSP430:#define __UINT16_C_SUFFIX__ U // MSP430:#define __UINT16_MAX__ 65535U // MSP430:#define __UINT16_TYPE__ unsigned short @@ -4674,6 +4701,7 @@ // MSP430:#define __clang__ 1 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=nvptx-none-none < /dev/null | FileCheck -match-full-lines -check-prefix NVPTX32 %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=nvptx-none-none < /dev/null | FileCheck -match-full-lines -check-prefix NVPTX32 -check-prefix NVPTX32-CXX %s // // NVPTX32-NOT:#define _LP64 // NVPTX32:#define __BIGGEST_ALIGNMENT__ 8 @@ -4818,6 +4846,7 @@ // NVPTX32:#define __SIZE_MAX__ 4294967295U // NVPTX32:#define __SIZE_TYPE__ unsigned int // NVPTX32:#define __SIZE_WIDTH__ 32 +// NVPTX32-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8U // NVPTX32:#define __UINT16_C_SUFFIX__ // NVPTX32:#define __UINT16_MAX__ 65535 // NVPTX32:#define __UINT16_TYPE__ unsigned short @@ -4861,6 +4890,7 @@ // NVPTX32:#define __WINT_WIDTH__ 32 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=nvptx64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix NVPTX64 %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=nvptx64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix NVPTX64 -check-prefix NVPTX64-CXX %s // // NVPTX64:#define _LP64 1 // NVPTX64:#define __BIGGEST_ALIGNMENT__ 8 @@ -5005,6 +5035,7 @@ // NVPTX64:#define __SIZE_MAX__ 18446744073709551615UL // NVPTX64:#define __SIZE_TYPE__ long unsigned int // NVPTX64:#define __SIZE_WIDTH__ 64 +// NVPTX64-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8UL // NVPTX64:#define __UINT16_C_SUFFIX__ // NVPTX64:#define __UINT16_MAX__ 65535 // NVPTX64:#define __UINT16_TYPE__ unsigned short @@ -5048,6 +5079,7 @@ // NVPTX64:#define __WINT_WIDTH__ 32 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-none-none -target-cpu 603e < /dev/null | FileCheck -match-full-lines -check-prefix PPC603E %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=powerpc-none-none -target-cpu 603e < /dev/null | FileCheck -match-full-lines -check-prefix PPC603E-CXX %s // // PPC603E:#define _ARCH_603 1 // PPC603E:#define _ARCH_603E 1 @@ -5197,6 +5229,7 @@ // PPC603E:#define __SIZE_MAX__ 4294967295UL // PPC603E:#define __SIZE_TYPE__ long unsigned int // PPC603E:#define __SIZE_WIDTH__ 32 +// PPC603E-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL // PPC603E:#define __UINT16_C_SUFFIX__ // PPC603E:#define __UINT16_MAX__ 65535 // PPC603E:#define __UINT16_TYPE__ unsigned short @@ -5242,6 +5275,7 @@ // PPC603E:#define __ppc__ 1 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64 %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPC64 -check-prefix PPC64-CXX %s // // PPC64:#define _ARCH_PPC 1 // PPC64:#define _ARCH_PPC64 1 @@ -5397,6 +5431,7 @@ // PPC64:#define __SIZE_MAX__ 18446744073709551615UL // PPC64:#define __SIZE_TYPE__ long unsigned int // PPC64:#define __SIZE_WIDTH__ 64 +// PPC64-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL // PPC64:#define __UINT16_C_SUFFIX__ // PPC64:#define __UINT16_MAX__ 65535 // PPC64:#define __UINT16_TYPE__ unsigned short @@ -6653,6 +6688,7 @@ // RUN: %clang_cc1 -x cl -E -dM -ffreestanding -triple=amdgcn < /dev/null | FileCheck -match-full-lines -check-prefix AMDGCN --check-prefix AMDGPU %s // RUN: %clang_cc1 -x cl -E -dM -ffreestanding -triple=r600 -target-cpu caicos < /dev/null | FileCheck -match-full-lines --check-prefix AMDGPU %s // +// AMDGPU:#define __ENDIAN_LITTLE__ 1 // AMDGPU:#define cl_khr_byte_addressable_store 1 // AMDGCN:#define cl_khr_fp64 1 // AMDGPU:#define cl_khr_global_int32_base_atomics 1 @@ -6661,6 +6697,7 @@ // AMDGPU:#define cl_khr_local_int32_extended_atomics 1 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=s390x-none-none -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix S390X %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=s390x-none-none -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix S390X -check-prefix S390X-CXX %s // // S390X:#define __BIGGEST_ALIGNMENT__ 8 // S390X:#define __CHAR16_TYPE__ unsigned short @@ -6797,6 +6834,7 @@ // S390X:#define __SIZEOF_WINT_T__ 4 // S390X:#define __SIZE_TYPE__ long unsigned int // S390X:#define __SIZE_WIDTH__ 64 +// S390X-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8UL // S390X:#define __UINT16_C_SUFFIX__ // S390X:#define __UINT16_MAX__ 65535 // S390X:#define __UINT16_TYPE__ unsigned short @@ -6845,6 +6883,8 @@ // RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc-rtems-elf < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-DEFAULT %s // RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc-none-netbsd < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-NETOPENBSD %s // RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc-none-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-NETOPENBSD %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=sparc-none-none < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-DEFAULT -check-prefix SPARC-DEFAULT-CXX %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=sparc-none-openbsd < /dev/null | FileCheck -match-full-lines -check-prefix SPARC -check-prefix SPARC-NETOPENBSD -check-prefix SPARC-NETOPENBSD-CXX %s // // SPARC-NOT:#define _LP64 // SPARC:#define __BIGGEST_ALIGNMENT__ 8 @@ -6882,6 +6922,7 @@ // SPARC:#define __FLT_MIN_EXP__ (-125) // SPARC:#define __FLT_MIN__ 1.17549435e-38F // SPARC:#define __FLT_RADIX__ 2 +// SPARC:#define __GCC_ATOMIC_LLONG_LOCK_FREE 1 // SPARC:#define __INT16_C_SUFFIX__ // SPARC:#define __INT16_FMTd__ "hd" // SPARC:#define __INT16_FMTi__ "hi" @@ -6992,6 +7033,8 @@ // SPARC-NETOPENBSD:#define __SIZE_MAX__ 4294967295UL // SPARC-NETOPENBSD:#define __SIZE_TYPE__ long unsigned int // SPARC:#define __SIZE_WIDTH__ 32 +// SPARC-DEFAULT-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8U +// SPARC-NETOPENBSD-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 8UL // SPARC:#define __UINT16_C_SUFFIX__ // SPARC:#define __UINT16_MAX__ 65535 // SPARC:#define __UINT16_TYPE__ unsigned short @@ -7042,6 +7085,7 @@ // SPARC:#define sparc 1 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=tce-none-none < /dev/null | FileCheck -match-full-lines -check-prefix TCE %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=tce-none-none < /dev/null | FileCheck -match-full-lines -check-prefix TCE -check-prefix TCE-CXX %s // // TCE-NOT:#define _LP64 // TCE:#define __BIGGEST_ALIGNMENT__ 4 @@ -7168,6 +7212,7 @@ // TCE:#define __SIZE_MAX__ 4294967295U // TCE:#define __SIZE_TYPE__ unsigned int // TCE:#define __SIZE_WIDTH__ 32 +// TCE-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 4U // TCE:#define __TCE_V1__ 1 // TCE:#define __TCE__ 1 // TCE:#define __UINT16_C_SUFFIX__ @@ -7209,6 +7254,7 @@ // TCE:#define tce 1 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix X86_64 %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=x86_64-none-none < /dev/null | FileCheck -match-full-lines -check-prefix X86_64 -check-prefix X86_64-CXX %s // // X86_64:#define _LP64 1 // X86_64-NOT:#define _LP32 1 @@ -7357,6 +7403,7 @@ // X86_64:#define __SSE2__ 1 // X86_64:#define __SSE_MATH__ 1 // X86_64:#define __SSE__ 1 +// X86_64-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL // X86_64:#define __UINT16_C_SUFFIX__ // X86_64:#define __UINT16_MAX__ 65535 // X86_64:#define __UINT16_TYPE__ unsigned short @@ -7411,6 +7458,7 @@ // X86_64H:#define __x86_64h__ 1 // RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-none-none-gnux32 < /dev/null | FileCheck -match-full-lines -check-prefix X32 %s +// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=x86_64-none-none-gnux32 < /dev/null | FileCheck -match-full-lines -check-prefix X32 -check-prefix X32-CXX %s // // X32:#define _ILP32 1 // X32-NOT:#define _LP64 1 @@ -7559,6 +7607,7 @@ // X32:#define __SSE2__ 1 // X32:#define __SSE_MATH__ 1 // X32:#define __SSE__ 1 +// X32-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16U // X32:#define __UINT16_C_SUFFIX__ // X32:#define __UINT16_MAX__ 65535 // X32:#define __UINT16_TYPE__ unsigned short @@ -8457,11 +8506,45 @@ // NORTTI:#define __STDC__ 1 // // RUN: %clang_cc1 -triple arm-linux-androideabi -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix ANDROID %s +// ANDROID-NOT:#define __ANDROID_API__ // ANDROID:#define __ANDROID__ 1 // +// RUN: %clang_cc1 -x c++ -triple i686-linux-android -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix I386-ANDROID-CXX %s +// I386-ANDROID-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 4U +// +// RUN: %clang_cc1 -x c++ -triple x86_64-linux-android -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix X86_64-ANDROID-CXX %s +// X86_64-ANDROID-CXX:#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16UL +// +// RUN: %clang_cc1 -triple arm-linux-androideabi20 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix ANDROID20 %s +// ANDROID20:#define __ANDROID_API__ 20 +// ANDROID20:#define __ANDROID__ 1 +// // RUN: %clang_cc1 -triple lanai-unknown-unknown -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix LANAI %s // LANAI: #define __lanai__ 1 // +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=amd64-unknown-openbsd6.1 < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-unknown-openbsd6.1-gnueabi < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-unknown-openbsd6.1 < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc64-unknown-openbsd6.1 < /dev/null | FileCheck -match-full-lines -check-prefix OPENBSD %s +// OPENBSD:#define __ELF__ 1 +// OPENBSD:#define __INT16_TYPE__ short +// OPENBSD:#define __INT32_TYPE__ int +// OPENBSD:#define __INT64_TYPE__ long long int +// OPENBSD:#define __INT8_TYPE__ signed char +// OPENBSD:#define __INTMAX_TYPE__ long long int +// OPENBSD:#define __INTPTR_TYPE__ long int +// OPENBSD:#define __OpenBSD__ 1 +// OPENBSD:#define __PTRDIFF_TYPE__ long int +// OPENBSD:#define __SIZE_TYPE__ long unsigned int +// OPENBSD:#define __UINT16_TYPE__ unsigned short +// OPENBSD:#define __UINT32_TYPE__ unsigned int +// OPENBSD:#define __UINT64_TYPE__ long long unsigned int +// OPENBSD:#define __UINT8_TYPE__ unsigned char +// OPENBSD:#define __UINTMAX_TYPE__ long long unsigned int +// OPENBSD:#define __UINTPTR_TYPE__ long unsigned int +// OPENBSD:#define __WCHAR_TYPE__ int +// OPENBSD:#define __WINT_TYPE__ int +// // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd < /dev/null | FileCheck -match-full-lines -check-prefix PPC64-FREEBSD %s // PPC64-FREEBSD-NOT: #define __LONG_DOUBLE_128__ 1 // @@ -8565,10 +8648,10 @@ // WEBASSEMBLY32-NEXT:#define __INTMAX_MAX__ 9223372036854775807LL // WEBASSEMBLY32-NEXT:#define __INTMAX_TYPE__ long long int // WEBASSEMBLY32-NEXT:#define __INTMAX_WIDTH__ 64 -// WEBASSEMBLY32-NEXT:#define __INTPTR_FMTd__ "ld" -// WEBASSEMBLY32-NEXT:#define __INTPTR_FMTi__ "li" -// WEBASSEMBLY32-NEXT:#define __INTPTR_MAX__ 2147483647L -// WEBASSEMBLY32-NEXT:#define __INTPTR_TYPE__ long int +// WEBASSEMBLY32-NEXT:#define __INTPTR_FMTd__ "d" +// WEBASSEMBLY32-NEXT:#define __INTPTR_FMTi__ "i" +// WEBASSEMBLY32-NEXT:#define __INTPTR_MAX__ 2147483647 +// WEBASSEMBLY32-NEXT:#define __INTPTR_TYPE__ int // WEBASSEMBLY32-NEXT:#define __INTPTR_WIDTH__ 32 // WEBASSEMBLY32-NEXT:#define __INT_FAST16_FMTd__ "hd" // WEBASSEMBLY32-NEXT:#define __INT_FAST16_FMTi__ "hi" @@ -8627,10 +8710,10 @@ // WEBASSEMBLY32-NEXT:#define __ORDER_PDP_ENDIAN__ 3412 // WEBASSEMBLY32-NEXT:#define __POINTER_WIDTH__ 32 // WEBASSEMBLY32-NEXT:#define __PRAGMA_REDEFINE_EXTNAME 1 -// WEBASSEMBLY32-NEXT:#define __PTRDIFF_FMTd__ "ld" -// WEBASSEMBLY32-NEXT:#define __PTRDIFF_FMTi__ "li" -// WEBASSEMBLY32-NEXT:#define __PTRDIFF_MAX__ 2147483647L -// WEBASSEMBLY32-NEXT:#define __PTRDIFF_TYPE__ long int +// WEBASSEMBLY32-NEXT:#define __PTRDIFF_FMTd__ "d" +// WEBASSEMBLY32-NEXT:#define __PTRDIFF_FMTi__ "i" +// WEBASSEMBLY32-NEXT:#define __PTRDIFF_MAX__ 2147483647 +// WEBASSEMBLY32-NEXT:#define __PTRDIFF_TYPE__ int // WEBASSEMBLY32-NEXT:#define __PTRDIFF_WIDTH__ 32 // WEBASSEMBLY32-NOT:#define __REGISTER_PREFIX__ // WEBASSEMBLY32-NEXT:#define __SCHAR_MAX__ 127 @@ -8650,12 +8733,12 @@ // WEBASSEMBLY32-NEXT:#define __SIZEOF_SIZE_T__ 4 // WEBASSEMBLY32-NEXT:#define __SIZEOF_WCHAR_T__ 4 // WEBASSEMBLY32-NEXT:#define __SIZEOF_WINT_T__ 4 -// WEBASSEMBLY32-NEXT:#define __SIZE_FMTX__ "lX" -// WEBASSEMBLY32-NEXT:#define __SIZE_FMTo__ "lo" -// WEBASSEMBLY32-NEXT:#define __SIZE_FMTu__ "lu" -// WEBASSEMBLY32-NEXT:#define __SIZE_FMTx__ "lx" -// WEBASSEMBLY32-NEXT:#define __SIZE_MAX__ 4294967295UL -// WEBASSEMBLY32-NEXT:#define __SIZE_TYPE__ long unsigned int +// WEBASSEMBLY32-NEXT:#define __SIZE_FMTX__ "X" +// WEBASSEMBLY32-NEXT:#define __SIZE_FMTo__ "o" +// WEBASSEMBLY32-NEXT:#define __SIZE_FMTu__ "u" +// WEBASSEMBLY32-NEXT:#define __SIZE_FMTx__ "x" +// WEBASSEMBLY32-NEXT:#define __SIZE_MAX__ 4294967295U +// WEBASSEMBLY32-NEXT:#define __SIZE_TYPE__ unsigned int // WEBASSEMBLY32-NEXT:#define __SIZE_WIDTH__ 32 // WEBASSEMBLY32-NEXT:#define __STDC_HOSTED__ 0 // WEBASSEMBLY32-NOT:#define __STDC_MB_MIGHT_NEQ_WC__ @@ -8703,12 +8786,12 @@ // WEBASSEMBLY32-NEXT:#define __UINTMAX_MAX__ 18446744073709551615ULL // WEBASSEMBLY32-NEXT:#define __UINTMAX_TYPE__ long long unsigned int // WEBASSEMBLY32-NEXT:#define __UINTMAX_WIDTH__ 64 -// WEBASSEMBLY32-NEXT:#define __UINTPTR_FMTX__ "lX" -// WEBASSEMBLY32-NEXT:#define __UINTPTR_FMTo__ "lo" -// WEBASSEMBLY32-NEXT:#define __UINTPTR_FMTu__ "lu" -// WEBASSEMBLY32-NEXT:#define __UINTPTR_FMTx__ "lx" -// WEBASSEMBLY32-NEXT:#define __UINTPTR_MAX__ 4294967295UL -// WEBASSEMBLY32-NEXT:#define __UINTPTR_TYPE__ long unsigned int +// WEBASSEMBLY32-NEXT:#define __UINTPTR_FMTX__ "X" +// WEBASSEMBLY32-NEXT:#define __UINTPTR_FMTo__ "o" +// WEBASSEMBLY32-NEXT:#define __UINTPTR_FMTu__ "u" +// WEBASSEMBLY32-NEXT:#define __UINTPTR_FMTx__ "x" +// WEBASSEMBLY32-NEXT:#define __UINTPTR_MAX__ 4294967295U +// WEBASSEMBLY32-NEXT:#define __UINTPTR_TYPE__ unsigned int // WEBASSEMBLY32-NEXT:#define __UINTPTR_WIDTH__ 32 // WEBASSEMBLY32-NEXT:#define __UINT_FAST16_FMTX__ "hX" // WEBASSEMBLY32-NEXT:#define __UINT_FAST16_FMTo__ "ho" diff --git a/test/Preprocessor/missing-include-range-check.h b/test/Preprocessor/missing-include-range-check.h new file mode 100644 index 000000000000..6b3f7d356120 --- /dev/null +++ b/test/Preprocessor/missing-include-range-check.h @@ -0,0 +1,8 @@ +// RUN: env CINDEXTEST_KEEP_GOING=1 c-index-test -test-load-source all %s > /dev/null 2> %t.err +// RUN: FileCheck < %t.err -check-prefix=CHECK-RANGE %s + +#include <foobar.h> +#include "moozegnarf.h" + +// CHECK-RANGE: rewrite-includes-missing.c:4:10:{4:10-4:19}: fatal error: 'foobar.h' file not found +// CHECK-RANGE: rewrite-includes-missing.c:5:10:{5:10-5:24}: fatal error: 'moozegnarf.h' file not found diff --git a/test/Preprocessor/pragma_microsoft.c b/test/Preprocessor/pragma_microsoft.c index 2a9e7bab35b5..b256b2bee6cf 100644 --- a/test/Preprocessor/pragma_microsoft.c +++ b/test/Preprocessor/pragma_microsoft.c @@ -162,3 +162,31 @@ void g() {} // Test that runtime_checks is parsed but ignored. #pragma runtime_checks("sc", restore) // no-warning + +// Test pragma intrinsic +#pragma intrinsic(memset) // no-warning +#pragma intrinsic(memcpy, strlen, strlen) // no-warning +#pragma intrinsic() // no-warning +#pragma intrinsic(asdf) // expected-warning {{'asdf' is not a recognized builtin; consider including <intrin.h>}} +#pragma intrinsic(main) // expected-warning {{'main' is not a recognized builtin; consider including <intrin.h>}} +#pragma intrinsic( // expected-warning {{missing ')' after}} +#pragma intrinsic(int) // expected-warning {{missing ')' after}} +#pragma intrinsic(strcmp) asdf // expected-warning {{extra tokens at end}} + +#define __INTRIN_H // there should be no notes after defining __INTRIN_H +#pragma intrinsic(asdf) // expected-warning-re {{'asdf' is not a recognized builtin{{$}}}} +#pragma intrinsic(memset) // no-warning +#undef __INTRIN_H +#pragma intrinsic(asdf) // expected-warning {{'asdf' is not a recognized builtin; consider including <intrin.h>}} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wignored-pragma-intrinsic" +#pragma intrinsic(asdf) // no-warning +#pragma clang diagnostic pop +#pragma intrinsic(asdf) // expected-warning {{'asdf' is not a recognized builtin; consider including <intrin.h>}} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wignored-pragmas" +#pragma intrinsic(asdf) // no-warning +#pragma clang diagnostic pop +#pragma intrinsic(asdf) // expected-warning {{'asdf' is not a recognized builtin; consider including <intrin.h>}} diff --git a/test/Preprocessor/predefined-arch-macros.c b/test/Preprocessor/predefined-arch-macros.c index 18a75df66e7d..51b587e403e0 100644 --- a/test/Preprocessor/predefined-arch-macros.c +++ b/test/Preprocessor/predefined-arch-macros.c @@ -1865,6 +1865,12 @@ // // CHECK_PPC_POWER8_VECTOR_M64: #define __POWER8_VECTOR__ 1 // +// RUN: %clang -mpower9-vector -E -dM %s -o - 2>&1 \ +// RUN: -target powerpc64-unknown-linux \ +// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_POWER9_VECTOR_M64 +// +// CHECK_PPC_POWER9_VECTOR_M64: #define __POWER9_VECTOR__ 1 +// // RUN: %clang -mcrypto -E -dM %s -o - 2>&1 \ // RUN: -target powerpc64-unknown-linux \ // RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_PPC_CRYPTO_M64 @@ -1921,6 +1927,8 @@ // RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-1 -check-prefix=CHECK_SPARCEL // RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=myriad2.2 2>&1 \ // RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 -check-prefix=CHECK_SPARCEL +// RUN: %clang -E -dM %s -o - -target sparcel-myriad -mcpu=ma2450 2>&1 \ +// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_MYRIAD2-2 -check-prefix=CHECK_SPARCEL // CHECK_SPARCEL: #define __LITTLE_ENDIAN__ 1 // CHECK_MYRIAD2-1: #define __myriad2 1 // CHECK_MYRIAD2-1: #define __myriad2__ 1 @@ -1928,6 +1936,7 @@ // CHECK_MYRIAD2-2: #define __myriad2__ 2 // CHECK_SPARCEL: #define __sparc 1 // CHECK_SPARCEL: #define __sparc__ 1 +// CHECK_MYRIAD2-1: #define __sparc_v8__ 1 // CHECK_SPARCEL: #define __sparcv8 1 // // RUN: %clang -E -dM %s -o - 2>&1 \ @@ -1960,6 +1969,9 @@ // RUN: %clang -march=zEC12 -E -dM %s -o - 2>&1 \ // RUN: -target s390x-unknown-linux \ // RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ZEC12 +// RUN: %clang -march=arch10 -E -dM %s -o - 2>&1 \ +// RUN: -target s390x-unknown-linux \ +// RUN: | FileCheck -match-full-lines %s -check-prefix=CHECK_SYSTEMZ_ZEC12 // // CHECK_SYSTEMZ_ZEC12: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 // CHECK_SYSTEMZ_ZEC12: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 diff --git a/test/Preprocessor/x86_target_features.c b/test/Preprocessor/x86_target_features.c index ff79a699ae8d..43cf615546b1 100644 --- a/test/Preprocessor/x86_target_features.c +++ b/test/Preprocessor/x86_target_features.c @@ -196,6 +196,7 @@ // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512vbmi -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=AVX512VBMI %s // AVX512VBMI: #define __AVX2__ 1 +// AVX512VBMI: #define __AVX512BW__ 1 // AVX512VBMI: #define __AVX512F__ 1 // AVX512VBMI: #define __AVX512VBMI__ 1 // AVX512VBMI: #define __AVX__ 1 @@ -208,6 +209,11 @@ // AVX512VBMI: #define __SSE__ 1 // AVX512VBMI: #define __SSSE3__ 1 +// RUN: %clang -target i386-unknown-unknown -march=atom -mavx512vbmi -mno-avx512bw -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=AVX512VBMINOAVX512BW %s + +// AVX512VBMINOAVX512BW-NOT: #define __AVX512BW__ 1 +// AVX512VBMINOAVX512BW-NOT: #define __AVX512VBMI__ 1 + // RUN: %clang -target i386-unknown-unknown -march=atom -msse4.2 -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=SSE42POPCNT %s // SSE42POPCNT: #define __POPCNT__ 1 |
