Skip to content

Conversation

@vitalybuka
Copy link
Collaborator

@vitalybuka vitalybuka commented Nov 20, 2025

This partially reverts #152192, keeping updated tests and
some code reordering in clang/lib/CodeGen/CGExpr.cpp.

compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp is exact revert (with followup #152419)

We don't have a good use case for that, so revert it before we are stuck maintaining this API.

21.x does not have this patch.

This reverts commit a1209d8.

Created using spr 1.3.7
@llvmbot llvmbot added compiler-rt clang:codegen IR generation bugs: mangling, exceptions, etc. compiler-rt:ubsan Undefined behavior sanitizer compiler-rt:sanitizer labels Nov 20, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 20, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

@llvm/pr-subscribers-clang-codegen

Author: Vitaly Buka (vitalybuka)

Changes

We don't have good use case for that, so revert it before we stuck with this API.

This reverts commit a1209d8.


Full diff: https://github.com/llvm/llvm-project/pull/168812.diff

4 Files Affected:

  • (modified) clang/lib/CodeGen/CGExpr.cpp (-16)
  • (modified) compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp (+13-39)
  • (modified) compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp (+1-1)
  • (modified) compiler-rt/test/ubsan_minimal/TestCases/null.cpp (+1-1)
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index f2451b16e78be..ffc213b2bd331 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -3898,22 +3898,6 @@ void CodeGenFunction::EmitCheck(
   Branch->setMetadata(llvm::LLVMContext::MD_prof, Node);
   EmitBlock(Handlers);
 
-  // Clear arguments for the MinimalRuntime handler.
-  if (CGM.getCodeGenOpts().SanitizeMinimalRuntime) {
-    switch (CheckHandler) {
-    case SanitizerHandler::TypeMismatch:
-      // Pass value pointer only. It adds minimal overhead.
-      StaticArgs = {};
-      assert(DynamicArgs.size() == 1);
-      break;
-    default:
-      // No arguments for other checks.
-      StaticArgs = {};
-      DynamicArgs = {};
-      break;
-    }
-  }
-
   // Handler functions take an i8* pointing to the (handler-specific) static
   // information block, followed by a sequence of intptr_t arguments
   // representing operand values.
diff --git a/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp b/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp
index a2a2e36e8523d..ebc36a8583e05 100644
--- a/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp
+++ b/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp
@@ -34,16 +34,12 @@ static char *append_hex(uintptr_t d, char *buf, const char *end) {
   return buf;
 }
 
-static void format_msg(const char *kind, uintptr_t caller,
-                       const uintptr_t *address, char *buf, const char *end) {
+static void format_msg(const char *kind, uintptr_t caller, char *buf,
+                       const char *end) {
   buf = append_str("ubsan: ", buf, end);
   buf = append_str(kind, buf, end);
   buf = append_str(" by 0x", buf, end);
   buf = append_hex(caller, buf, end);
-  if (address) {
-    buf = append_str(" address 0x", buf, end);
-    buf = append_hex(*address, buf, end);
-  }
   buf = append_str("\n", buf, end);
   if (buf == end)
     --buf; // Make sure we don't cause a buffer overflow.
@@ -51,7 +47,7 @@ static void format_msg(const char *kind, uintptr_t caller,
 }
 
 SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_report_error, const char *kind,
-                             uintptr_t caller, const uintptr_t *address) {
+                             uintptr_t caller) {
   if (caller == 0)
     return;
   while (true) {
@@ -84,32 +80,28 @@ SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_report_error, const char *kind,
     __sanitizer::atomic_store_relaxed(&caller_pcs[sz], caller);
 
     char msg_buf[128];
-    format_msg(kind, caller, address, msg_buf, msg_buf + sizeof(msg_buf));
+    format_msg(kind, caller, msg_buf, msg_buf + sizeof(msg_buf));
     message(msg_buf);
   }
 }
 
 SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_report_error_fatal, const char *kind,
-                             uintptr_t caller, const uintptr_t *address) {
+                             uintptr_t caller) {
   // Use another handlers, in case it's already overriden.
-  __ubsan_report_error(kind, caller, address);
+  __ubsan_report_error(kind, caller);
 }
 
 #if defined(__ANDROID__)
 extern "C" __attribute__((weak)) void android_set_abort_message(const char *);
-static void abort_with_message(const char *kind, uintptr_t caller,
-                               const uintptr_t *address) {
+static void abort_with_message(const char *kind, uintptr_t caller) {
   char msg_buf[128];
-  format_msg(kind, caller, address, msg_buf, msg_buf + sizeof(msg_buf));
+  format_msg(kind, caller, msg_buf, msg_buf + sizeof(msg_buf));
   if (&android_set_abort_message)
     android_set_abort_message(msg_buf);
   abort();
 }
 #else
-static void abort_with_message(const char *kind, uintptr_t caller,
-                               const uintptr_t *address) {
-  abort();
-}
+static void abort_with_message(const char *kind, uintptr_t caller) { abort(); }
 #endif
 
 #if SANITIZER_DEBUG
@@ -129,39 +121,21 @@ void NORETURN CheckFailed(const char *file, int, const char *cond, u64, u64) {
 
 #define HANDLER_RECOVER(name, kind)                                            \
   INTERFACE void __ubsan_handle_##name##_minimal() {                           \
-    __ubsan_report_error(kind, GET_CALLER_PC(), nullptr);                      \
+    __ubsan_report_error(kind, GET_CALLER_PC());                               \
   }
 
 #define HANDLER_NORECOVER(name, kind)                                          \
   INTERFACE void __ubsan_handle_##name##_minimal_abort() {                     \
     uintptr_t caller = GET_CALLER_PC();                                        \
-    __ubsan_report_error_fatal(kind, caller, nullptr);                         \
-    abort_with_message(kind, caller, nullptr);                                 \
+    __ubsan_report_error_fatal(kind, caller);                                  \
+    abort_with_message(kind, caller);                                          \
   }
 
 #define HANDLER(name, kind)                                                    \
   HANDLER_RECOVER(name, kind)                                                  \
   HANDLER_NORECOVER(name, kind)
 
-#define HANDLER_RECOVER_PTR(name, kind)                                        \
-  INTERFACE void __ubsan_handle_##name##_minimal(const uintptr_t address) {    \
-    __ubsan_report_error(kind, GET_CALLER_PC(), &address);                     \
-  }
-
-#define HANDLER_NORECOVER_PTR(name, kind)                                      \
-  INTERFACE void __ubsan_handle_##name##_minimal_abort(                        \
-      const uintptr_t address) {                                               \
-    uintptr_t caller = GET_CALLER_PC();                                        \
-    __ubsan_report_error_fatal(kind, caller, &address);                        \
-    abort_with_message(kind, caller, &address);                                \
-  }
-
-// A version of a handler that takes a pointer to a value.
-#define HANDLER_PTR(name, kind)                                                \
-  HANDLER_RECOVER_PTR(name, kind)                                              \
-  HANDLER_NORECOVER_PTR(name, kind)
-
-HANDLER_PTR(type_mismatch, "type-mismatch")
+HANDLER(type_mismatch, "type-mismatch")
 HANDLER(alignment_assumption, "alignment-assumption")
 HANDLER(add_overflow, "add-overflow")
 HANDLER(sub_overflow, "sub-overflow")
