brintos

brintos / llvm-project-archived public Read only

0
0
Text · 292 B · 3f01dc8 Raw
14 lines · cpp
1// RUN: %clang_min_runtime -fsanitize=alignment %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK2 3void f(int &n) {}4 5int *t;6 7int main() {8  int r;9  t = (int *)(((char *)&r) + 1);10  // CHECK: ubsan: type-mismatch by 0x{{[[:xdigit:]]+}}11  // CHECK-NOT: type-mismatch12  f(*t);13}14