================
@@ -0,0 +1,42 @@
+// RUN: %clang_cc1 -Oz -triple x86_64-unknown-linux-gnu -fexceptions -o -
-emit-llvm %s | FileCheck %s
+
+typedef __UINT64_TYPE__ uint64_t;
+
+void abort(void) __attribute__((__noreturn__));
+
+typedef enum _Unwind_Reason_Code _Unwind_Reason_Code;
+typedef enum _Unwind_Action _Unwind_Action;
+
+struct _Unwind_Exception;
+struct _Unwind_Context;
+
+_Unwind_Reason_Code __swift_personality_v0(int version, _Unwind_Action action,
uint64_t exception_class, struct _Unwind_Exception *exception, struct
_Unwind_Context *context);
+
+void function(void);
+
+void __attribute__((__personality__(__swift_personality_v0)))
function_with_custom_personality(void) {
+}
+
+static void cleanup_int(int *p) {
+ *p = 0;
+}
+
+void function_without_custom_personality(void) {
+ int variable __attribute__((__cleanup__(cleanup_int))) = 1;
+ function();
+}
+
+int __undeclared_personality_v0(void) { return 0; }
----------------
erichkeane wrote:
Ah! I missed it was doing lookup.
> which means that you either define it before the use or you don't define it
This isn't really true, is it? IF we're not enforcing it, it isn't true.
There is no reason this couldn't be defined after line 32 below.
>The personalities would never be called - they are not regular functions.
ARE we preventing them from being called? If not, that is not true. So we
have to make sure that if someone decides to call
`__undeclared_personality_v0`, that it isn't problematic.
https://github.com/llvm/llvm-project/pull/185225
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits