You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
363 B

// RUN: %clang -fsanitize=alignment %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK
#include <stdlib.h>
int main(int argc, char *argv[]) {
char *ptr = (char *)malloc(2);
void *t = __builtin_assume_aligned(ptr + 1, 0x8000);
(void)t;
// CHECK: ubsan: alignment-assumption
// CHECK-NOT: alignment-assumption
free(ptr);
return 0;
}