diff --git a/compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp b/compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp
index cf828792a324f..3f01dc8444489 100644
--- a/compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp
+++ b/compiler-rt/test/ubsan_minimal/TestCases/misalignment.cpp
@@ -7,7 +7,7 @@ int *t;
 int main() {
   int r;
   t = (int *)(((char *)&r) + 1);
-  // CHECK: ubsan: type-mismatch by 0x{{[[:xdigit:]]+}} address 0x{{[[:xdigit:]]+$}}
+  // CHECK: ubsan: type-mismatch by 0x{{[[:xdigit:]]+}}
   // CHECK-NOT: type-mismatch
   f(*t);
 }
diff --git a/compiler-rt/test/ubsan_minimal/TestCases/null.cpp b/compiler-rt/test/ubsan_minimal/TestCases/null.cpp
index c97527b72cd0c..b3d9db2b309d1 100644
--- a/compiler-rt/test/ubsan_minimal/TestCases/null.cpp
+++ b/compiler-rt/test/ubsan_minimal/TestCases/null.cpp
@@ -5,7 +5,7 @@ void f(int &n) {}
 int *t;
 
 int main() {
-  // CHECK: ubsan: type-mismatch by 0x{{[[:xdigit:]]+}} address 0x{{[[:xdigit:]]+$}}
+  // CHECK: ubsan: type-mismatch by 0x{{[[:xdigit:]]+}}
   // CHECK-NOT: type-mismatch
   f(*t);
 }

