|
| 1 | +// ============================================================================= |
| 2 | +// Supported target triples |
| 3 | +// ============================================================================= |
| 4 | + |
| 5 | +// MACRO: -D__LIBC_STAGED_BOUNDS_SAFETY_ATTRIBUTES |
| 6 | +// NO_MACRO-NOT: -D__LIBC_STAGED_BOUNDS_SAFETY_ATTRIBUTES |
| 7 | + |
| 8 | +// ios |
| 9 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-ios \ |
| 10 | +// RUN: -fno-bounds-safety-bringup-missing-checks=libc_attributes \ |
| 11 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 12 | +// RUN: | FileCheck --check-prefix=NO_MACRO %s |
| 13 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-ios \ |
| 14 | +// RUN: -fbounds-safety-bringup-missing-checks=libc_attributes \ |
| 15 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 16 | +// RUN: | FileCheck --check-prefix=MACRO %s |
| 17 | + |
| 18 | +// macos |
| 19 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-macos \ |
| 20 | +// RUN: -fno-bounds-safety-bringup-missing-checks=libc_attributes \ |
| 21 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 22 | +// RUN: | FileCheck --check-prefix=NO_MACRO %s |
| 23 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-macos \ |
| 24 | +// RUN: -fbounds-safety-bringup-missing-checks=libc_attributes \ |
| 25 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 26 | +// RUN: | FileCheck --check-prefix=MACRO %s |
| 27 | + |
| 28 | +// macos (legacy `darwin` os name in triple) |
| 29 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-darwin \ |
| 30 | +// RUN: -fno-bounds-safety-bringup-missing-checks=libc_attributes \ |
| 31 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 32 | +// RUN: | FileCheck --check-prefix=NO_MACRO %s |
| 33 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-darwin \ |
| 34 | +// RUN: -fbounds-safety-bringup-missing-checks=libc_attributes \ |
| 35 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 36 | +// RUN: | FileCheck --check-prefix=MACRO %s |
| 37 | + |
| 38 | +// watchos |
| 39 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-watchos \ |
| 40 | +// RUN: -fno-bounds-safety-bringup-missing-checks=libc_attributes \ |
| 41 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 42 | +// RUN: | FileCheck --check-prefix=NO_MACRO %s |
| 43 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-watchos \ |
| 44 | +// RUN: -fbounds-safety-bringup-missing-checks=libc_attributes \ |
| 45 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 46 | +// RUN: | FileCheck --check-prefix=MACRO %s |
| 47 | + |
| 48 | +// tvos |
| 49 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-tvos \ |
| 50 | +// RUN: -fno-bounds-safety-bringup-missing-checks=libc_attributes \ |
| 51 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 52 | +// RUN: | FileCheck --check-prefix=NO_MACRO %s |
| 53 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-tvos \ |
| 54 | +// RUN: -fbounds-safety-bringup-missing-checks=libc_attributes \ |
| 55 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 56 | +// RUN: | FileCheck --check-prefix=MACRO %s |
| 57 | + |
| 58 | +// ============================================================================= |
| 59 | +// Check option is included in all and option variant without `=all` suffix |
| 60 | +// ============================================================================= |
| 61 | + |
| 62 | +// ios |
| 63 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-ios \ |
| 64 | +// RUN: -fno-bounds-safety-bringup-missing-checks=all \ |
| 65 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 66 | +// RUN: | FileCheck --check-prefix=NO_MACRO %s |
| 67 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-ios \ |
| 68 | +// RUN: -fno-bounds-safety-bringup-missing-checks \ |
| 69 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 70 | +// RUN: | FileCheck --check-prefix=NO_MACRO %s |
| 71 | + |
| 72 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-ios \ |
| 73 | +// RUN: -fbounds-safety-bringup-missing-checks=all \ |
| 74 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 75 | +// RUN: | FileCheck --check-prefix=MACRO %s |
| 76 | +// RUN: %clang -Wno-incompatible-sysroot -target arm64-apple-ios \ |
| 77 | +// RUN: -fbounds-safety-bringup-missing-checks \ |
| 78 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 79 | +// RUN: | FileCheck --check-prefix=MACRO %s |
| 80 | + |
| 81 | +// ============================================================================= |
| 82 | +// Unsupported target triples |
| 83 | +// ============================================================================= |
| 84 | + |
| 85 | +// linux |
| 86 | +// RUN: %clang -Wno-incompatible-sysroot -target x86_64-unknown-linux \ |
| 87 | +// RUN: -fno-bounds-safety-bringup-missing-checks=libc_attributes \ |
| 88 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 89 | +// RUN: | FileCheck --check-prefix=NO_MACRO %s |
| 90 | +// RUN: %clang -Wno-incompatible-sysroot -target x86_64-unknown-linux \ |
| 91 | +// RUN: -fbounds-safety-bringup-missing-checks=libc_attributes \ |
| 92 | +// RUN: -x c -### -fbounds-safety %s 2>&1 \ |
| 93 | +// RUN: | FileCheck --check-prefix=NO_MACRO %s |
0 commit comments