Skip to content

[NFC][LowerTypeTests] Pre-commit tests with debug info kill switch#195373

Merged
vitalybuka merged 1 commit into
mainfrom
users/vitalybuka/spr/nfclowertypetests-pre-commit-tests-with-debug-info-kill-switch
May 1, 2026
Merged

[NFC][LowerTypeTests] Pre-commit tests with debug info kill switch#195373
vitalybuka merged 1 commit into
mainfrom
users/vitalybuka/spr/nfclowertypetests-pre-commit-tests-with-debug-info-kill-switch

Conversation

@vitalybuka

@vitalybuka vitalybuka commented May 1, 2026

Copy link
Copy Markdown
Contributor

For #194493

Created using spr 1.3.7
@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-llvm-transforms

Author: Vitaly Buka (vitalybuka)

Changes

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

2 Files Affected:

  • (modified) llvm/test/Transforms/LowerTypeTests/aarch64-jumptable-dbg.ll (+39)
  • (modified) llvm/test/Transforms/LowerTypeTests/x86-jumptable-dbg.ll (+38)
diff --git a/llvm/test/Transforms/LowerTypeTests/aarch64-jumptable-dbg.ll b/llvm/test/Transforms/LowerTypeTests/aarch64-jumptable-dbg.ll
index c10f16bf1f4d3..ce7d44085e488 100644
--- a/llvm/test/Transforms/LowerTypeTests/aarch64-jumptable-dbg.ll
+++ b/llvm/test/Transforms/LowerTypeTests/aarch64-jumptable-dbg.ll
@@ -1,5 +1,6 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals --include-generated-funcs
 ; RUN: opt -S -passes=lowertypetests -mtriple=aarch64-unknown-linux-gnu %s | FileCheck --check-prefixes=AARCH64 %s
+; RUN: opt -S -passes=lowertypetests -mtriple=aarch64-unknown-linux-gnu %s | FileCheck --check-prefixes=AARCH64-OFF %s
 
 ; Test for the jump table generation with branch protection on AArch64
 
