brintos

brintos / llvm-project-archived public Read only

0
0
Text · 399 B · 134c143 Raw
18 lines · c
1// RUN: %clang_min_runtime -fsanitize=alignment %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK2 3#include <stdlib.h>4 5int main(int argc, char *argv[]) {6 7  char *ptr = (char *)malloc(2);8 9  void *t = __builtin_assume_aligned(ptr + 1, 0x8000);10  (void)t;11  // CHECK: ubsan: alignment-assumption by 0x{{[[:xdigit:]]+$}}12  // CHECK-NOT: alignment-assumption13 14  free(ptr);15 16  return 0;17}18