
This adds -no-opaque-pointers to clang tests whose output will change when opaque pointers are enabled by default. This is intended to be part of the migration approach described in https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9. The patch has been produced by replacing %clang_cc1 with %clang_cc1 -no-opaque-pointers for tests that fail with opaque pointers enabled. Worth noting that this doesn't cover all tests, there's a remaining ~40 tests not using %clang_cc1 that will need a followup change. Differential Revision: https://reviews.llvm.org/D123115
46 lines
1.7 KiB
C
46 lines
1.7 KiB
C
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
|
|
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
|
|
|
|
void *my_aligned_alloc(int size, int alignment) __attribute__((assume_aligned(32), alloc_align(2)));
|
|
|
|
// CHECK-LABEL: @t0_immediate0(
|
|
// CHECK-NEXT: entry:
|
|
// CHECK-NEXT: [[CALL:%.*]] = call align 32 i8* @my_aligned_alloc(i32 noundef 320, i32 noundef 16)
|
|
// CHECK-NEXT: ret i8* [[CALL]]
|
|
//
|
|
void *t0_immediate0(void) {
|
|
return my_aligned_alloc(320, 16);
|
|
};
|
|
|
|
// CHECK-LABEL: @t1_immediate1(
|
|
// CHECK-NEXT: entry:
|
|
// CHECK-NEXT: [[CALL:%.*]] = call align 32 i8* @my_aligned_alloc(i32 noundef 320, i32 noundef 32)
|
|
// CHECK-NEXT: ret i8* [[CALL]]
|
|
//
|
|
void *t1_immediate1(void) {
|
|
return my_aligned_alloc(320, 32);
|
|
};
|
|
|
|
// CHECK-LABEL: @t2_immediate2(
|
|
// CHECK-NEXT: entry:
|
|
// CHECK-NEXT: [[CALL:%.*]] = call align 64 i8* @my_aligned_alloc(i32 noundef 320, i32 noundef 64)
|
|
// CHECK-NEXT: ret i8* [[CALL]]
|
|
//
|
|
void *t2_immediate2(void) {
|
|
return my_aligned_alloc(320, 64);
|
|
};
|
|
|
|
// CHECK-LABEL: @t3_variable(
|
|
// CHECK-NEXT: entry:
|
|
// CHECK-NEXT: [[ALIGNMENT_ADDR:%.*]] = alloca i32, align 4
|
|
// CHECK-NEXT: store i32 [[ALIGNMENT:%.*]], i32* [[ALIGNMENT_ADDR]], align 4
|
|
// CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[ALIGNMENT_ADDR]], align 4
|
|
// CHECK-NEXT: [[CALL:%.*]] = call align 32 i8* @my_aligned_alloc(i32 noundef 320, i32 noundef [[TMP0]])
|
|
// CHECK-NEXT: [[CASTED_ALIGN:%.*]] = zext i32 [[TMP0]] to i64
|
|
// CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(i8* [[CALL]], i64 [[CASTED_ALIGN]]) ]
|
|
// CHECK-NEXT: ret i8* [[CALL]]
|
|
//
|
|
void *t3_variable(int alignment) {
|
|
return my_aligned_alloc(320, alignment);
|
|
};
|