[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / clang / test / CodeGen / ptrauth-function-lvalue-cast.c
blob8d8af18fcafbe882fc43e493072393c8840b7099
1 // RUN: %clang_cc1 %s -triple arm64e-apple-ios13 -fptrauth-calls -fptrauth-intrinsics -emit-llvm -o- | FileCheck %s
2 // RUN: %clang_cc1 %s -triple aarch64-linux-gnu -fptrauth-calls -fptrauth-intrinsics -emit-llvm -o- | FileCheck %s
4 typedef void (*fptr_t)(void);
6 char *cptr;
7 void (*fptr)(void);
9 // CHECK: define {{(dso_local )?}}void @test1
10 void test1() {
11 // CHECK: [[LOAD:%.*]] = load ptr, ptr @cptr
12 // CHECK: call void [[LOAD]]() [ "ptrauth"(i32 0, i64 0) ]
13 // CHECK: ret void
15 (*(fptr_t)cptr)();
18 // CHECK: define {{(dso_local )?}}i8 @test2
19 char test2() {
20 return *(char *)fptr;
21 // CHECK: [[LOAD:%.*]] = load ptr, ptr @fptr
22 // CHECK: [[LOAD1:%.*]] = load i8, ptr [[LOAD]]
23 // CHECK: ret i8 [[LOAD1]]