brintos

brintos / llvm-project-archived public Read only

0
0
Text · 460 B · a05af6b Raw
18 lines · c
1// RUN: %clang_min_runtime -fsanitize=implicit-signed-integer-truncation,implicit-integer-sign-change %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK2 3#include <stdint.h>4 5int main() {6// CHECK-NOT: implicit-conversion7 8  // Explicitly casting hides it,9  int8_t n0 = (int8_t)((uint32_t)-1);10 11  // Positive tests.12  int8_t t0 = (uint32_t)-1;13// CHECK: implicit-conversion by 0x{{[[:xdigit:]]+$}}14// CHECK-NOT: implicit-conversion15 16  return 0;17}18