Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / ubsan_minimal / TestCases / alignment-assumption.c
blobacc3e855faebe0f7e10d0cb10b54697cb3922587
1 // RUN: %clang -fsanitize=alignment %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK
3 #include <stdlib.h>
5 int main(int argc, char *argv[]) {
7 char *ptr = (char *)malloc(2);
9 void *t = __builtin_assume_aligned(ptr + 1, 0x8000);
10 (void)t;
11 // CHECK: ubsan: alignment-assumption by 0x{{[[:xdigit:]]+$}}
12 // CHECK-NOT: alignment-assumption
14 free(ptr);
16 return 0;