brintos

brintos / llvm-project-archived public Read only

0
0
Text · 732 B · 0d0730e Raw
23 lines · c
1// RUN: %clang_tysan -mllvm -tysan-outline-instrumentation=true -mllvm -tysan-verify-outlined-instrumentation=true %s -o %t && %run %t >%t.out.0 2>&12// RUN: FileCheck %s < %t.out.03 4#include <stdio.h>5 6void printInt(int *i) { printf("%d\n", *i); }7 8int main() {9 10  float value = 5.0f;11  printInt((int *)&value);12 13  return 0;14}15 16// CHECK: ERROR: TypeSanitizer: type-aliasing-violation17// CHECK-NEXT: READ of size 4 at {{.*}} with type int accesses an existing object of type float18// CHECK-NEXT: {{#0 0x.* in printInt}}19// CHECK-EMPTY:20// CHECK-NEXT: ERROR: TypeSanitizer: type-aliasing-violation21// CHECK-NEXT: READ of size 4 at {{.*}} with type int accesses an existing object of type float22// CHECK-NEXT: {{#0 0x.* in printInt}}23