@vitalybuka vitalybuka requested a review from fmayer November 20, 2025 03:06
@vitalybuka
Copy link
Collaborator Author

CC @alazarev @padriff

@github-actions
Copy link

🐧 Linux x64 Test Results

  • 84694 tests passed
  • 1094 tests skipped
  • 4 tests failed

Failed Tests

(click on a test name to see its output)

Clang

Clang.CodeGen/cfi-icall-trap-recover-runtime.c
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-icall -fsanitize-trap=cfi-icall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=TRAP /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-icall -fsanitize-trap=cfi-icall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=TRAP /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# note: command had no output on stdout or stderr
# RUN: at line 4
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-icall -fno-sanitize-trap=cfi-icall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=ABORT /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-icall -fno-sanitize-trap=cfi-icall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=ABORT /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# note: command had no output on stdout or stderr
# RUN: at line 6
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-icall -fno-sanitize-trap=cfi-icall -fsanitize-recover=cfi-icall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=RECOVER /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-icall -fno-sanitize-trap=cfi-icall -fsanitize-recover=cfi-icall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=RECOVER /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# note: command had no output on stdout or stderr
# RUN: at line 8
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-icall -fno-sanitize-trap=cfi-icall -fsanitize-minimal-runtime -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=ABORT_MIN /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-icall -fno-sanitize-trap=cfi-icall -fsanitize-minimal-runtime -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=ABORT_MIN /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c:122:20: error: ABORT_MIN-NEXT: expected string not found in input
# | // ABORT_MIN-NEXT: call void @__ubsan_handle_cfi_check_fail_minimal_abort() #[[ATTR4:[0-9]+]], !nosanitize [[META10]]
# |                    ^
# | <stdin>:31:24: note: scanning from here
# | handler.cfi_check_fail: ; preds = %entry
# |                        ^
# | <stdin>:31:24: note: with "META10" equal to "!10"
# | handler.cfi_check_fail: ; preds = %entry
# |                        ^
# | <stdin>:33:2: note: possible intended match here
# |  call void @__ubsan_handle_cfi_check_fail_minimal_abort(ptr @anon.3d4044d65abdda407a92991f1300ec97.1, i64 %4, i64 undef) #4, !nosanitize !10
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/cfi-icall-trap-recover-runtime.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            26:  store ptr %cond, ptr %fp, align 8 
# |            27:  %2 = load ptr, ptr %fp, align 8 
# |            28:  %3 = call i1 @llvm.type.test(ptr %2, metadata !"_ZTSFvE"), !nosanitize !10 
# |            29:  br i1 %3, label %cont, label %handler.cfi_check_fail, !prof !11, !nosanitize !10 
# |            30:  
# |            31: handler.cfi_check_fail: ; preds = %entry 
# | next:122'0                            X~~~~~~~~~~~~~~~~~ error: no match found
# | next:122'1                                               with "META10" equal to "!10"
# |            32:  %4 = ptrtoint ptr %2 to i64, !nosanitize !10 
# | next:122'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            33:  call void @__ubsan_handle_cfi_check_fail_minimal_abort(ptr @anon.3d4044d65abdda407a92991f1300ec97.1, i64 %4, i64 undef) #4, !nosanitize !10 
# | next:122'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:122'2      ?                                                                                                                                            possible intended match
# |            34:  unreachable, !nosanitize !10 
# | next:122'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            35:  
# | next:122'0     ~
# |            36: cont: ; preds = %entry 
# | next:122'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |            37:  call void (...) %2() 
# | next:122'0     ~~~~~~~~~~~~~~~~~~~~~~
# |            38:  ret void 
# | next:122'0     ~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

