File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ // Test serializing a module that contains a struct
2+ // with a ptrauth qualified field.
3+
4+ // RUN: rm -rf %t && mkdir %t
5+ // RUN: split-file %s %t
6+
7+ // The command below should not crash.
8+ // RUN: %clang_cc1 -triple arm64e-apple-macosx -fptrauth-returns \
9+ // RUN: -fptrauth-intrinsics -fptrauth-calls -fptrauth-indirect-gotos \
10+ // RUN: -fptrauth-auth-traps -fmodules -fimplicit-module-maps \
11+ // RUN: -fmodules-cache-path=%t/cache -o %t/tu.o -x c %t/tu.c
12+
13+ //--- tu.c
14+ #include "struct_with_ptrauth_field.h"
15+
16+ int foo (struct T * t ) {
17+ return t -> s .foo (t -> s .v , t -> s .v ) + t -> arr [12 ];
18+ }
19+
20+ //--- struct_with_ptrauth_field.h
21+ typedef int (* FuncTy ) (int , int );
22+
23+ struct S {
24+ FuncTy __ptrauth (0 , 1 , 1234 ) foo ;
25+ int v ;
26+ };
27+
28+ struct T {
29+ struct S s ;
30+ char arr [64 ];
31+ };
32+
33+ //--- module.modulemap
34+ module mod1 {
35+ header "struct_with_ptrauth_field.h"
36+ }
You can’t perform that action at this time.
0 commit comments