brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 5a0ccde Raw
58 lines · c
1// =============================================================================2// No Trap Reasons3// =============================================================================4 5// RUN: %clang -fsanitize=undefined -fsanitize-trap=undefined \6// RUN: -fsanitize-debug-trap-reasons=none %s -### 2>&1 | \7// RUN: FileCheck --check-prefix=NONE %s8 9// RUN: %clang -fsanitize=undefined -fsanitize-trap=undefined \10// RUN: -fno-sanitize-debug-trap-reasons %s -### 2>&1 | \11// RUN: FileCheck --check-prefix=NONE %s12 13// NONE: -fsanitize-debug-trap-reasons=none14 15// =============================================================================16// Basic Trap Reasons17// =============================================================================18 19// RUN: %clang -fsanitize=undefined -fsanitize-trap=undefined \20// RUN: -fsanitize-debug-trap-reasons=basic %s -### 2>&1 | \21// RUN: FileCheck --check-prefix=BASIC %s22// BASIC: -fsanitize-debug-trap-reasons=basic23 24// =============================================================================25// Detailed Trap Reasons26// =============================================================================27 28// RUN: %clang -fsanitize=undefined -fsanitize-trap=undefined \29// RUN: -fsanitize-debug-trap-reasons=detailed %s -### 2>&1 | \30// RUN: FileCheck --check-prefix=DETAILED %s31 32// RUN: %clang -fsanitize=undefined -fsanitize-trap=undefined \33// RUN: -fsanitize-debug-trap-reasons %s -### 2>&1 | \34// RUN: FileCheck --check-prefix=DETAILED %s35 36// DETAILED: -fsanitize-debug-trap-reasons=detailed37 38// =============================================================================39// Other cases40// =============================================================================41 42// By default the driver doesn't pass along any value and the default value is43// whatever is the default in CodeGenOptions.44// RUN: %clang %s -### 2>&1 | FileCheck --check-prefix=DEFAULT %s45// DEFAULT-NOT: -fsanitize-debug-trap-reasons46 47// Warning when not using UBSan48// RUN: %clang -fsanitize-debug-trap-reasons=none %s -### 2>&1 | \49// RUN: FileCheck --check-prefix=WARN %s50// WARN: warning: argument unused during compilation: '-fsanitize-debug-trap-reasons=none'51 52// Bad flag arguments are just passed along to the Frontend which handles rejecting53// invalid values. See `clang/test/Frontend/fsanitize-debug-trap-reasons.c`54// RUN: %clang -fsanitize=undefined -fsanitize-trap=undefined \55// RUN: -fsanitize-debug-trap-reasons=bad_value %s -### 2>&1 | \56// RUN: FileCheck --check-prefix=BAD_VALUE %s57// BAD_VALUE: -fsanitize-debug-trap-reasons=bad_value58