Clang.CodeGen/ubsan-trap-merge.c
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 9
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -emit-llvm -fsanitize=signed-integer-overflow -O3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c -o - -fsanitize-trap=signed-integer-overflow | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c --check-prefixes=TRAP-NOMERGE
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -emit-llvm -fsanitize=signed-integer-overflow -O3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c -o - -fsanitize-trap=signed-integer-overflow
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c --check-prefixes=TRAP-NOMERGE
# note: command had no output on stdout or stderr
# RUN: at line 10
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -emit-llvm -fsanitize=signed-integer-overflow -O3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c -o -                                         | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c --check-prefixes=HANDLER-NOMERGE
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -emit-llvm -fsanitize=signed-integer-overflow -O3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c --check-prefixes=HANDLER-NOMERGE
# note: command had no output on stdout or stderr
# RUN: at line 11
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -emit-llvm -fsanitize=signed-integer-overflow -O3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c -o - -fsanitize-minimal-runtime              | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c --check-prefixes=MINRT-NOMERGE
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -emit-llvm -fsanitize=signed-integer-overflow -O3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c -o - -fsanitize-minimal-runtime
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c --check-prefixes=MINRT-NOMERGE
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c:96:24: error: MINRT-NOMERGE-NEXT: expected string not found in input
# | // MINRT-NOMERGE-NEXT: tail call void @__ubsan_handle_add_overflow_minimal_abort() #[[ATTR4:[0-9]+]], !nosanitize [[META2]]
# |                        ^
# | <stdin>:21:22: note: scanning from here
# | handler.add_overflow: ; preds = %entry
# |                      ^
# | <stdin>:21:22: note: with "META2" equal to "!6"
# | handler.add_overflow: ; preds = %entry
# |                      ^
# | <stdin>:23:2: note: possible intended match here
# |  tail call void @__ubsan_handle_add_overflow_minimal_abort(ptr nonnull @1, i64 %2, i64 125) #4, !nosanitize !6
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c:219:87: error: undefined variable: ATTR4
# | // MINRT-NOMERGE-NEXT: tail call void @__ubsan_handle_add_overflow_minimal_abort() #[[ATTR4]], !nosanitize [[META2]]
# |                                                                                       ^
# | <stdin>:44:22: note: with "META2" equal to "!6"
# | handler.add_overflow: ; preds = %entry
# |                      ^
# | <stdin>:46:2: note: possible intended match here
# |  tail call void @__ubsan_handle_add_overflow_minimal_abort(ptr nonnull @2, i64 %2, i64 127) #4, !nosanitize !6
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c:368:87: error: undefined variable: ATTR4
# | // MINRT-NOMERGE-NEXT: tail call void @__ubsan_handle_add_overflow_minimal_abort() #[[ATTR4]], !nosanitize [[META2]]
# |                                                                                       ^
# | <stdin>:61:22: note: with "META2" equal to "!6"
# | handler.add_overflow: ; preds = %entry
# |                      ^
# | <stdin>:63:2: note: possible intended match here
# |  tail call void @__ubsan_handle_add_overflow_minimal_abort(ptr nonnull @3, i64 %2, i64 127) #4, !nosanitize !6
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c:613:87: error: undefined variable: ATTR4
# | // MINRT-NOMERGE-NEXT: tail call void @__ubsan_handle_add_overflow_minimal_abort() #[[ATTR4]], !nosanitize [[META2]]
# |                                                                                       ^
# | <stdin>:90:24: note: with "META2" equal to "!6"
# | handler.add_overflow.i: ; preds = %entry
# |                        ^
# | <stdin>:92:2: note: possible intended match here
# |  tail call void @__ubsan_handle_add_overflow_minimal_abort(ptr nonnull @1, i64 %2, i64 125) #4, !nosanitize !6
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/ubsan-trap-merge.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            16: entry: 
# |            17:  %0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %x, i32 125), !nosanitize !6 
# |            18:  %1 = extractvalue { i32, i1 } %0, 1, !nosanitize !6 
# |            19:  br i1 %1, label %handler.add_overflow, label %cont, !prof !7, !nosanitize !6 
# |            20:  
# |            21: handler.add_overflow: ; preds = %entry 
# | next:96'0                           X~~~~~~~~~~~~~~~~~ error: no match found
# | next:96'1                                              with "META2" equal to "!6"
# |            22:  %2 = zext nneg i32 %x to i64, !nosanitize !6 
# | next:96'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            23:  tail call void @__ubsan_handle_add_overflow_minimal_abort(ptr nonnull @1, i64 %2, i64 125) #4, !nosanitize !6 
# | next:96'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:96'2       ?                                                                                                              possible intended match
# |            24:  unreachable, !nosanitize !6 
# | next:96'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            25:  
# | next:96'0      ~
# |            26: cont: ; preds = %entry 
# | next:96'0      ~~~~~~~~~~~~~~~~~~~~~~~
# |            27:  %3 = extractvalue { i32, i1 } %0, 0, !nosanitize !6 
# | next:96'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            28:  ret i32 %3 
# | next:96'0      ~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |            39: entry: 
# |            40:  %0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %x, i32 127), !nosanitize !6 
# |            41:  %1 = extractvalue { i32, i1 } %0, 1, !nosanitize !6 
# |            42:  br i1 %1, label %handler.add_overflow, label %cont, !prof !7, !nosanitize !6 
# |            43:  
# |            44: handler.add_overflow: ; preds = %entry 
# | next:219'0                          X~~~~~~~~~~~~~~~~~ error: match failed for invalid pattern
# | next:219'1                                             undefined variable: ATTR4
# | next:219'2                                             with "META2" equal to "!6"
# |            45:  %2 = zext nneg i32 %x to i64, !nosanitize !6 
# | next:219'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            46:  tail call void @__ubsan_handle_add_overflow_minimal_abort(ptr nonnull @2, i64 %2, i64 127) #4, !nosanitize !6 
# | next:219'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:219'3      ?                                                                                                              possible intended match
# |            47:  unreachable, !nosanitize !6 
# | next:219'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            48:  
# | next:219'0     ~
# |            49: cont: ; preds = %entry 
# | next:219'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |            50:  %3 = extractvalue { i32, i1 } %0, 0, !nosanitize !6 
# | next:219'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            51:  ret i32 %3 
# | next:219'0     ~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |            56: entry: 
# |            57:  %0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %x, i32 127), !nosanitize !6 
# |            58:  %1 = extractvalue { i32, i1 } %0, 1, !nosanitize !6 
# |            59:  br i1 %1, label %handler.add_overflow, label %cont, !prof !7, !nosanitize !6 
# |            60:  
# |            61: handler.add_overflow: ; preds = %entry 
# | next:368'0                          X~~~~~~~~~~~~~~~~~ error: match failed for invalid pattern
# | next:368'1                                             undefined variable: ATTR4
# | next:368'2                                             with "META2" equal to "!6"
# |            62:  %2 = zext nneg i32 %x to i64, !nosanitize !6 
# | next:368'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            63:  tail call void @__ubsan_handle_add_overflow_minimal_abort(ptr nonnull @3, i64 %2, i64 127) #4, !nosanitize !6 
# | next:368'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:368'3      ?                                                                                                              possible intended match
# |            64:  unreachable, !nosanitize !6 
# | next:368'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            65:  
# | next:368'0     ~
# |            66: cont: ; preds = %entry 
# | next:368'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |            67:  %3 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %y, i32 129), !nosanitize !6 
# | next:368'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            68:  %4 = extractvalue { i32, i1 } %3, 1, !nosanitize !6 
# | next:368'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |            85: entry: 
# |            86:  %0 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %x, i32 125), !nosanitize !6 
# |            87:  %1 = extractvalue { i32, i1 } %0, 1, !nosanitize !6 
# |            88:  br i1 %1, label %handler.add_overflow.i, label %f.exit, !prof !7, !nosanitize !6 
# |            89:  
# |            90: handler.add_overflow.i: ; preds = %entry 
# | next:613'0                            X~~~~~~~~~~~~~~~~~ error: match failed for invalid pattern
# | next:613'1                                               undefined variable: ATTR4
# | next:613'2                                               with "META2" equal to "!6"
# |            91:  %2 = zext nneg i32 %x to i64, !nosanitize !6 
# | next:613'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            92:  tail call void @__ubsan_handle_add_overflow_minimal_abort(ptr nonnull @1, i64 %2, i64 125) #4, !nosanitize !6 
# | next:613'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:613'3      ?                                                                                                              possible intended match
# |            93:  unreachable, !nosanitize !6 
# | next:613'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            94:  
# | next:613'0     ~
# |            95: f.exit: ; preds = %entry 
# | next:613'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
# |            96:  %3 = extractvalue { i32, i1 } %0, 0, !nosanitize !6 
# | next:613'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            97:  %4 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %y, i32 127), !nosanitize !6 
# | next:613'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