@@ -37,6 +38,11 @@ define i1 @foo(ptr %p) {
 ; AARCH64: @f = alias [8 x i8], ptr @.cfi.jumptable
 ; AARCH64: @g = internal alias [8 x i8], getelementptr inbounds ([2 x [8 x i8]], ptr @.cfi.jumptable, i64 0, i64 1)
 ;.
+; AARCH64-OFF: @[[GLOB0:[0-9]+]] = private unnamed_addr constant [2 x ptr] [ptr @f, ptr @g], align 16
+; AARCH64-OFF: @[[GLOB1:[0-9]+]] = private constant [0 x i8] zeroinitializer
+; AARCH64-OFF: @f = alias [8 x i8], ptr @.cfi.jumptable
+; AARCH64-OFF: @g = internal alias [8 x i8], getelementptr inbounds ([2 x [8 x i8]], ptr @.cfi.jumptable, i64 0, i64 1)
+;.
 ; AARCH64-LABEL: @f.cfi(
 ; AARCH64-NEXT:    ret void
 ;
@@ -60,13 +66,46 @@ define i1 @foo(ptr %p) {
 ; AARCH64-NEXT:    call void asm sideeffect "bti c\0Ab $0\0A", "s"(ptr @g.cfi)
 ; AARCH64-NEXT:    unreachable
 ;
+;
+; AARCH64-OFF-LABEL: @f.cfi(
+; AARCH64-OFF-NEXT:    ret void
+;
+;
+; AARCH64-OFF-LABEL: @g.cfi(
+; AARCH64-OFF-NEXT:    ret void
+;
+;
+; AARCH64-OFF-LABEL: @foo(
+; AARCH64-OFF-NEXT:    [[TMP1:%.*]] = ptrtoint ptr [[P:%.*]] to i64
+; AARCH64-OFF-NEXT:    [[TMP2:%.*]] = sub i64 ptrtoint (ptr getelementptr (i8, ptr @.cfi.jumptable, i64 8) to i64), [[TMP1]]
+; AARCH64-OFF-NEXT:    [[TMP3:%.*]] = call i64 @llvm.fshr.i64(i64 [[TMP2]], i64 [[TMP2]], i64 3)
+; AARCH64-OFF-NEXT:    [[TMP4:%.*]] = icmp ule i64 [[TMP3]], 1
+; AARCH64-OFF-NEXT:    ret i1 [[TMP4]]
+;
+;
+; AARCH64-OFF: Function Attrs: naked noinline
+; AARCH64-OFF-LABEL: @.cfi.jumptable(
+; AARCH64-OFF-NEXT:  entry:
+; AARCH64-OFF-NEXT:    call void asm sideeffect "bti c\0Ab $0\0A", "s"(ptr @f.cfi)
+; AARCH64-OFF-NEXT:    call void asm sideeffect "bti c\0Ab $0\0A", "s"(ptr @g.cfi)
+; AARCH64-OFF-NEXT:    unreachable
+;
 ;.
 ; AARCH64: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
 ; AARCH64: attributes #[[ATTR1:[0-9]+]] = { naked noinline }
 ; AARCH64: attributes #[[ATTR2:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
 ;.
+; AARCH64-OFF: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+; AARCH64-OFF: attributes #[[ATTR1:[0-9]+]] = { naked noinline }
+; AARCH64-OFF: attributes #[[ATTR2:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
+;.
 ; AARCH64: [[META0:![0-9]+]] = !{i32 4, !"branch-target-enforcement", i32 1}
 ; AARCH64: [[META1:![0-9]+]] = !{i32 7, !"Dwarf Version", i32 5}
 ; AARCH64: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
 ; AARCH64: [[META3:![0-9]+]] = !{i32 0, !"typeid1"}
 ;.
+; AARCH64-OFF: [[META0:![0-9]+]] = !{i32 4, !"branch-target-enforcement", i32 1}
+; AARCH64-OFF: [[META1:![0-9]+]] = !{i32 7, !"Dwarf Version", i32 5}
+; AARCH64-OFF: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
+; AARCH64-OFF: [[META3:![0-9]+]] = !{i32 0, !"typeid1"}
+;.
diff --git a/llvm/test/Transforms/LowerTypeTests/x86-jumptable-dbg.ll b/llvm/test/Transforms/LowerTypeTests/x86-jumptable-dbg.ll
index d21ca284f911e..3d925fc3182d0 100644
--- a/llvm/test/Transforms/LowerTypeTests/x86-jumptable-dbg.ll
+++ b/llvm/test/Transforms/LowerTypeTests/x86-jumptable-dbg.ll
@@ -2,6 +2,7 @@
 ;; Test jump table generation with Indirect Branch Tracking on x86.
 ; RUN: opt -S -passes=lowertypetests -mtriple=i686 %s | FileCheck --check-prefixes=X86_32 %s
 ; RUN: opt -S -passes=lowertypetests -mtriple=x86_64 %s | FileCheck --check-prefixes=X86_64 %s
+; RUN: opt -S -passes=lowertypetests -mtriple=x86_64 %s | FileCheck --check-prefixes=X86_64-OFF %s
 
 @0 = private unnamed_addr constant [2 x ptr] [ptr @f, ptr @g], align 16
 
@@ -38,6 +39,11 @@ define i1 @foo(ptr %p) {
 ; X86_64: @f = alias [16 x i8], ptr @.cfi.jumptable
 ; X86_64: @g = internal alias [16 x i8], getelementptr inbounds ([2 x [16 x i8]], ptr @.cfi.jumptable, i64 0, i64 1)
 ;.
+; X86_64-OFF: @[[GLOB0:[0-9]+]] = private unnamed_addr constant [2 x ptr] [ptr @f, ptr @g], align 16
+; X86_64-OFF: @[[GLOB1:[0-9]+]] = private constant [0 x i8] zeroinitializer
+; X86_64-OFF: @f = alias [16 x i8], ptr @.cfi.jumptable
+; X86_64-OFF: @g = internal alias [16 x i8], getelementptr inbounds ([2 x [16 x i8]], ptr @.cfi.jumptable, i64 0, i64 1)
+;.
 ; X86_32-LABEL: @f.cfi(
 ; X86_32-NEXT:    ret void
 ;
@@ -83,6 +89,29 @@ define i1 @foo(ptr %p) {
 ; X86_64-NEXT:    call void asm sideeffect "endbr64\0Ajmp ${0:c}@plt\0A.balign 16, 0xcc\0A", "s"(ptr @g.cfi)
 ; X86_64-NEXT:    unreachable
 ;
+;
+; X86_64-OFF-LABEL: @f.cfi(
+; X86_64-OFF-NEXT:    ret void
+;
+;
+; X86_64-OFF-LABEL: @g.cfi(
+; X86_64-OFF-NEXT:    ret void
+;
+;
+; X86_64-OFF-LABEL: @foo(
+; X86_64-OFF-NEXT:    [[TMP1:%.*]] = ptrtoint ptr [[P:%.*]] to i64
+; X86_64-OFF-NEXT:    [[TMP2:%.*]] = sub i64 ptrtoint (ptr getelementptr (i8, ptr @.cfi.jumptable, i64 16) to i64), [[TMP1]]
+; X86_64-OFF-NEXT:    [[TMP3:%.*]] = call i64 @llvm.fshr.i64(i64 [[TMP2]], i64 [[TMP2]], i64 4)
+; X86_64-OFF-NEXT:    [[TMP4:%.*]] = icmp ule i64 [[TMP3]], 1
+; X86_64-OFF-NEXT:    ret i1 [[TMP4]]
+;
+;
+; X86_64-OFF-LABEL: @.cfi.jumptable(
+; X86_64-OFF-NEXT:  entry:
+; X86_64-OFF-NEXT:    call void asm sideeffect "endbr64\0Ajmp ${0:c}@plt\0A.balign 16, 0xcc\0A", "s"(ptr @f.cfi)
+; X86_64-OFF-NEXT:    call void asm sideeffect "endbr64\0Ajmp ${0:c}@plt\0A.balign 16, 0xcc\0A", "s"(ptr @g.cfi)
+; X86_64-OFF-NEXT:    unreachable
+;
 ;.
 ; X86_32: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
 ; X86_32: attributes #[[ATTR1:[0-9]+]] = { naked nocf_check noinline }
@@ -92,6 +121,10 @@ define i1 @foo(ptr %p) {
 ; X86_64: attributes #[[ATTR1:[0-9]+]] = { naked nocf_check noinline }
 ; X86_64: attributes #[[ATTR2:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
 ;.
+; X86_64-OFF: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+; X86_64-OFF: attributes #[[ATTR1:[0-9]+]] = { naked nocf_check noinline }
+; X86_64-OFF: attributes #[[ATTR2:[0-9]+]] = { nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) }
+;.
 ; X86_32: [[META0:![0-9]+]] = !{i32 8, !"cf-protection-branch", i32 1}
 ; X86_32: [[META1:![0-9]+]] = !{i32 7, !"Dwarf Version", i32 5}
 ; X86_32: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
@@ -102,3 +135,8 @@ define i1 @foo(ptr %p) {
 ; X86_64: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
 ; X86_64: [[META3:![0-9]+]] = !{i32 0, !"typeid1"}
 ;.
+; X86_64-OFF: [[META0:![0-9]+]] = !{i32 8, !"cf-protection-branch", i32 1}
+; X86_64-OFF: [[META1:![0-9]+]] = !{i32 7, !"Dwarf Version", i32 5}
+; X86_64-OFF: [[META2:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3}
+; X86_64-OFF: [[META3:![0-9]+]] = !{i32 0, !"typeid1"}
+;.

@fmayer

fmayer commented May 1, 2026

Copy link
Copy Markdown
Contributor

[NFC][LowerTypeTests] Pre-commit tests with debug info kill switch

for debug info kill switch?

@vitalybuka
vitalybuka enabled auto-merge (squash) May 1, 2026 22:51
vitalybuka added a commit to vitalybuka/llvm-project that referenced this pull request May 1, 2026
@vitalybuka
vitalybuka merged commit 2dca922 into main May 1, 2026
11 of 12 checks passed
@vitalybuka
vitalybuka deleted the users/vitalybuka/spr/nfclowertypetests-pre-commit-tests-with-debug-info-kill-switch branch May 1, 2026 23:33
enferex pushed a commit to enferex/llvm-project that referenced this pull request May 5, 2026
moar55 pushed a commit to moar55/llvm-project that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants