mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 19:06:05 +00:00

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
23 lines
1.3 KiB
C++
23 lines
1.3 KiB
C++
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
|
|
// RUN: %clang_cc1 -no-opaque-pointers %s -S -emit-llvm -triple x86_64-unknown-linux-gnu -o - | FileCheck %s
|
|
|
|
// CHECK: @[[STR:.*]] = private unnamed_addr constant [45 x i8] c"_Generic selection expression should be fine\00", section "llvm.metadata"
|
|
// CHECK-NEXT: @[[FILENAME:.*]] = private unnamed_addr constant {{.*}}, section "llvm.metadata"
|
|
// CHECK-NEXT: @[[ARGS:.*]] = private unnamed_addr constant { i32 } zeroinitializer, section "llvm.metadata"
|
|
|
|
// CHECK-LABEL: @_Z1fv(
|
|
// CHECK-NEXT: entry:
|
|
// CHECK-NEXT: [[N:%.*]] = alloca i32, align 4
|
|
// CHECK-NEXT: [[J:%.*]] = alloca i32, align 4
|
|
// CHECK-NEXT: store i32 10, i32* [[N]], align 4
|
|
// CHECK-NEXT: [[J1:%.*]] = bitcast i32* [[J]] to i8*
|
|
// CHECK-NEXT: call void @llvm.var.annotation(i8* [[J1]], i8* getelementptr inbounds ([45 x i8], [45 x i8]* @[[STR]], i32 0, i32 0), i8* getelementptr inbounds ([{{[0-9]+}} x i8], [{{[0-9]+}} x i8]* @[[FILENAME]], i32 0, i32 0), i32 {{.*}}, i8* bitcast ({ i32 }* @[[ARGS]] to i8*))
|
|
// CHECK-NEXT: store i32 0, i32* [[J]], align 4
|
|
// CHECK-NEXT: ret void
|
|
//
|
|
void f() {
|
|
int n = 10;
|
|
[[clang::annotate("_Generic selection expression should be fine", _Generic(n, int : 0, default : 1))]]
|
|
int j = 0; // second arg should resolve to 0 fine
|
|
}
|