Clang.CodeGen/unsigned-overflow-minimal.c
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -fsanitize=unsigned-integer-overflow -fsanitize-minimal-runtime /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/unsigned-overflow-minimal.c -emit-llvm -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/unsigned-overflow-minimal.c
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -triple x86_64-linux-gnu -fsanitize=unsigned-integer-overflow -fsanitize-minimal-runtime /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/unsigned-overflow-minimal.c -emit-llvm -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/unsigned-overflow-minimal.c
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/unsigned-overflow-minimal.c:7:12: error: CHECK: expected string not found in input
# |  // CHECK: call void @__ubsan_handle_add_overflow_minimal_abort()
# |            ^
# | <stdin>:16:37: note: scanning from here
# | define dso_local void @testlongadd() #0 {
# |                                     ^
# | <stdin>:27:2: note: possible intended match here
# |  call void @__ubsan_handle_add_overflow_minimal_abort(ptr @1, i64 %0, i64 %1) #3, !nosanitize !2
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/unsigned-overflow-minimal.c:13:12: error: CHECK: expected string not found in input
# |  // CHECK: call void @__ubsan_handle_sub_overflow_minimal_abort()
# |            ^
# | <stdin>:42:37: note: scanning from here
# | define dso_local void @testlongsub() #0 {
# |                                     ^
# | <stdin>:53:2: note: possible intended match here
# |  call void @__ubsan_handle_sub_overflow_minimal_abort(ptr @2, i64 %0, i64 %1) #3, !nosanitize !2
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/unsigned-overflow-minimal.c:19:12: error: CHECK: expected string not found in input
# |  // CHECK: call void @__ubsan_handle_mul_overflow_minimal_abort()
# |            ^
# | <stdin>:68:37: note: scanning from here
# | define dso_local void @testlongmul() #0 {
# |                                     ^
# | <stdin>:79:2: note: possible intended match here
# |  call void @__ubsan_handle_mul_overflow_minimal_abort(ptr @3, i64 %0, i64 %1) #3, !nosanitize !2
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGen/unsigned-overflow-minimal.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            11: @li = global i64 0, align 8 
# |            12: @2 = private unnamed_addr global { { ptr, i32, i32 }, ptr } { { ptr, i32, i32 } { ptr @.src, i32 14, i32 11 }, ptr @0 } 
# |            13: @3 = private unnamed_addr global { { ptr, i32, i32 }, ptr } { { ptr, i32, i32 } { ptr @.src, i32 20, i32 11 }, ptr @0 } 
# |            14:  
# |            15: ; Function Attrs: noinline nounwind optnone 
# |            16: define dso_local void @testlongadd() #0 { 
# | check:7'0                                          X~~~~~ error: no match found
# |            17: entry: 
# | check:7'0      ~~~~~~~
# |            18:  %0 = load i64, ptr @lj, align 8 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            19:  %1 = load i64, ptr @lk, align 8 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            20:  %2 = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %0, i64 %1), !nosanitize !2 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            21:  %3 = extractvalue { i64, i1 } %2, 0, !nosanitize !2 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            22:  %4 = extractvalue { i64, i1 } %2, 1, !nosanitize !2 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            23:  %5 = xor i1 %4, true, !nosanitize !2 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            24:  br i1 %5, label %cont, label %handler.add_overflow, !prof !3, !nosanitize !2 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            25:  
# | check:7'0      ~
# |            26: handler.add_overflow: ; preds = %entry 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            27:  call void @__ubsan_handle_add_overflow_minimal_abort(ptr @1, i64 %0, i64 %1) #3, !nosanitize !2 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:7'1       ?                                                                                                possible intended match
# |            28:  unreachable, !nosanitize !2 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            29:  
# | check:7'0      ~
# |            30: cont: ; preds = %entry 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~
# |            31:  store i64 %3, ptr @li, align 8 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            32:  ret void 
# | check:7'0      ~~~~~~~~~~
# |             .
# |             .
# |             .
# |            37:  
# | check:7'0      ~
# |            38: ; Function Attrs: noreturn nounwind uwtable 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            39: declare void @__ubsan_handle_add_overflow_minimal_abort(ptr, i64, i64) #2 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            40:  
# | check:7'0      ~
# |            41: ; Function Attrs: noinline nounwind optnone 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            42: define dso_local void @testlongsub() #0 { 
# | check:7'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:13'0                                         X~~~~~ error: no match found
# |            43: entry: 
# | check:13'0     ~~~~~~~
# |            44:  %0 = load i64, ptr @lj, align 8 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            45:  %1 = load i64, ptr @lk, align 8 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            46:  %2 = call { i64, i1 } @llvm.usub.with.overflow.i64(i64 %0, i64 %1), !nosanitize !2 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            47:  %3 = extractvalue { i64, i1 } %2, 0, !nosanitize !2 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            48:  %4 = extractvalue { i64, i1 } %2, 1, !nosanitize !2 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            49:  %5 = xor i1 %4, true, !nosanitize !2 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            50:  br i1 %5, label %cont, label %handler.sub_overflow, !prof !3, !nosanitize !2 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            51:  
# | check:13'0     ~
# |            52: handler.sub_overflow: ; preds = %entry 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            53:  call void @__ubsan_handle_sub_overflow_minimal_abort(ptr @2, i64 %0, i64 %1) #3, !nosanitize !2 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:13'1      ?                                                                                                possible intended match
# |            54:  unreachable, !nosanitize !2 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            55:  
# | check:13'0     ~
# |            56: cont: ; preds = %entry 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |            57:  store i64 %3, ptr @li, align 8 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            58:  ret void 
# | check:13'0     ~~~~~~~~~~
# |             .
# |             .
# |             .
# |            63:  
# | check:13'0     ~
# |            64: ; Function Attrs: noreturn nounwind uwtable 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            65: declare void @__ubsan_handle_sub_overflow_minimal_abort(ptr, i64, i64) #2 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            66:  
# | check:13'0     ~
# |            67: ; Function Attrs: noinline nounwind optnone 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            68: define dso_local void @testlongmul() #0 { 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:19'0                                         X~~~~~ error: no match found
# |            69: entry: 
# | check:19'0     ~~~~~~~
# |            70:  %0 = load i64, ptr @lj, align 8 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            71:  %1 = load i64, ptr @lk, align 8 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            72:  %2 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %0, i64 %1), !nosanitize !2 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            73:  %3 = extractvalue { i64, i1 } %2, 0, !nosanitize !2 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            74:  %4 = extractvalue { i64, i1 } %2, 1, !nosanitize !2 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            75:  %5 = xor i1 %4, true, !nosanitize !2 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            76:  br i1 %5, label %cont, label %handler.mul_overflow, !prof !3, !nosanitize !2 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            77:  
# | check:19'0     ~
# |            78: handler.mul_overflow: ; preds = %entry 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            79:  call void @__ubsan_handle_mul_overflow_minimal_abort(ptr @3, i64 %0, i64 %1) #3, !nosanitize !2 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:19'1      ?                                                                                                possible intended match
# |            80:  unreachable, !nosanitize !2 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            81:  
# | check:19'0     ~
# |            82: cont: ; preds = %entry 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |            83:  store i64 %3, ptr @li, align 8 
# | check:19'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            84:  ret void 
# | check:19'0     ~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

Clang.CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-vcall -fsanitize-trap=cfi-vcall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=TRAP /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-vcall -fsanitize-trap=cfi-vcall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=TRAP /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# note: command had no output on stdout or stderr
# RUN: at line 4
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-vcall -fno-sanitize-trap=cfi-vcall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=ABORT /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-vcall -fno-sanitize-trap=cfi-vcall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=ABORT /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# note: command had no output on stdout or stderr
# RUN: at line 6
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-vcall -fno-sanitize-trap=cfi-vcall -fsanitize-recover=cfi-vcall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=RECOVER /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-vcall -fno-sanitize-trap=cfi-vcall -fsanitize-recover=cfi-vcall -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=RECOVER /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# note: command had no output on stdout or stderr
# RUN: at line 8
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-vcall -fno-sanitize-trap=cfi-vcall -fsanitize-minimal-runtime -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=ABORT_MIN /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/22/include -nostdsysteminc -fsanitize=cfi-vcall -fno-sanitize-trap=cfi-vcall -fsanitize-minimal-runtime -flto -fvisibility=hidden -triple x86_64-unknown-linux -fwhole-program-vtables -emit-llvm -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --check-prefix=ABORT_MIN /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp:87:20: error: ABORT_MIN-NEXT: expected string not found in input
# | // ABORT_MIN-NEXT: call void @__ubsan_handle_cfi_check_fail_minimal_abort() #[[ATTR3:[0-9]+]], !nosanitize [[META5]]
# |                    ^
# | <stdin>:21:24: note: scanning from here
# | handler.cfi_check_fail: ; preds = %entry
# |                        ^
# | <stdin>:21:24: note: with "META5" equal to "!5"
# | handler.cfi_check_fail: ; preds = %entry
# |                        ^
# | <stdin>:24:2: note: possible intended match here
# |  call void @__ubsan_handle_cfi_check_fail_minimal_abort(ptr @anon.00e38160576ab76122d2f8d139d2e390.1, i64 %3, i64 %4) #3, !nosanitize !5
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CodeGenCXX/cfi-vcall-trap-recover-runtime.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           16:  %vtable = load ptr, ptr %0, align 8 
# |           17:  %1 = call i1 @llvm.type.test(ptr %vtable, metadata !"_ZTS2S1"), !nosanitize !5 
# |           18:  %2 = call i1 @llvm.type.test(ptr %vtable, metadata !"all-vtables"), !nosanitize !5 
# |           19:  br i1 %1, label %cont, label %handler.cfi_check_fail, !prof !6, !nosanitize !5 
# |           20:  
# |           21: handler.cfi_check_fail: ; preds = %entry 
# | next:87'0                            X~~~~~~~~~~~~~~~~~ error: no match found
# | next:87'1                                               with "META5" equal to "!5"
# |           22:  %3 = ptrtoint ptr %vtable to i64, !nosanitize !5 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           23:  %4 = zext i1 %2 to i64, !nosanitize !5 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           24:  call void @__ubsan_handle_cfi_check_fail_minimal_abort(ptr @anon.00e38160576ab76122d2f8d139d2e390.1, i64 %3, i64 %4) #3, !nosanitize !5 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:87'2      ?                                                                                                                                        possible intended match
# |           25:  unreachable, !nosanitize !5 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           26:  
# | next:87'0     ~
# |           27: cont: ; preds = %entry 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |           28:  %vfn = getelementptr inbounds ptr, ptr %vtable, i64 0 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           29:  %5 = load ptr, ptr %vfn, align 8 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:codegen IR generation bugs: mangling, exceptions, etc. compiler-rt:sanitizer compiler-rt:ubsan Undefined behavior sanitizer compiler-rt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants