From 9a3a87d189753b7cea14d109c012ba37671e4adf Mon Sep 17 00:00:00 2001 From: Kadir Cetinkaya Date: Wed, 9 Oct 2019 13:59:31 +0000 Subject: [PATCH 01/44] [clangd] Make sure ReplyCallbacks are destroyed before RequestCancelersMutex Summary: After rL374163, replycallbacks might have a cancellable context, which will try to access RequestCancellers on destruction. See http://45.33.8.238/mac/1245/step_7.txt for a sample failure. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits, thakis Tags: #clang Differential Revision: https://reviews.llvm.org/D68702 llvm-svn: 374168 --- clang-tools-extra/clangd/ClangdLSPServer.cpp | 23 +++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp index ea1517626596d..4dc3412538abb 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.cpp +++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -371,16 +371,6 @@ class ClangdLSPServer::MessageHandler : public Transport::MessageHandler { llvm::StringMap> Notifications; llvm::StringMap> Calls; - // The maximum number of callbacks held in clangd. - // - // We bound the maximum size to the pending map to prevent memory leakage - // for cases where LSP clients don't reply for the request. - static constexpr int MaxReplayCallbacks = 100; - mutable std::mutex CallMutex; - int NextCallID = 0; /* GUARDED_BY(CallMutex) */ - std::deque>> - ReplyCallbacks; /* GUARDED_BY(CallMutex) */ // Method calls may be cancelled by ID, so keep track of their state. // This needs a mutex: handlers may finish on a different thread, and that's @@ -432,6 +422,19 @@ class ClangdLSPServer::MessageHandler : public Transport::MessageHandler { })); } + // The maximum number of callbacks held in clangd. + // + // We bound the maximum size to the pending map to prevent memory leakage + // for cases where LSP clients don't reply for the request. + // This has to go after RequestCancellers and RequestCancellersMutex since it + // can contain a callback that has a cancelable context. + static constexpr int MaxReplayCallbacks = 100; + mutable std::mutex CallMutex; + int NextCallID = 0; /* GUARDED_BY(CallMutex) */ + std::deque>> + ReplyCallbacks; /* GUARDED_BY(CallMutex) */ + ClangdLSPServer &Server; }; constexpr int ClangdLSPServer::MessageHandler::MaxReplayCallbacks; From fcc9c4627e93f491c2a488af1f20551b9d156b18 Mon Sep 17 00:00:00 2001 From: David Green Date: Wed, 9 Oct 2019 14:17:38 +0000 Subject: [PATCH 02/44] Add and adjust saturating tests. NFC This adds some extra testing to the existing [su][add/sub]_sat X86 and AArch64 tests and adds equivalent tests for ARM. llvm-svn: 374169 --- llvm/test/CodeGen/AArch64/sadd_sat.ll | 42 +- llvm/test/CodeGen/AArch64/ssub_sat.ll | 42 +- llvm/test/CodeGen/AArch64/uadd_sat.ll | 32 +- llvm/test/CodeGen/AArch64/usub_sat.ll | 32 +- llvm/test/CodeGen/ARM/sadd_sat.ll | 415 ++++++++++++++++++ llvm/test/CodeGen/ARM/ssub_sat.ll | 608 ++++++++++++++++++++++++++ llvm/test/CodeGen/ARM/uadd_sat.ll | 199 +++++++++ llvm/test/CodeGen/ARM/usub_sat.ll | 196 +++++++++ llvm/test/CodeGen/X86/sadd_sat.ll | 74 +++- llvm/test/CodeGen/X86/ssub_sat.ll | 74 +++- llvm/test/CodeGen/X86/uadd_sat.ll | 54 ++- llvm/test/CodeGen/X86/usub_sat.ll | 54 ++- 12 files changed, 1792 insertions(+), 30 deletions(-) create mode 100644 llvm/test/CodeGen/ARM/sadd_sat.ll create mode 100644 llvm/test/CodeGen/ARM/ssub_sat.ll create mode 100644 llvm/test/CodeGen/ARM/uadd_sat.ll create mode 100644 llvm/test/CodeGen/ARM/usub_sat.ll diff --git a/llvm/test/CodeGen/AArch64/sadd_sat.ll b/llvm/test/CodeGen/AArch64/sadd_sat.ll index 4af00a5b79884..9651796ff937c 100644 --- a/llvm/test/CodeGen/AArch64/sadd_sat.ll +++ b/llvm/test/CodeGen/AArch64/sadd_sat.ll @@ -1,10 +1,12 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s -declare i4 @llvm.sadd.sat.i4 (i4, i4) -declare i32 @llvm.sadd.sat.i32 (i32, i32) -declare i64 @llvm.sadd.sat.i64 (i64, i64) -declare <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32>, <4 x i32>) +declare i4 @llvm.sadd.sat.i4(i4, i4) +declare i8 @llvm.sadd.sat.i8(i8, i8) +declare i16 @llvm.sadd.sat.i16(i16, i16) +declare i32 @llvm.sadd.sat.i32(i32, i32) +declare i64 @llvm.sadd.sat.i64(i64, i64) +declare <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32>, <4 x i32>) define i32 @func(i32 %x, i32 %y) nounwind { ; CHECK-LABEL: func: @@ -34,6 +36,38 @@ define i64 @func2(i64 %x, i64 %y) nounwind { ret i64 %tmp; } +define i16 @func16(i16 %x, i16 %y) nounwind { +; CHECK-LABEL: func16: +; CHECK: // %bb.0: +; CHECK-NEXT: lsl w8, w0, #16 +; CHECK-NEXT: adds w10, w8, w1, lsl #16 +; CHECK-NEXT: mov w9, #2147483647 +; CHECK-NEXT: cmp w10, #0 // =0 +; CHECK-NEXT: cinv w9, w9, ge +; CHECK-NEXT: adds w8, w8, w1, lsl #16 +; CHECK-NEXT: csel w8, w9, w8, vs +; CHECK-NEXT: asr w0, w8, #16 +; CHECK-NEXT: ret + %tmp = call i16 @llvm.sadd.sat.i16(i16 %x, i16 %y); + ret i16 %tmp; +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; CHECK-LABEL: func8: +; CHECK: // %bb.0: +; CHECK-NEXT: lsl w8, w0, #24 +; CHECK-NEXT: adds w10, w8, w1, lsl #24 +; CHECK-NEXT: mov w9, #2147483647 +; CHECK-NEXT: cmp w10, #0 // =0 +; CHECK-NEXT: cinv w9, w9, ge +; CHECK-NEXT: adds w8, w8, w1, lsl #24 +; CHECK-NEXT: csel w8, w9, w8, vs +; CHECK-NEXT: asr w0, w8, #24 +; CHECK-NEXT: ret + %tmp = call i8 @llvm.sadd.sat.i8(i8 %x, i8 %y); + ret i8 %tmp; +} + define i4 @func3(i4 %x, i4 %y) nounwind { ; CHECK-LABEL: func3: ; CHECK: // %bb.0: diff --git a/llvm/test/CodeGen/AArch64/ssub_sat.ll b/llvm/test/CodeGen/AArch64/ssub_sat.ll index 593bc090c626b..0fbe3c4a71cde 100644 --- a/llvm/test/CodeGen/AArch64/ssub_sat.ll +++ b/llvm/test/CodeGen/AArch64/ssub_sat.ll @@ -1,10 +1,12 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s -declare i4 @llvm.ssub.sat.i4 (i4, i4) -declare i32 @llvm.ssub.sat.i32 (i32, i32) -declare i64 @llvm.ssub.sat.i64 (i64, i64) -declare <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32>, <4 x i32>) +declare i4 @llvm.ssub.sat.i4(i4, i4) +declare i8 @llvm.ssub.sat.i8(i8, i8) +declare i16 @llvm.ssub.sat.i16(i16, i16) +declare i32 @llvm.ssub.sat.i32(i32, i32) +declare i64 @llvm.ssub.sat.i64(i64, i64) +declare <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32>, <4 x i32>) define i32 @func(i32 %x, i32 %y) nounwind { ; CHECK-LABEL: func: @@ -34,6 +36,38 @@ define i64 @func2(i64 %x, i64 %y) nounwind { ret i64 %tmp; } +define i16 @func16(i16 %x, i16 %y) nounwind { +; CHECK-LABEL: func16: +; CHECK: // %bb.0: +; CHECK-NEXT: lsl w8, w0, #16 +; CHECK-NEXT: subs w10, w8, w1, lsl #16 +; CHECK-NEXT: mov w9, #2147483647 +; CHECK-NEXT: cmp w10, #0 // =0 +; CHECK-NEXT: cinv w9, w9, ge +; CHECK-NEXT: subs w8, w8, w1, lsl #16 +; CHECK-NEXT: csel w8, w9, w8, vs +; CHECK-NEXT: asr w0, w8, #16 +; CHECK-NEXT: ret + %tmp = call i16 @llvm.ssub.sat.i16(i16 %x, i16 %y); + ret i16 %tmp; +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; CHECK-LABEL: func8: +; CHECK: // %bb.0: +; CHECK-NEXT: lsl w8, w0, #24 +; CHECK-NEXT: subs w10, w8, w1, lsl #24 +; CHECK-NEXT: mov w9, #2147483647 +; CHECK-NEXT: cmp w10, #0 // =0 +; CHECK-NEXT: cinv w9, w9, ge +; CHECK-NEXT: subs w8, w8, w1, lsl #24 +; CHECK-NEXT: csel w8, w9, w8, vs +; CHECK-NEXT: asr w0, w8, #24 +; CHECK-NEXT: ret + %tmp = call i8 @llvm.ssub.sat.i8(i8 %x, i8 %y); + ret i8 %tmp; +} + define i4 @func3(i4 %x, i4 %y) nounwind { ; CHECK-LABEL: func3: ; CHECK: // %bb.0: diff --git a/llvm/test/CodeGen/AArch64/uadd_sat.ll b/llvm/test/CodeGen/AArch64/uadd_sat.ll index da3eda4054069..61c40bc56665c 100644 --- a/llvm/test/CodeGen/AArch64/uadd_sat.ll +++ b/llvm/test/CodeGen/AArch64/uadd_sat.ll @@ -1,9 +1,11 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s -declare i4 @llvm.uadd.sat.i4 (i4, i4) -declare i32 @llvm.uadd.sat.i32 (i32, i32) -declare i64 @llvm.uadd.sat.i64 (i64, i64) +declare i4 @llvm.uadd.sat.i4(i4, i4) +declare i8 @llvm.uadd.sat.i8(i8, i8) +declare i16 @llvm.uadd.sat.i16(i16, i16) +declare i32 @llvm.uadd.sat.i32(i32, i32) +declare i64 @llvm.uadd.sat.i64(i64, i64) define i32 @func(i32 %x, i32 %y) nounwind { ; CHECK-LABEL: func: @@ -25,6 +27,30 @@ define i64 @func2(i64 %x, i64 %y) nounwind { ret i64 %tmp; } +define i16 @func16(i16 %x, i16 %y) nounwind { +; CHECK-LABEL: func16: +; CHECK: // %bb.0: +; CHECK-NEXT: lsl w8, w0, #16 +; CHECK-NEXT: adds w8, w8, w1, lsl #16 +; CHECK-NEXT: csinv w8, w8, wzr, lo +; CHECK-NEXT: lsr w0, w8, #16 +; CHECK-NEXT: ret + %tmp = call i16 @llvm.uadd.sat.i16(i16 %x, i16 %y); + ret i16 %tmp; +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; CHECK-LABEL: func8: +; CHECK: // %bb.0: +; CHECK-NEXT: lsl w8, w0, #24 +; CHECK-NEXT: adds w8, w8, w1, lsl #24 +; CHECK-NEXT: csinv w8, w8, wzr, lo +; CHECK-NEXT: lsr w0, w8, #24 +; CHECK-NEXT: ret + %tmp = call i8 @llvm.uadd.sat.i8(i8 %x, i8 %y); + ret i8 %tmp; +} + define i4 @func3(i4 %x, i4 %y) nounwind { ; CHECK-LABEL: func3: ; CHECK: // %bb.0: diff --git a/llvm/test/CodeGen/AArch64/usub_sat.ll b/llvm/test/CodeGen/AArch64/usub_sat.ll index c03137dc03f8e..0238c263d6c75 100644 --- a/llvm/test/CodeGen/AArch64/usub_sat.ll +++ b/llvm/test/CodeGen/AArch64/usub_sat.ll @@ -1,9 +1,11 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s -declare i4 @llvm.usub.sat.i4 (i4, i4) -declare i32 @llvm.usub.sat.i32 (i32, i32) -declare i64 @llvm.usub.sat.i64 (i64, i64) +declare i4 @llvm.usub.sat.i4(i4, i4) +declare i8 @llvm.usub.sat.i8(i8, i8) +declare i16 @llvm.usub.sat.i16(i16, i16) +declare i32 @llvm.usub.sat.i32(i32, i32) +declare i64 @llvm.usub.sat.i64(i64, i64) define i32 @func(i32 %x, i32 %y) nounwind { ; CHECK-LABEL: func: @@ -25,6 +27,30 @@ define i64 @func2(i64 %x, i64 %y) nounwind { ret i64 %tmp; } +define i16 @func16(i16 %x, i16 %y) nounwind { +; CHECK-LABEL: func16: +; CHECK: // %bb.0: +; CHECK-NEXT: lsl w8, w0, #16 +; CHECK-NEXT: subs w8, w8, w1, lsl #16 +; CHECK-NEXT: csel w8, wzr, w8, lo +; CHECK-NEXT: lsr w0, w8, #16 +; CHECK-NEXT: ret + %tmp = call i16 @llvm.usub.sat.i16(i16 %x, i16 %y); + ret i16 %tmp; +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; CHECK-LABEL: func8: +; CHECK: // %bb.0: +; CHECK-NEXT: lsl w8, w0, #24 +; CHECK-NEXT: subs w8, w8, w1, lsl #24 +; CHECK-NEXT: csel w8, wzr, w8, lo +; CHECK-NEXT: lsr w0, w8, #24 +; CHECK-NEXT: ret + %tmp = call i8 @llvm.usub.sat.i8(i8 %x, i8 %y); + ret i8 %tmp; +} + define i4 @func3(i4 %x, i4 %y) nounwind { ; CHECK-LABEL: func3: ; CHECK: // %bb.0: diff --git a/llvm/test/CodeGen/ARM/sadd_sat.ll b/llvm/test/CodeGen/ARM/sadd_sat.ll new file mode 100644 index 0000000000000..387850c831ff8 --- /dev/null +++ b/llvm/test/CodeGen/ARM/sadd_sat.ll @@ -0,0 +1,415 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=thumbv6m-none-eabi | FileCheck %s --check-prefix=CHECK-T1 +; RUN: llc < %s -mtriple=thumbv7m-none-eabi | FileCheck %s --check-prefix=CHECK-T2 --check-prefix=CHECK-T2NODSP +; RUN: llc < %s -mtriple=thumbv7em-none-eabi | FileCheck %s --check-prefix=CHECK-T2 --check-prefix=CHECK-T2DSP +; RUN: llc < %s -mtriple=armv8a-none-eabi | FileCheck %s --check-prefix=CHECK-ARM + +declare i4 @llvm.sadd.sat.i4(i4, i4) +declare i8 @llvm.sadd.sat.i8(i8, i8) +declare i16 @llvm.sadd.sat.i16(i16, i16) +declare i32 @llvm.sadd.sat.i32(i32, i32) +declare i64 @llvm.sadd.sat.i64(i64, i64) + +define i32 @func(i32 %x, i32 %y) nounwind { +; CHECK-T1-LABEL: func: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: mov r2, r0 +; CHECK-T1-NEXT: movs r3, #1 +; CHECK-T1-NEXT: adds r0, r0, r1 +; CHECK-T1-NEXT: mov r1, r3 +; CHECK-T1-NEXT: bmi .LBB0_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r1, #0 +; CHECK-T1-NEXT: .LBB0_2: +; CHECK-T1-NEXT: cmp r1, #0 +; CHECK-T1-NEXT: bne .LBB0_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: lsls r1, r3, #31 +; CHECK-T1-NEXT: cmp r0, r2 +; CHECK-T1-NEXT: bvs .LBB0_5 +; CHECK-T1-NEXT: b .LBB0_6 +; CHECK-T1-NEXT: .LBB0_4: +; CHECK-T1-NEXT: ldr r1, .LCPI0_0 +; CHECK-T1-NEXT: cmp r0, r2 +; CHECK-T1-NEXT: bvc .LBB0_6 +; CHECK-T1-NEXT: .LBB0_5: +; CHECK-T1-NEXT: mov r0, r1 +; CHECK-T1-NEXT: .LBB0_6: +; CHECK-T1-NEXT: bx lr +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: .LCPI0_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: adds r2, r0, r1 +; CHECK-T2-NEXT: mov.w r3, #0 +; CHECK-T2-NEXT: mov.w r1, #-2147483648 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r3, #1 +; CHECK-T2-NEXT: cmp r3, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r1, #-2147483648 +; CHECK-T2-NEXT: cmp r2, r0 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r1, r2 +; CHECK-T2-NEXT: mov r0, r1 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: adds r2, r0, r1 +; CHECK-ARM-NEXT: mov r3, #0 +; CHECK-ARM-NEXT: movwmi r3, #1 +; CHECK-ARM-NEXT: mov r1, #-2147483648 +; CHECK-ARM-NEXT: cmp r3, #0 +; CHECK-ARM-NEXT: mvnne r1, #-2147483648 +; CHECK-ARM-NEXT: cmp r2, r0 +; CHECK-ARM-NEXT: movvc r1, r2 +; CHECK-ARM-NEXT: mov r0, r1 +; CHECK-ARM-NEXT: bx lr + %tmp = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %y) + ret i32 %tmp +} + +define i64 @func2(i64 %x, i64 %y) nounwind { +; CHECK-T1-LABEL: func2: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: .save {r4, r5, r6, r7, lr} +; CHECK-T1-NEXT: push {r4, r5, r6, r7, lr} +; CHECK-T1-NEXT: .pad #4 +; CHECK-T1-NEXT: sub sp, #4 +; CHECK-T1-NEXT: str r2, [sp] @ 4-byte Spill +; CHECK-T1-NEXT: mov r2, r0 +; CHECK-T1-NEXT: movs r4, #1 +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: mov r5, r4 +; CHECK-T1-NEXT: bge .LBB1_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: mov r5, r0 +; CHECK-T1-NEXT: .LBB1_2: +; CHECK-T1-NEXT: cmp r1, #0 +; CHECK-T1-NEXT: mov r7, r4 +; CHECK-T1-NEXT: bge .LBB1_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: mov r7, r0 +; CHECK-T1-NEXT: .LBB1_4: +; CHECK-T1-NEXT: subs r6, r7, r5 +; CHECK-T1-NEXT: rsbs r5, r6, #0 +; CHECK-T1-NEXT: adcs r5, r6 +; CHECK-T1-NEXT: ldr r6, [sp] @ 4-byte Reload +; CHECK-T1-NEXT: adds r6, r2, r6 +; CHECK-T1-NEXT: adcs r1, r3 +; CHECK-T1-NEXT: cmp r1, #0 +; CHECK-T1-NEXT: mov r2, r4 +; CHECK-T1-NEXT: bge .LBB1_6 +; CHECK-T1-NEXT: @ %bb.5: +; CHECK-T1-NEXT: mov r2, r0 +; CHECK-T1-NEXT: .LBB1_6: +; CHECK-T1-NEXT: subs r0, r7, r2 +; CHECK-T1-NEXT: subs r2, r0, #1 +; CHECK-T1-NEXT: sbcs r0, r2 +; CHECK-T1-NEXT: ands r5, r0 +; CHECK-T1-NEXT: beq .LBB1_8 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: asrs r6, r1, #31 +; CHECK-T1-NEXT: .LBB1_8: +; CHECK-T1-NEXT: cmp r1, #0 +; CHECK-T1-NEXT: bmi .LBB1_10 +; CHECK-T1-NEXT: @ %bb.9: +; CHECK-T1-NEXT: lsls r2, r4, #31 +; CHECK-T1-NEXT: cmp r5, #0 +; CHECK-T1-NEXT: beq .LBB1_11 +; CHECK-T1-NEXT: b .LBB1_12 +; CHECK-T1-NEXT: .LBB1_10: +; CHECK-T1-NEXT: ldr r2, .LCPI1_0 +; CHECK-T1-NEXT: cmp r5, #0 +; CHECK-T1-NEXT: bne .LBB1_12 +; CHECK-T1-NEXT: .LBB1_11: +; CHECK-T1-NEXT: mov r2, r1 +; CHECK-T1-NEXT: .LBB1_12: +; CHECK-T1-NEXT: mov r0, r6 +; CHECK-T1-NEXT: mov r1, r2 +; CHECK-T1-NEXT: add sp, #4 +; CHECK-T1-NEXT: pop {r4, r5, r6, r7, pc} +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.13: +; CHECK-T1-NEXT: .LCPI1_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func2: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: .save {r7, lr} +; CHECK-T2-NEXT: push {r7, lr} +; CHECK-T2-NEXT: cmp.w r1, #-1 +; CHECK-T2-NEXT: mov.w lr, #0 +; CHECK-T2-NEXT: it gt +; CHECK-T2-NEXT: movgt.w lr, #1 +; CHECK-T2-NEXT: adds r0, r0, r2 +; CHECK-T2-NEXT: adc.w r2, r1, r3 +; CHECK-T2-NEXT: movs r1, #0 +; CHECK-T2-NEXT: cmp.w r2, #-1 +; CHECK-T2-NEXT: it gt +; CHECK-T2-NEXT: movgt r1, #1 +; CHECK-T2-NEXT: subs.w r1, lr, r1 +; CHECK-T2-NEXT: mov.w r12, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: movne r1, #1 +; CHECK-T2-NEXT: cmp.w r3, #-1 +; CHECK-T2-NEXT: it gt +; CHECK-T2-NEXT: movgt.w r12, #1 +; CHECK-T2-NEXT: sub.w r3, lr, r12 +; CHECK-T2-NEXT: clz r3, r3 +; CHECK-T2-NEXT: lsrs r3, r3, #5 +; CHECK-T2-NEXT: ands r3, r1 +; CHECK-T2-NEXT: mov.w r1, #-2147483648 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: asrne r0, r2, #31 +; CHECK-T2-NEXT: cmp r2, #0 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: mvnmi r1, #-2147483648 +; CHECK-T2-NEXT: cmp r3, #0 +; CHECK-T2-NEXT: it eq +; CHECK-T2-NEXT: moveq r1, r2 +; CHECK-T2-NEXT: pop {r7, pc} +; +; CHECK-ARM-LABEL: func2: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: .save {r11, lr} +; CHECK-ARM-NEXT: push {r11, lr} +; CHECK-ARM-NEXT: adds r0, r0, r2 +; CHECK-ARM-NEXT: mov r2, #0 +; CHECK-ARM-NEXT: adc r12, r1, r3 +; CHECK-ARM-NEXT: cmn r1, #1 +; CHECK-ARM-NEXT: mov r1, #0 +; CHECK-ARM-NEXT: mov lr, #0 +; CHECK-ARM-NEXT: movwgt r1, #1 +; CHECK-ARM-NEXT: cmn r12, #1 +; CHECK-ARM-NEXT: movwgt r2, #1 +; CHECK-ARM-NEXT: subs r2, r1, r2 +; CHECK-ARM-NEXT: movwne r2, #1 +; CHECK-ARM-NEXT: cmn r3, #1 +; CHECK-ARM-NEXT: movwgt lr, #1 +; CHECK-ARM-NEXT: sub r1, r1, lr +; CHECK-ARM-NEXT: clz r1, r1 +; CHECK-ARM-NEXT: lsr r1, r1, #5 +; CHECK-ARM-NEXT: ands r2, r1, r2 +; CHECK-ARM-NEXT: asrne r0, r12, #31 +; CHECK-ARM-NEXT: mov r1, #-2147483648 +; CHECK-ARM-NEXT: cmp r12, #0 +; CHECK-ARM-NEXT: mvnmi r1, #-2147483648 +; CHECK-ARM-NEXT: cmp r2, #0 +; CHECK-ARM-NEXT: moveq r1, r12 +; CHECK-ARM-NEXT: pop {r11, pc} + %tmp = call i64 @llvm.sadd.sat.i64(i64 %x, i64 %y) + ret i64 %tmp +} + +define i16 @func16(i16 %x, i16 %y) nounwind { +; CHECK-T1-LABEL: func16: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: lsls r3, r1, #16 +; CHECK-T1-NEXT: lsls r1, r0, #16 +; CHECK-T1-NEXT: movs r2, #1 +; CHECK-T1-NEXT: adds r0, r1, r3 +; CHECK-T1-NEXT: mov r3, r2 +; CHECK-T1-NEXT: bmi .LBB2_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r3, #0 +; CHECK-T1-NEXT: .LBB2_2: +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: bne .LBB2_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: lsls r2, r2, #31 +; CHECK-T1-NEXT: cmp r0, r1 +; CHECK-T1-NEXT: bvs .LBB2_5 +; CHECK-T1-NEXT: b .LBB2_6 +; CHECK-T1-NEXT: .LBB2_4: +; CHECK-T1-NEXT: ldr r2, .LCPI2_0 +; CHECK-T1-NEXT: cmp r0, r1 +; CHECK-T1-NEXT: bvc .LBB2_6 +; CHECK-T1-NEXT: .LBB2_5: +; CHECK-T1-NEXT: mov r0, r2 +; CHECK-T1-NEXT: .LBB2_6: +; CHECK-T1-NEXT: asrs r0, r0, #16 +; CHECK-T1-NEXT: bx lr +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: .LCPI2_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func16: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r2, r0, #16 +; CHECK-T2-NEXT: add.w r1, r2, r1, lsl #16 +; CHECK-T2-NEXT: movs r2, #0 +; CHECK-T2-NEXT: cmp r1, #0 +; CHECK-T2-NEXT: mov.w r3, #-2147483648 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r2, #1 +; CHECK-T2-NEXT: cmp r2, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r3, #-2147483648 +; CHECK-T2-NEXT: cmp.w r1, r0, lsl #16 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r3, r1 +; CHECK-T2-NEXT: asrs r0, r3, #16 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func16: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r2, r0, #16 +; CHECK-ARM-NEXT: add r1, r2, r1, lsl #16 +; CHECK-ARM-NEXT: mov r2, #0 +; CHECK-ARM-NEXT: cmp r1, #0 +; CHECK-ARM-NEXT: movwmi r2, #1 +; CHECK-ARM-NEXT: mov r3, #-2147483648 +; CHECK-ARM-NEXT: cmp r2, #0 +; CHECK-ARM-NEXT: mvnne r3, #-2147483648 +; CHECK-ARM-NEXT: cmp r1, r0, lsl #16 +; CHECK-ARM-NEXT: movvc r3, r1 +; CHECK-ARM-NEXT: asr r0, r3, #16 +; CHECK-ARM-NEXT: bx lr + %tmp = call i16 @llvm.sadd.sat.i16(i16 %x, i16 %y) + ret i16 %tmp +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; CHECK-T1-LABEL: func8: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: lsls r3, r1, #24 +; CHECK-T1-NEXT: lsls r1, r0, #24 +; CHECK-T1-NEXT: movs r2, #1 +; CHECK-T1-NEXT: adds r0, r1, r3 +; CHECK-T1-NEXT: mov r3, r2 +; CHECK-T1-NEXT: bmi .LBB3_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r3, #0 +; CHECK-T1-NEXT: .LBB3_2: +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: bne .LBB3_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: lsls r2, r2, #31 +; CHECK-T1-NEXT: cmp r0, r1 +; CHECK-T1-NEXT: bvs .LBB3_5 +; CHECK-T1-NEXT: b .LBB3_6 +; CHECK-T1-NEXT: .LBB3_4: +; CHECK-T1-NEXT: ldr r2, .LCPI3_0 +; CHECK-T1-NEXT: cmp r0, r1 +; CHECK-T1-NEXT: bvc .LBB3_6 +; CHECK-T1-NEXT: .LBB3_5: +; CHECK-T1-NEXT: mov r0, r2 +; CHECK-T1-NEXT: .LBB3_6: +; CHECK-T1-NEXT: asrs r0, r0, #24 +; CHECK-T1-NEXT: bx lr +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: .LCPI3_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func8: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r2, r0, #24 +; CHECK-T2-NEXT: add.w r1, r2, r1, lsl #24 +; CHECK-T2-NEXT: movs r2, #0 +; CHECK-T2-NEXT: cmp r1, #0 +; CHECK-T2-NEXT: mov.w r3, #-2147483648 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r2, #1 +; CHECK-T2-NEXT: cmp r2, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r3, #-2147483648 +; CHECK-T2-NEXT: cmp.w r1, r0, lsl #24 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r3, r1 +; CHECK-T2-NEXT: asrs r0, r3, #24 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func8: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r2, r0, #24 +; CHECK-ARM-NEXT: add r1, r2, r1, lsl #24 +; CHECK-ARM-NEXT: mov r2, #0 +; CHECK-ARM-NEXT: cmp r1, #0 +; CHECK-ARM-NEXT: movwmi r2, #1 +; CHECK-ARM-NEXT: mov r3, #-2147483648 +; CHECK-ARM-NEXT: cmp r2, #0 +; CHECK-ARM-NEXT: mvnne r3, #-2147483648 +; CHECK-ARM-NEXT: cmp r1, r0, lsl #24 +; CHECK-ARM-NEXT: movvc r3, r1 +; CHECK-ARM-NEXT: asr r0, r3, #24 +; CHECK-ARM-NEXT: bx lr + %tmp = call i8 @llvm.sadd.sat.i8(i8 %x, i8 %y) + ret i8 %tmp +} + +define i4 @func3(i4 %x, i4 %y) nounwind { +; CHECK-T1-LABEL: func3: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: lsls r3, r1, #28 +; CHECK-T1-NEXT: lsls r1, r0, #28 +; CHECK-T1-NEXT: movs r2, #1 +; CHECK-T1-NEXT: adds r0, r1, r3 +; CHECK-T1-NEXT: mov r3, r2 +; CHECK-T1-NEXT: bmi .LBB4_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r3, #0 +; CHECK-T1-NEXT: .LBB4_2: +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: bne .LBB4_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: lsls r2, r2, #31 +; CHECK-T1-NEXT: cmp r0, r1 +; CHECK-T1-NEXT: bvs .LBB4_5 +; CHECK-T1-NEXT: b .LBB4_6 +; CHECK-T1-NEXT: .LBB4_4: +; CHECK-T1-NEXT: ldr r2, .LCPI4_0 +; CHECK-T1-NEXT: cmp r0, r1 +; CHECK-T1-NEXT: bvc .LBB4_6 +; CHECK-T1-NEXT: .LBB4_5: +; CHECK-T1-NEXT: mov r0, r2 +; CHECK-T1-NEXT: .LBB4_6: +; CHECK-T1-NEXT: asrs r0, r0, #28 +; CHECK-T1-NEXT: bx lr +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: .LCPI4_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func3: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r2, r0, #28 +; CHECK-T2-NEXT: add.w r1, r2, r1, lsl #28 +; CHECK-T2-NEXT: movs r2, #0 +; CHECK-T2-NEXT: cmp r1, #0 +; CHECK-T2-NEXT: mov.w r3, #-2147483648 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r2, #1 +; CHECK-T2-NEXT: cmp r2, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r3, #-2147483648 +; CHECK-T2-NEXT: cmp.w r1, r0, lsl #28 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r3, r1 +; CHECK-T2-NEXT: asrs r0, r3, #28 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func3: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r2, r0, #28 +; CHECK-ARM-NEXT: add r1, r2, r1, lsl #28 +; CHECK-ARM-NEXT: mov r2, #0 +; CHECK-ARM-NEXT: cmp r1, #0 +; CHECK-ARM-NEXT: movwmi r2, #1 +; CHECK-ARM-NEXT: mov r3, #-2147483648 +; CHECK-ARM-NEXT: cmp r2, #0 +; CHECK-ARM-NEXT: mvnne r3, #-2147483648 +; CHECK-ARM-NEXT: cmp r1, r0, lsl #28 +; CHECK-ARM-NEXT: movvc r3, r1 +; CHECK-ARM-NEXT: asr r0, r3, #28 +; CHECK-ARM-NEXT: bx lr + %tmp = call i4 @llvm.sadd.sat.i4(i4 %x, i4 %y) + ret i4 %tmp +} diff --git a/llvm/test/CodeGen/ARM/ssub_sat.ll b/llvm/test/CodeGen/ARM/ssub_sat.ll new file mode 100644 index 0000000000000..b31dc0f1686e5 --- /dev/null +++ b/llvm/test/CodeGen/ARM/ssub_sat.ll @@ -0,0 +1,608 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=thumbv6m-none-eabi | FileCheck %s --check-prefix=CHECK-T1 +; RUN: llc < %s -mtriple=thumbv7m-none-eabi | FileCheck %s --check-prefix=CHECK-T2 --check-prefix=CHECK-T2NODSP +; RUN: llc < %s -mtriple=thumbv7em-none-eabi | FileCheck %s --check-prefix=CHECK-T2 --check-prefix=CHECK-T2DSP +; RUN: llc < %s -mtriple=armv8a-none-eabi | FileCheck %s --check-prefix=CHECK-ARM + +declare i4 @llvm.ssub.sat.i4(i4, i4) +declare i8 @llvm.ssub.sat.i8(i8, i8) +declare i16 @llvm.ssub.sat.i16(i16, i16) +declare i32 @llvm.ssub.sat.i32(i32, i32) +declare i64 @llvm.ssub.sat.i64(i64, i64) +declare <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32>, <4 x i32>) + +define i32 @func(i32 %x, i32 %y) nounwind { +; CHECK-T1-LABEL: func: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: .save {r4, lr} +; CHECK-T1-NEXT: push {r4, lr} +; CHECK-T1-NEXT: mov r2, r0 +; CHECK-T1-NEXT: movs r3, #1 +; CHECK-T1-NEXT: subs r0, r0, r1 +; CHECK-T1-NEXT: mov r4, r3 +; CHECK-T1-NEXT: bmi .LBB0_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r4, #0 +; CHECK-T1-NEXT: .LBB0_2: +; CHECK-T1-NEXT: cmp r4, #0 +; CHECK-T1-NEXT: bne .LBB0_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: lsls r3, r3, #31 +; CHECK-T1-NEXT: cmp r2, r1 +; CHECK-T1-NEXT: bvs .LBB0_5 +; CHECK-T1-NEXT: b .LBB0_6 +; CHECK-T1-NEXT: .LBB0_4: +; CHECK-T1-NEXT: ldr r3, .LCPI0_0 +; CHECK-T1-NEXT: cmp r2, r1 +; CHECK-T1-NEXT: bvc .LBB0_6 +; CHECK-T1-NEXT: .LBB0_5: +; CHECK-T1-NEXT: mov r0, r3 +; CHECK-T1-NEXT: .LBB0_6: +; CHECK-T1-NEXT: pop {r4, pc} +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: .LCPI0_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: subs.w r12, r0, r1 +; CHECK-T2-NEXT: mov.w r3, #0 +; CHECK-T2-NEXT: mov.w r2, #-2147483648 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r3, #1 +; CHECK-T2-NEXT: cmp r3, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r2, #-2147483648 +; CHECK-T2-NEXT: cmp r0, r1 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r2, r12 +; CHECK-T2-NEXT: mov r0, r2 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: subs r12, r0, r1 +; CHECK-ARM-NEXT: mov r3, #0 +; CHECK-ARM-NEXT: movwmi r3, #1 +; CHECK-ARM-NEXT: mov r2, #-2147483648 +; CHECK-ARM-NEXT: cmp r3, #0 +; CHECK-ARM-NEXT: mvnne r2, #-2147483648 +; CHECK-ARM-NEXT: cmp r0, r1 +; CHECK-ARM-NEXT: movvc r2, r12 +; CHECK-ARM-NEXT: mov r0, r2 +; CHECK-ARM-NEXT: bx lr + %tmp = call i32 @llvm.ssub.sat.i32(i32 %x, i32 %y) + ret i32 %tmp +} + +define i64 @func2(i64 %x, i64 %y) nounwind { +; CHECK-T1-LABEL: func2: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: .save {r4, r5, r6, r7, lr} +; CHECK-T1-NEXT: push {r4, r5, r6, r7, lr} +; CHECK-T1-NEXT: .pad #4 +; CHECK-T1-NEXT: sub sp, #4 +; CHECK-T1-NEXT: str r2, [sp] @ 4-byte Spill +; CHECK-T1-NEXT: mov r2, r0 +; CHECK-T1-NEXT: movs r4, #1 +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: mov r5, r4 +; CHECK-T1-NEXT: bge .LBB1_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: mov r5, r0 +; CHECK-T1-NEXT: .LBB1_2: +; CHECK-T1-NEXT: cmp r1, #0 +; CHECK-T1-NEXT: mov r7, r4 +; CHECK-T1-NEXT: bge .LBB1_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: mov r7, r0 +; CHECK-T1-NEXT: .LBB1_4: +; CHECK-T1-NEXT: subs r5, r7, r5 +; CHECK-T1-NEXT: subs r6, r5, #1 +; CHECK-T1-NEXT: sbcs r5, r6 +; CHECK-T1-NEXT: ldr r6, [sp] @ 4-byte Reload +; CHECK-T1-NEXT: subs r6, r2, r6 +; CHECK-T1-NEXT: sbcs r1, r3 +; CHECK-T1-NEXT: cmp r1, #0 +; CHECK-T1-NEXT: mov r2, r4 +; CHECK-T1-NEXT: bge .LBB1_6 +; CHECK-T1-NEXT: @ %bb.5: +; CHECK-T1-NEXT: mov r2, r0 +; CHECK-T1-NEXT: .LBB1_6: +; CHECK-T1-NEXT: subs r0, r7, r2 +; CHECK-T1-NEXT: subs r2, r0, #1 +; CHECK-T1-NEXT: sbcs r0, r2 +; CHECK-T1-NEXT: ands r5, r0 +; CHECK-T1-NEXT: beq .LBB1_8 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: asrs r6, r1, #31 +; CHECK-T1-NEXT: .LBB1_8: +; CHECK-T1-NEXT: cmp r1, #0 +; CHECK-T1-NEXT: bmi .LBB1_10 +; CHECK-T1-NEXT: @ %bb.9: +; CHECK-T1-NEXT: lsls r2, r4, #31 +; CHECK-T1-NEXT: cmp r5, #0 +; CHECK-T1-NEXT: beq .LBB1_11 +; CHECK-T1-NEXT: b .LBB1_12 +; CHECK-T1-NEXT: .LBB1_10: +; CHECK-T1-NEXT: ldr r2, .LCPI1_0 +; CHECK-T1-NEXT: cmp r5, #0 +; CHECK-T1-NEXT: bne .LBB1_12 +; CHECK-T1-NEXT: .LBB1_11: +; CHECK-T1-NEXT: mov r2, r1 +; CHECK-T1-NEXT: .LBB1_12: +; CHECK-T1-NEXT: mov r0, r6 +; CHECK-T1-NEXT: mov r1, r2 +; CHECK-T1-NEXT: add sp, #4 +; CHECK-T1-NEXT: pop {r4, r5, r6, r7, pc} +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.13: +; CHECK-T1-NEXT: .LCPI1_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func2: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: .save {r4, lr} +; CHECK-T2-NEXT: push {r4, lr} +; CHECK-T2-NEXT: cmp.w r3, #-1 +; CHECK-T2-NEXT: mov.w lr, #0 +; CHECK-T2-NEXT: it gt +; CHECK-T2-NEXT: movgt.w lr, #1 +; CHECK-T2-NEXT: cmp.w r1, #-1 +; CHECK-T2-NEXT: mov.w r4, #0 +; CHECK-T2-NEXT: mov.w r12, #0 +; CHECK-T2-NEXT: it gt +; CHECK-T2-NEXT: movgt r4, #1 +; CHECK-T2-NEXT: subs.w lr, r4, lr +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: movne.w lr, #1 +; CHECK-T2-NEXT: subs r0, r0, r2 +; CHECK-T2-NEXT: sbc.w r2, r1, r3 +; CHECK-T2-NEXT: cmp.w r2, #-1 +; CHECK-T2-NEXT: it gt +; CHECK-T2-NEXT: movgt.w r12, #1 +; CHECK-T2-NEXT: subs.w r1, r4, r12 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: movne r1, #1 +; CHECK-T2-NEXT: ands.w r3, lr, r1 +; CHECK-T2-NEXT: mov.w r1, #-2147483648 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: asrne r0, r2, #31 +; CHECK-T2-NEXT: cmp r2, #0 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: mvnmi r1, #-2147483648 +; CHECK-T2-NEXT: cmp r3, #0 +; CHECK-T2-NEXT: it eq +; CHECK-T2-NEXT: moveq r1, r2 +; CHECK-T2-NEXT: pop {r4, pc} +; +; CHECK-ARM-LABEL: func2: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: .save {r4, lr} +; CHECK-ARM-NEXT: push {r4, lr} +; CHECK-ARM-NEXT: cmn r3, #1 +; CHECK-ARM-NEXT: mov lr, #0 +; CHECK-ARM-NEXT: movwgt lr, #1 +; CHECK-ARM-NEXT: cmn r1, #1 +; CHECK-ARM-NEXT: mov r4, #0 +; CHECK-ARM-NEXT: mov r12, #0 +; CHECK-ARM-NEXT: movwgt r4, #1 +; CHECK-ARM-NEXT: subs lr, r4, lr +; CHECK-ARM-NEXT: movwne lr, #1 +; CHECK-ARM-NEXT: subs r0, r0, r2 +; CHECK-ARM-NEXT: sbc r2, r1, r3 +; CHECK-ARM-NEXT: cmn r2, #1 +; CHECK-ARM-NEXT: movwgt r12, #1 +; CHECK-ARM-NEXT: subs r1, r4, r12 +; CHECK-ARM-NEXT: movwne r1, #1 +; CHECK-ARM-NEXT: ands r3, lr, r1 +; CHECK-ARM-NEXT: asrne r0, r2, #31 +; CHECK-ARM-NEXT: mov r1, #-2147483648 +; CHECK-ARM-NEXT: cmp r2, #0 +; CHECK-ARM-NEXT: mvnmi r1, #-2147483648 +; CHECK-ARM-NEXT: cmp r3, #0 +; CHECK-ARM-NEXT: moveq r1, r2 +; CHECK-ARM-NEXT: pop {r4, pc} + %tmp = call i64 @llvm.ssub.sat.i64(i64 %x, i64 %y) + ret i64 %tmp +} + +define i16 @func16(i16 %x, i16 %y) nounwind { +; CHECK-T1-LABEL: func16: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: .save {r4, lr} +; CHECK-T1-NEXT: push {r4, lr} +; CHECK-T1-NEXT: lsls r1, r1, #16 +; CHECK-T1-NEXT: lsls r2, r0, #16 +; CHECK-T1-NEXT: movs r3, #1 +; CHECK-T1-NEXT: subs r0, r2, r1 +; CHECK-T1-NEXT: mov r4, r3 +; CHECK-T1-NEXT: bmi .LBB2_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r4, #0 +; CHECK-T1-NEXT: .LBB2_2: +; CHECK-T1-NEXT: cmp r4, #0 +; CHECK-T1-NEXT: bne .LBB2_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: lsls r3, r3, #31 +; CHECK-T1-NEXT: cmp r2, r1 +; CHECK-T1-NEXT: bvs .LBB2_5 +; CHECK-T1-NEXT: b .LBB2_6 +; CHECK-T1-NEXT: .LBB2_4: +; CHECK-T1-NEXT: ldr r3, .LCPI2_0 +; CHECK-T1-NEXT: cmp r2, r1 +; CHECK-T1-NEXT: bvc .LBB2_6 +; CHECK-T1-NEXT: .LBB2_5: +; CHECK-T1-NEXT: mov r0, r3 +; CHECK-T1-NEXT: .LBB2_6: +; CHECK-T1-NEXT: asrs r0, r0, #16 +; CHECK-T1-NEXT: pop {r4, pc} +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: .LCPI2_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func16: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r0, r0, #16 +; CHECK-T2-NEXT: sub.w r12, r0, r1, lsl #16 +; CHECK-T2-NEXT: movs r3, #0 +; CHECK-T2-NEXT: cmp.w r12, #0 +; CHECK-T2-NEXT: mov.w r2, #-2147483648 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r3, #1 +; CHECK-T2-NEXT: cmp r3, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r2, #-2147483648 +; CHECK-T2-NEXT: cmp.w r0, r1, lsl #16 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r2, r12 +; CHECK-T2-NEXT: asrs r0, r2, #16 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func16: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r0, r0, #16 +; CHECK-ARM-NEXT: sub r12, r0, r1, lsl #16 +; CHECK-ARM-NEXT: mov r3, #0 +; CHECK-ARM-NEXT: cmp r12, #0 +; CHECK-ARM-NEXT: movwmi r3, #1 +; CHECK-ARM-NEXT: mov r2, #-2147483648 +; CHECK-ARM-NEXT: cmp r3, #0 +; CHECK-ARM-NEXT: mvnne r2, #-2147483648 +; CHECK-ARM-NEXT: cmp r0, r1, lsl #16 +; CHECK-ARM-NEXT: movvc r2, r12 +; CHECK-ARM-NEXT: asr r0, r2, #16 +; CHECK-ARM-NEXT: bx lr + %tmp = call i16 @llvm.ssub.sat.i16(i16 %x, i16 %y) + ret i16 %tmp +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; CHECK-T1-LABEL: func8: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: .save {r4, lr} +; CHECK-T1-NEXT: push {r4, lr} +; CHECK-T1-NEXT: lsls r1, r1, #24 +; CHECK-T1-NEXT: lsls r2, r0, #24 +; CHECK-T1-NEXT: movs r3, #1 +; CHECK-T1-NEXT: subs r0, r2, r1 +; CHECK-T1-NEXT: mov r4, r3 +; CHECK-T1-NEXT: bmi .LBB3_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r4, #0 +; CHECK-T1-NEXT: .LBB3_2: +; CHECK-T1-NEXT: cmp r4, #0 +; CHECK-T1-NEXT: bne .LBB3_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: lsls r3, r3, #31 +; CHECK-T1-NEXT: cmp r2, r1 +; CHECK-T1-NEXT: bvs .LBB3_5 +; CHECK-T1-NEXT: b .LBB3_6 +; CHECK-T1-NEXT: .LBB3_4: +; CHECK-T1-NEXT: ldr r3, .LCPI3_0 +; CHECK-T1-NEXT: cmp r2, r1 +; CHECK-T1-NEXT: bvc .LBB3_6 +; CHECK-T1-NEXT: .LBB3_5: +; CHECK-T1-NEXT: mov r0, r3 +; CHECK-T1-NEXT: .LBB3_6: +; CHECK-T1-NEXT: asrs r0, r0, #24 +; CHECK-T1-NEXT: pop {r4, pc} +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: .LCPI3_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func8: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r0, r0, #24 +; CHECK-T2-NEXT: sub.w r12, r0, r1, lsl #24 +; CHECK-T2-NEXT: movs r3, #0 +; CHECK-T2-NEXT: cmp.w r12, #0 +; CHECK-T2-NEXT: mov.w r2, #-2147483648 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r3, #1 +; CHECK-T2-NEXT: cmp r3, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r2, #-2147483648 +; CHECK-T2-NEXT: cmp.w r0, r1, lsl #24 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r2, r12 +; CHECK-T2-NEXT: asrs r0, r2, #24 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func8: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r0, r0, #24 +; CHECK-ARM-NEXT: sub r12, r0, r1, lsl #24 +; CHECK-ARM-NEXT: mov r3, #0 +; CHECK-ARM-NEXT: cmp r12, #0 +; CHECK-ARM-NEXT: movwmi r3, #1 +; CHECK-ARM-NEXT: mov r2, #-2147483648 +; CHECK-ARM-NEXT: cmp r3, #0 +; CHECK-ARM-NEXT: mvnne r2, #-2147483648 +; CHECK-ARM-NEXT: cmp r0, r1, lsl #24 +; CHECK-ARM-NEXT: movvc r2, r12 +; CHECK-ARM-NEXT: asr r0, r2, #24 +; CHECK-ARM-NEXT: bx lr + %tmp = call i8 @llvm.ssub.sat.i8(i8 %x, i8 %y) + ret i8 %tmp +} + +define i4 @func3(i4 %x, i4 %y) nounwind { +; CHECK-T1-LABEL: func3: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: .save {r4, lr} +; CHECK-T1-NEXT: push {r4, lr} +; CHECK-T1-NEXT: lsls r1, r1, #28 +; CHECK-T1-NEXT: lsls r2, r0, #28 +; CHECK-T1-NEXT: movs r3, #1 +; CHECK-T1-NEXT: subs r0, r2, r1 +; CHECK-T1-NEXT: mov r4, r3 +; CHECK-T1-NEXT: bmi .LBB4_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r4, #0 +; CHECK-T1-NEXT: .LBB4_2: +; CHECK-T1-NEXT: cmp r4, #0 +; CHECK-T1-NEXT: bne .LBB4_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: lsls r3, r3, #31 +; CHECK-T1-NEXT: cmp r2, r1 +; CHECK-T1-NEXT: bvs .LBB4_5 +; CHECK-T1-NEXT: b .LBB4_6 +; CHECK-T1-NEXT: .LBB4_4: +; CHECK-T1-NEXT: ldr r3, .LCPI4_0 +; CHECK-T1-NEXT: cmp r2, r1 +; CHECK-T1-NEXT: bvc .LBB4_6 +; CHECK-T1-NEXT: .LBB4_5: +; CHECK-T1-NEXT: mov r0, r3 +; CHECK-T1-NEXT: .LBB4_6: +; CHECK-T1-NEXT: asrs r0, r0, #28 +; CHECK-T1-NEXT: pop {r4, pc} +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: .LCPI4_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: func3: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r0, r0, #28 +; CHECK-T2-NEXT: sub.w r12, r0, r1, lsl #28 +; CHECK-T2-NEXT: movs r3, #0 +; CHECK-T2-NEXT: cmp.w r12, #0 +; CHECK-T2-NEXT: mov.w r2, #-2147483648 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r3, #1 +; CHECK-T2-NEXT: cmp r3, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r2, #-2147483648 +; CHECK-T2-NEXT: cmp.w r0, r1, lsl #28 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r2, r12 +; CHECK-T2-NEXT: asrs r0, r2, #28 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func3: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r0, r0, #28 +; CHECK-ARM-NEXT: sub r12, r0, r1, lsl #28 +; CHECK-ARM-NEXT: mov r3, #0 +; CHECK-ARM-NEXT: cmp r12, #0 +; CHECK-ARM-NEXT: movwmi r3, #1 +; CHECK-ARM-NEXT: mov r2, #-2147483648 +; CHECK-ARM-NEXT: cmp r3, #0 +; CHECK-ARM-NEXT: mvnne r2, #-2147483648 +; CHECK-ARM-NEXT: cmp r0, r1, lsl #28 +; CHECK-ARM-NEXT: movvc r2, r12 +; CHECK-ARM-NEXT: asr r0, r2, #28 +; CHECK-ARM-NEXT: bx lr + %tmp = call i4 @llvm.ssub.sat.i4(i4 %x, i4 %y) + ret i4 %tmp +} + +define <4 x i32> @vec(<4 x i32> %x, <4 x i32> %y) nounwind { +; CHECK-T1-LABEL: vec: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: .save {r4, r5, r6, r7, lr} +; CHECK-T1-NEXT: push {r4, r5, r6, r7, lr} +; CHECK-T1-NEXT: .pad #12 +; CHECK-T1-NEXT: sub sp, #12 +; CHECK-T1-NEXT: str r3, [sp] @ 4-byte Spill +; CHECK-T1-NEXT: mov r4, r1 +; CHECK-T1-NEXT: mov r1, r0 +; CHECK-T1-NEXT: ldr r5, [sp, #32] +; CHECK-T1-NEXT: movs r7, #1 +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: str r0, [sp, #8] @ 4-byte Spill +; CHECK-T1-NEXT: subs r0, r1, r5 +; CHECK-T1-NEXT: str r0, [sp, #4] @ 4-byte Spill +; CHECK-T1-NEXT: mov r6, r7 +; CHECK-T1-NEXT: bmi .LBB5_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: ldr r6, [sp, #8] @ 4-byte Reload +; CHECK-T1-NEXT: .LBB5_2: +; CHECK-T1-NEXT: lsls r3, r7, #31 +; CHECK-T1-NEXT: ldr r0, .LCPI5_0 +; CHECK-T1-NEXT: cmp r6, #0 +; CHECK-T1-NEXT: mov r6, r0 +; CHECK-T1-NEXT: bne .LBB5_4 +; CHECK-T1-NEXT: @ %bb.3: +; CHECK-T1-NEXT: mov r6, r3 +; CHECK-T1-NEXT: .LBB5_4: +; CHECK-T1-NEXT: cmp r1, r5 +; CHECK-T1-NEXT: bvc .LBB5_6 +; CHECK-T1-NEXT: @ %bb.5: +; CHECK-T1-NEXT: str r6, [sp, #4] @ 4-byte Spill +; CHECK-T1-NEXT: .LBB5_6: +; CHECK-T1-NEXT: ldr r5, [sp, #36] +; CHECK-T1-NEXT: subs r1, r4, r5 +; CHECK-T1-NEXT: mov r6, r7 +; CHECK-T1-NEXT: bmi .LBB5_8 +; CHECK-T1-NEXT: @ %bb.7: +; CHECK-T1-NEXT: ldr r6, [sp, #8] @ 4-byte Reload +; CHECK-T1-NEXT: .LBB5_8: +; CHECK-T1-NEXT: cmp r6, #0 +; CHECK-T1-NEXT: mov r6, r0 +; CHECK-T1-NEXT: bne .LBB5_10 +; CHECK-T1-NEXT: @ %bb.9: +; CHECK-T1-NEXT: mov r6, r3 +; CHECK-T1-NEXT: .LBB5_10: +; CHECK-T1-NEXT: cmp r4, r5 +; CHECK-T1-NEXT: bvc .LBB5_12 +; CHECK-T1-NEXT: @ %bb.11: +; CHECK-T1-NEXT: mov r1, r6 +; CHECK-T1-NEXT: .LBB5_12: +; CHECK-T1-NEXT: ldr r5, [sp, #40] +; CHECK-T1-NEXT: subs r4, r2, r5 +; CHECK-T1-NEXT: mov r6, r7 +; CHECK-T1-NEXT: bmi .LBB5_14 +; CHECK-T1-NEXT: @ %bb.13: +; CHECK-T1-NEXT: ldr r6, [sp, #8] @ 4-byte Reload +; CHECK-T1-NEXT: .LBB5_14: +; CHECK-T1-NEXT: cmp r6, #0 +; CHECK-T1-NEXT: mov r6, r0 +; CHECK-T1-NEXT: bne .LBB5_16 +; CHECK-T1-NEXT: @ %bb.15: +; CHECK-T1-NEXT: mov r6, r3 +; CHECK-T1-NEXT: .LBB5_16: +; CHECK-T1-NEXT: cmp r2, r5 +; CHECK-T1-NEXT: bvc .LBB5_18 +; CHECK-T1-NEXT: @ %bb.17: +; CHECK-T1-NEXT: mov r4, r6 +; CHECK-T1-NEXT: .LBB5_18: +; CHECK-T1-NEXT: ldr r2, [sp, #44] +; CHECK-T1-NEXT: ldr r6, [sp] @ 4-byte Reload +; CHECK-T1-NEXT: subs r5, r6, r2 +; CHECK-T1-NEXT: bpl .LBB5_23 +; CHECK-T1-NEXT: @ %bb.19: +; CHECK-T1-NEXT: cmp r7, #0 +; CHECK-T1-NEXT: beq .LBB5_24 +; CHECK-T1-NEXT: .LBB5_20: +; CHECK-T1-NEXT: cmp r6, r2 +; CHECK-T1-NEXT: bvc .LBB5_22 +; CHECK-T1-NEXT: .LBB5_21: +; CHECK-T1-NEXT: mov r5, r0 +; CHECK-T1-NEXT: .LBB5_22: +; CHECK-T1-NEXT: ldr r0, [sp, #4] @ 4-byte Reload +; CHECK-T1-NEXT: mov r2, r4 +; CHECK-T1-NEXT: mov r3, r5 +; CHECK-T1-NEXT: add sp, #12 +; CHECK-T1-NEXT: pop {r4, r5, r6, r7, pc} +; CHECK-T1-NEXT: .LBB5_23: +; CHECK-T1-NEXT: ldr r7, [sp, #8] @ 4-byte Reload +; CHECK-T1-NEXT: cmp r7, #0 +; CHECK-T1-NEXT: bne .LBB5_20 +; CHECK-T1-NEXT: .LBB5_24: +; CHECK-T1-NEXT: mov r0, r3 +; CHECK-T1-NEXT: cmp r6, r2 +; CHECK-T1-NEXT: bvs .LBB5_21 +; CHECK-T1-NEXT: b .LBB5_22 +; CHECK-T1-NEXT: .p2align 2 +; CHECK-T1-NEXT: @ %bb.25: +; CHECK-T1-NEXT: .LCPI5_0: +; CHECK-T1-NEXT: .long 2147483647 @ 0x7fffffff +; +; CHECK-T2-LABEL: vec: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: .save {r4, r5, r6, r7, lr} +; CHECK-T2-NEXT: push {r4, r5, r6, r7, lr} +; CHECK-T2-NEXT: .pad #4 +; CHECK-T2-NEXT: sub sp, #4 +; CHECK-T2-NEXT: ldr r4, [sp, #24] +; CHECK-T2-NEXT: mov lr, r0 +; CHECK-T2-NEXT: ldr r7, [sp, #28] +; CHECK-T2-NEXT: movs r5, #0 +; CHECK-T2-NEXT: subs r6, r0, r4 +; CHECK-T2-NEXT: mov.w r0, #0 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r0, #1 +; CHECK-T2-NEXT: cmp r0, #0 +; CHECK-T2-NEXT: mov.w r0, #-2147483648 +; CHECK-T2-NEXT: mov.w r12, #-2147483648 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r0, #-2147483648 +; CHECK-T2-NEXT: cmp lr, r4 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r0, r6 +; CHECK-T2-NEXT: subs r6, r1, r7 +; CHECK-T2-NEXT: mov.w r4, #0 +; CHECK-T2-NEXT: mov.w lr, #-2147483648 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r4, #1 +; CHECK-T2-NEXT: cmp r4, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne lr, #-2147483648 +; CHECK-T2-NEXT: cmp r1, r7 +; CHECK-T2-NEXT: ldr r1, [sp, #32] +; CHECK-T2-NEXT: mov.w r4, #0 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc lr, r6 +; CHECK-T2-NEXT: subs r6, r2, r1 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r4, #1 +; CHECK-T2-NEXT: cmp r4, #0 +; CHECK-T2-NEXT: mov.w r4, #-2147483648 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r4, #-2147483648 +; CHECK-T2-NEXT: cmp r2, r1 +; CHECK-T2-NEXT: ldr r1, [sp, #36] +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r4, r6 +; CHECK-T2-NEXT: subs r2, r3, r1 +; CHECK-T2-NEXT: it mi +; CHECK-T2-NEXT: movmi r5, #1 +; CHECK-T2-NEXT: cmp r5, #0 +; CHECK-T2-NEXT: it ne +; CHECK-T2-NEXT: mvnne r12, #-2147483648 +; CHECK-T2-NEXT: cmp r3, r1 +; CHECK-T2-NEXT: it vc +; CHECK-T2-NEXT: movvc r12, r2 +; CHECK-T2-NEXT: mov r1, lr +; CHECK-T2-NEXT: mov r2, r4 +; CHECK-T2-NEXT: mov r3, r12 +; CHECK-T2-NEXT: add sp, #4 +; CHECK-T2-NEXT: pop {r4, r5, r6, r7, pc} +; +; CHECK-ARM-LABEL: vec: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: vmov d17, r2, r3 +; CHECK-ARM-NEXT: mov r12, sp +; CHECK-ARM-NEXT: vld1.64 {d18, d19}, [r12] +; CHECK-ARM-NEXT: vmov d16, r0, r1 +; CHECK-ARM-NEXT: vmvn.i32 q11, #0x80000000 +; CHECK-ARM-NEXT: vsub.i32 q10, q8, q9 +; CHECK-ARM-NEXT: vcgt.s32 q9, q9, #0 +; CHECK-ARM-NEXT: vclt.s32 q12, q10, #0 +; CHECK-ARM-NEXT: vmvn q13, q12 +; CHECK-ARM-NEXT: vcgt.s32 q8, q8, q10 +; CHECK-ARM-NEXT: vbsl q11, q12, q13 +; CHECK-ARM-NEXT: veor q8, q9, q8 +; CHECK-ARM-NEXT: vbsl q8, q11, q10 +; CHECK-ARM-NEXT: vmov r0, r1, d16 +; CHECK-ARM-NEXT: vmov r2, r3, d17 +; CHECK-ARM-NEXT: bx lr + %tmp = call <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32> %x, <4 x i32> %y) + ret <4 x i32> %tmp +} diff --git a/llvm/test/CodeGen/ARM/uadd_sat.ll b/llvm/test/CodeGen/ARM/uadd_sat.ll new file mode 100644 index 0000000000000..2843f85af5135 --- /dev/null +++ b/llvm/test/CodeGen/ARM/uadd_sat.ll @@ -0,0 +1,199 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=thumbv6m-none-eabi | FileCheck %s --check-prefix=CHECK-T1 +; RUN: llc < %s -mtriple=thumbv7m-none-eabi | FileCheck %s --check-prefix=CHECK-T2 --check-prefix=CHECK-T2NODSP +; RUN: llc < %s -mtriple=thumbv7em-none-eabi | FileCheck %s --check-prefix=CHECK-T2 --check-prefix=CHECK-T2DSP +; RUN: llc < %s -mtriple=armv8a-none-eabi | FileCheck %s --check-prefix=CHECK-ARM + +declare i4 @llvm.uadd.sat.i4(i4, i4) +declare i8 @llvm.uadd.sat.i8(i8, i8) +declare i16 @llvm.uadd.sat.i16(i16, i16) +declare i32 @llvm.uadd.sat.i32(i32, i32) +declare i64 @llvm.uadd.sat.i64(i64, i64) + +define i32 @func(i32 %x, i32 %y) nounwind { +; CHECK-T1-LABEL: func: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: adds r0, r0, r1 +; CHECK-T1-NEXT: blo .LBB0_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: mvns r0, r0 +; CHECK-T1-NEXT: .LBB0_2: +; CHECK-T1-NEXT: bx lr +; +; CHECK-T2-LABEL: func: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: adds r0, r0, r1 +; CHECK-T2-NEXT: it hs +; CHECK-T2-NEXT: movhs.w r0, #-1 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: adds r0, r0, r1 +; CHECK-ARM-NEXT: mvnhs r0, #0 +; CHECK-ARM-NEXT: bx lr + %tmp = call i32 @llvm.uadd.sat.i32(i32 %x, i32 %y) + ret i32 %tmp +} + +define i64 @func2(i64 %x, i64 %y) nounwind { +; CHECK-T1-LABEL: func2: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: .save {r4, r5, r7, lr} +; CHECK-T1-NEXT: push {r4, r5, r7, lr} +; CHECK-T1-NEXT: movs r5, #0 +; CHECK-T1-NEXT: adds r4, r0, r2 +; CHECK-T1-NEXT: adcs r1, r3 +; CHECK-T1-NEXT: mov r3, r5 +; CHECK-T1-NEXT: adcs r3, r5 +; CHECK-T1-NEXT: mvns r2, r5 +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: mov r0, r2 +; CHECK-T1-NEXT: beq .LBB1_3 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: beq .LBB1_4 +; CHECK-T1-NEXT: .LBB1_2: +; CHECK-T1-NEXT: mov r1, r2 +; CHECK-T1-NEXT: pop {r4, r5, r7, pc} +; CHECK-T1-NEXT: .LBB1_3: +; CHECK-T1-NEXT: mov r0, r4 +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: bne .LBB1_2 +; CHECK-T1-NEXT: .LBB1_4: +; CHECK-T1-NEXT: mov r2, r1 +; CHECK-T1-NEXT: mov r1, r2 +; CHECK-T1-NEXT: pop {r4, r5, r7, pc} +; +; CHECK-T2-LABEL: func2: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: adds r0, r0, r2 +; CHECK-T2-NEXT: mov.w r12, #0 +; CHECK-T2-NEXT: adcs r1, r3 +; CHECK-T2-NEXT: adcs r2, r12, #0 +; CHECK-T2-NEXT: itt ne +; CHECK-T2-NEXT: movne.w r0, #-1 +; CHECK-T2-NEXT: movne.w r1, #-1 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func2: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: adds r0, r0, r2 +; CHECK-ARM-NEXT: mov r12, #0 +; CHECK-ARM-NEXT: adcs r1, r1, r3 +; CHECK-ARM-NEXT: adcs r2, r12, #0 +; CHECK-ARM-NEXT: mvnne r0, #0 +; CHECK-ARM-NEXT: mvnne r1, #0 +; CHECK-ARM-NEXT: bx lr + %tmp = call i64 @llvm.uadd.sat.i64(i64 %x, i64 %y) + ret i64 %tmp +} + +define i16 @func16(i16 %x, i16 %y) nounwind { +; CHECK-T1-LABEL: func16: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: lsls r1, r1, #16 +; CHECK-T1-NEXT: lsls r0, r0, #16 +; CHECK-T1-NEXT: adds r0, r0, r1 +; CHECK-T1-NEXT: blo .LBB2_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: mvns r0, r0 +; CHECK-T1-NEXT: .LBB2_2: +; CHECK-T1-NEXT: lsrs r0, r0, #16 +; CHECK-T1-NEXT: bx lr +; +; CHECK-T2-LABEL: func16: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r2, r0, #16 +; CHECK-T2-NEXT: add.w r1, r2, r1, lsl #16 +; CHECK-T2-NEXT: cmp.w r1, r0, lsl #16 +; CHECK-T2-NEXT: it lo +; CHECK-T2-NEXT: movlo.w r1, #-1 +; CHECK-T2-NEXT: lsrs r0, r1, #16 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func16: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r2, r0, #16 +; CHECK-ARM-NEXT: add r1, r2, r1, lsl #16 +; CHECK-ARM-NEXT: cmp r1, r0, lsl #16 +; CHECK-ARM-NEXT: mvnlo r1, #0 +; CHECK-ARM-NEXT: lsr r0, r1, #16 +; CHECK-ARM-NEXT: bx lr + %tmp = call i16 @llvm.uadd.sat.i16(i16 %x, i16 %y) + ret i16 %tmp +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; CHECK-T1-LABEL: func8: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: lsls r1, r1, #24 +; CHECK-T1-NEXT: lsls r0, r0, #24 +; CHECK-T1-NEXT: adds r0, r0, r1 +; CHECK-T1-NEXT: blo .LBB3_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: mvns r0, r0 +; CHECK-T1-NEXT: .LBB3_2: +; CHECK-T1-NEXT: lsrs r0, r0, #24 +; CHECK-T1-NEXT: bx lr +; +; CHECK-T2-LABEL: func8: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r2, r0, #24 +; CHECK-T2-NEXT: add.w r1, r2, r1, lsl #24 +; CHECK-T2-NEXT: cmp.w r1, r0, lsl #24 +; CHECK-T2-NEXT: it lo +; CHECK-T2-NEXT: movlo.w r1, #-1 +; CHECK-T2-NEXT: lsrs r0, r1, #24 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func8: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r2, r0, #24 +; CHECK-ARM-NEXT: add r1, r2, r1, lsl #24 +; CHECK-ARM-NEXT: cmp r1, r0, lsl #24 +; CHECK-ARM-NEXT: mvnlo r1, #0 +; CHECK-ARM-NEXT: lsr r0, r1, #24 +; CHECK-ARM-NEXT: bx lr + %tmp = call i8 @llvm.uadd.sat.i8(i8 %x, i8 %y) + ret i8 %tmp +} + +define i4 @func3(i4 %x, i4 %y) nounwind { +; CHECK-T1-LABEL: func3: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: lsls r1, r1, #28 +; CHECK-T1-NEXT: lsls r0, r0, #28 +; CHECK-T1-NEXT: adds r0, r0, r1 +; CHECK-T1-NEXT: blo .LBB4_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: mvns r0, r0 +; CHECK-T1-NEXT: .LBB4_2: +; CHECK-T1-NEXT: lsrs r0, r0, #28 +; CHECK-T1-NEXT: bx lr +; +; CHECK-T2-LABEL: func3: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r2, r0, #28 +; CHECK-T2-NEXT: add.w r1, r2, r1, lsl #28 +; CHECK-T2-NEXT: cmp.w r1, r0, lsl #28 +; CHECK-T2-NEXT: it lo +; CHECK-T2-NEXT: movlo.w r1, #-1 +; CHECK-T2-NEXT: lsrs r0, r1, #28 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func3: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r2, r0, #28 +; CHECK-ARM-NEXT: add r1, r2, r1, lsl #28 +; CHECK-ARM-NEXT: cmp r1, r0, lsl #28 +; CHECK-ARM-NEXT: mvnlo r1, #0 +; CHECK-ARM-NEXT: lsr r0, r1, #28 +; CHECK-ARM-NEXT: bx lr + %tmp = call i4 @llvm.uadd.sat.i4(i4 %x, i4 %y) + ret i4 %tmp +} diff --git a/llvm/test/CodeGen/ARM/usub_sat.ll b/llvm/test/CodeGen/ARM/usub_sat.ll new file mode 100644 index 0000000000000..5587cef25c316 --- /dev/null +++ b/llvm/test/CodeGen/ARM/usub_sat.ll @@ -0,0 +1,196 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=thumbv6m-none-eabi | FileCheck %s --check-prefix=CHECK-T1 +; RUN: llc < %s -mtriple=thumbv7m-none-eabi | FileCheck %s --check-prefix=CHECK-T2 --check-prefix=CHECK-T2NODSP +; RUN: llc < %s -mtriple=thumbv7em-none-eabi | FileCheck %s --check-prefix=CHECK-T2 --check-prefix=CHECK-T2DSP +; RUN: llc < %s -mtriple=armv8a-none-eabi | FileCheck %s --check-prefix=CHECK-ARM + +declare i4 @llvm.usub.sat.i4(i4, i4) +declare i8 @llvm.usub.sat.i8(i8, i8) +declare i16 @llvm.usub.sat.i16(i16, i16) +declare i32 @llvm.usub.sat.i32(i32, i32) +declare i64 @llvm.usub.sat.i64(i64, i64) + +define i32 @func(i32 %x, i32 %y) nounwind { +; CHECK-T1-LABEL: func: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: subs r0, r0, r1 +; CHECK-T1-NEXT: bhs .LBB0_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: .LBB0_2: +; CHECK-T1-NEXT: bx lr +; +; CHECK-T2-LABEL: func: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: subs r0, r0, r1 +; CHECK-T2-NEXT: it lo +; CHECK-T2-NEXT: movlo r0, #0 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: subs r0, r0, r1 +; CHECK-ARM-NEXT: movlo r0, #0 +; CHECK-ARM-NEXT: bx lr + %tmp = call i32 @llvm.usub.sat.i32(i32 %x, i32 %y) + ret i32 %tmp +} + +define i64 @func2(i64 %x, i64 %y) nounwind { +; CHECK-T1-LABEL: func2: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: .save {r4, lr} +; CHECK-T1-NEXT: push {r4, lr} +; CHECK-T1-NEXT: mov r4, r1 +; CHECK-T1-NEXT: movs r1, #0 +; CHECK-T1-NEXT: subs r2, r0, r2 +; CHECK-T1-NEXT: sbcs r4, r3 +; CHECK-T1-NEXT: mov r0, r1 +; CHECK-T1-NEXT: adcs r0, r1 +; CHECK-T1-NEXT: movs r3, #1 +; CHECK-T1-NEXT: subs r3, r3, r0 +; CHECK-T1-NEXT: mov r0, r1 +; CHECK-T1-NEXT: beq .LBB1_3 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: beq .LBB1_4 +; CHECK-T1-NEXT: .LBB1_2: +; CHECK-T1-NEXT: pop {r4, pc} +; CHECK-T1-NEXT: .LBB1_3: +; CHECK-T1-NEXT: mov r0, r2 +; CHECK-T1-NEXT: cmp r3, #0 +; CHECK-T1-NEXT: bne .LBB1_2 +; CHECK-T1-NEXT: .LBB1_4: +; CHECK-T1-NEXT: mov r1, r4 +; CHECK-T1-NEXT: pop {r4, pc} +; +; CHECK-T2-LABEL: func2: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: subs r0, r0, r2 +; CHECK-T2-NEXT: mov.w r12, #0 +; CHECK-T2-NEXT: sbcs r1, r3 +; CHECK-T2-NEXT: adc r2, r12, #0 +; CHECK-T2-NEXT: rsbs.w r2, r2, #1 +; CHECK-T2-NEXT: itt ne +; CHECK-T2-NEXT: movne r0, #0 +; CHECK-T2-NEXT: movne r1, #0 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func2: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: subs r0, r0, r2 +; CHECK-ARM-NEXT: mov r12, #0 +; CHECK-ARM-NEXT: sbcs r1, r1, r3 +; CHECK-ARM-NEXT: adc r2, r12, #0 +; CHECK-ARM-NEXT: rsbs r2, r2, #1 +; CHECK-ARM-NEXT: movwne r0, #0 +; CHECK-ARM-NEXT: movwne r1, #0 +; CHECK-ARM-NEXT: bx lr + %tmp = call i64 @llvm.usub.sat.i64(i64 %x, i64 %y) + ret i64 %tmp +} + +define i16 @func16(i16 %x, i16 %y) nounwind { +; CHECK-T1-LABEL: func16: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: lsls r1, r1, #16 +; CHECK-T1-NEXT: lsls r0, r0, #16 +; CHECK-T1-NEXT: subs r0, r0, r1 +; CHECK-T1-NEXT: bhs .LBB2_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: .LBB2_2: +; CHECK-T1-NEXT: lsrs r0, r0, #16 +; CHECK-T1-NEXT: bx lr +; +; CHECK-T2-LABEL: func16: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r0, r0, #16 +; CHECK-T2-NEXT: sub.w r2, r0, r1, lsl #16 +; CHECK-T2-NEXT: cmp.w r0, r1, lsl #16 +; CHECK-T2-NEXT: it lo +; CHECK-T2-NEXT: movlo r2, #0 +; CHECK-T2-NEXT: lsrs r0, r2, #16 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func16: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r0, r0, #16 +; CHECK-ARM-NEXT: sub r2, r0, r1, lsl #16 +; CHECK-ARM-NEXT: cmp r0, r1, lsl #16 +; CHECK-ARM-NEXT: movlo r2, #0 +; CHECK-ARM-NEXT: lsr r0, r2, #16 +; CHECK-ARM-NEXT: bx lr + %tmp = call i16 @llvm.usub.sat.i16(i16 %x, i16 %y) + ret i16 %tmp +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; CHECK-T1-LABEL: func8: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: lsls r1, r1, #24 +; CHECK-T1-NEXT: lsls r0, r0, #24 +; CHECK-T1-NEXT: subs r0, r0, r1 +; CHECK-T1-NEXT: bhs .LBB3_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: .LBB3_2: +; CHECK-T1-NEXT: lsrs r0, r0, #24 +; CHECK-T1-NEXT: bx lr +; +; CHECK-T2-LABEL: func8: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r0, r0, #24 +; CHECK-T2-NEXT: sub.w r2, r0, r1, lsl #24 +; CHECK-T2-NEXT: cmp.w r0, r1, lsl #24 +; CHECK-T2-NEXT: it lo +; CHECK-T2-NEXT: movlo r2, #0 +; CHECK-T2-NEXT: lsrs r0, r2, #24 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func8: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r0, r0, #24 +; CHECK-ARM-NEXT: sub r2, r0, r1, lsl #24 +; CHECK-ARM-NEXT: cmp r0, r1, lsl #24 +; CHECK-ARM-NEXT: movlo r2, #0 +; CHECK-ARM-NEXT: lsr r0, r2, #24 +; CHECK-ARM-NEXT: bx lr + %tmp = call i8 @llvm.usub.sat.i8(i8 %x, i8 %y) + ret i8 %tmp +} + +define i4 @func3(i4 %x, i4 %y) nounwind { +; CHECK-T1-LABEL: func3: +; CHECK-T1: @ %bb.0: +; CHECK-T1-NEXT: lsls r1, r1, #28 +; CHECK-T1-NEXT: lsls r0, r0, #28 +; CHECK-T1-NEXT: subs r0, r0, r1 +; CHECK-T1-NEXT: bhs .LBB4_2 +; CHECK-T1-NEXT: @ %bb.1: +; CHECK-T1-NEXT: movs r0, #0 +; CHECK-T1-NEXT: .LBB4_2: +; CHECK-T1-NEXT: lsrs r0, r0, #28 +; CHECK-T1-NEXT: bx lr +; +; CHECK-T2-LABEL: func3: +; CHECK-T2: @ %bb.0: +; CHECK-T2-NEXT: lsls r0, r0, #28 +; CHECK-T2-NEXT: sub.w r2, r0, r1, lsl #28 +; CHECK-T2-NEXT: cmp.w r0, r1, lsl #28 +; CHECK-T2-NEXT: it lo +; CHECK-T2-NEXT: movlo r2, #0 +; CHECK-T2-NEXT: lsrs r0, r2, #28 +; CHECK-T2-NEXT: bx lr +; +; CHECK-ARM-LABEL: func3: +; CHECK-ARM: @ %bb.0: +; CHECK-ARM-NEXT: lsl r0, r0, #28 +; CHECK-ARM-NEXT: sub r2, r0, r1, lsl #28 +; CHECK-ARM-NEXT: cmp r0, r1, lsl #28 +; CHECK-ARM-NEXT: movlo r2, #0 +; CHECK-ARM-NEXT: lsr r0, r2, #28 +; CHECK-ARM-NEXT: bx lr + %tmp = call i4 @llvm.usub.sat.i4(i4 %x, i4 %y) + ret i4 %tmp +} diff --git a/llvm/test/CodeGen/X86/sadd_sat.ll b/llvm/test/CodeGen/X86/sadd_sat.ll index 697ff90c59375..6d853d7b0d8bf 100644 --- a/llvm/test/CodeGen/X86/sadd_sat.ll +++ b/llvm/test/CodeGen/X86/sadd_sat.ll @@ -2,10 +2,12 @@ ; RUN: llc < %s -mtriple=i686 -mattr=cmov | FileCheck %s --check-prefixes=CHECK,X86 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefixes=CHECK,X64 -declare i4 @llvm.sadd.sat.i4 (i4, i4) -declare i32 @llvm.sadd.sat.i32 (i32, i32) -declare i64 @llvm.sadd.sat.i64 (i64, i64) -declare <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32>, <4 x i32>) +declare i4 @llvm.sadd.sat.i4(i4, i4) +declare i8 @llvm.sadd.sat.i8(i8, i8) +declare i16 @llvm.sadd.sat.i16(i16, i16) +declare i32 @llvm.sadd.sat.i32(i32, i32) +declare i64 @llvm.sadd.sat.i64(i64, i64) +declare <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32>, <4 x i32>) define i32 @func(i32 %x, i32 %y) nounwind { ; X86-LABEL: func: @@ -89,6 +91,70 @@ define i64 @func2(i64 %x, i64 %y) nounwind { ret i64 %tmp; } +define i16 @func16(i16 %x, i16 %y) nounwind { +; X86-LABEL: func16: +; X86: # %bb.0: +; X86-NEXT: pushl %esi +; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-NEXT: movzwl {{[0-9]+}}(%esp), %edx +; X86-NEXT: xorl %ecx, %ecx +; X86-NEXT: movl %eax, %esi +; X86-NEXT: addw %dx, %si +; X86-NEXT: setns %cl +; X86-NEXT: addl $32767, %ecx # imm = 0x7FFF +; X86-NEXT: addw %dx, %ax +; X86-NEXT: cmovol %ecx, %eax +; X86-NEXT: # kill: def $ax killed $ax killed $eax +; X86-NEXT: popl %esi +; X86-NEXT: retl +; +; X64-LABEL: func16: +; X64: # %bb.0: +; X64-NEXT: xorl %eax, %eax +; X64-NEXT: movl %edi, %ecx +; X64-NEXT: addw %si, %cx +; X64-NEXT: setns %al +; X64-NEXT: addl $32767, %eax # imm = 0x7FFF +; X64-NEXT: addw %si, %di +; X64-NEXT: cmovnol %edi, %eax +; X64-NEXT: # kill: def $ax killed $ax killed $eax +; X64-NEXT: retq + %tmp = call i16 @llvm.sadd.sat.i16(i16 %x, i16 %y) + ret i16 %tmp +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; X86-LABEL: func8: +; X86: # %bb.0: +; X86-NEXT: movb {{[0-9]+}}(%esp), %al +; X86-NEXT: movb {{[0-9]+}}(%esp), %dl +; X86-NEXT: xorl %ecx, %ecx +; X86-NEXT: movb %al, %ah +; X86-NEXT: addb %dl, %ah +; X86-NEXT: setns %cl +; X86-NEXT: addl $127, %ecx +; X86-NEXT: addb %dl, %al +; X86-NEXT: movzbl %al, %eax +; X86-NEXT: cmovol %ecx, %eax +; X86-NEXT: # kill: def $al killed $al killed $eax +; X86-NEXT: retl +; +; X64-LABEL: func8: +; X64: # %bb.0: +; X64-NEXT: xorl %ecx, %ecx +; X64-NEXT: movl %edi, %eax +; X64-NEXT: addb %sil, %al +; X64-NEXT: setns %cl +; X64-NEXT: addl $127, %ecx +; X64-NEXT: addb %sil, %dil +; X64-NEXT: movzbl %dil, %eax +; X64-NEXT: cmovol %ecx, %eax +; X64-NEXT: # kill: def $al killed $al killed $eax +; X64-NEXT: retq + %tmp = call i8 @llvm.sadd.sat.i8(i8 %x, i8 %y) + ret i8 %tmp +} + define i4 @func3(i4 %x, i4 %y) nounwind { ; X86-LABEL: func3: ; X86: # %bb.0: diff --git a/llvm/test/CodeGen/X86/ssub_sat.ll b/llvm/test/CodeGen/X86/ssub_sat.ll index dcfa086603b2e..62724e981f7d7 100644 --- a/llvm/test/CodeGen/X86/ssub_sat.ll +++ b/llvm/test/CodeGen/X86/ssub_sat.ll @@ -2,10 +2,12 @@ ; RUN: llc < %s -mtriple=i686 -mattr=cmov | FileCheck %s --check-prefixes=CHECK,X86 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefixes=CHECK,X64 -declare i4 @llvm.ssub.sat.i4 (i4, i4) -declare i32 @llvm.ssub.sat.i32 (i32, i32) -declare i64 @llvm.ssub.sat.i64 (i64, i64) -declare <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32>, <4 x i32>) +declare i4 @llvm.ssub.sat.i4(i4, i4) +declare i8 @llvm.ssub.sat.i8(i8, i8) +declare i16 @llvm.ssub.sat.i16(i16, i16) +declare i32 @llvm.ssub.sat.i32(i32, i32) +declare i64 @llvm.ssub.sat.i64(i64, i64) +declare <4 x i32> @llvm.ssub.sat.v4i32(<4 x i32>, <4 x i32>) define i32 @func(i32 %x, i32 %y) nounwind { ; X86-LABEL: func: @@ -89,6 +91,70 @@ define i64 @func2(i64 %x, i64 %y) nounwind { ret i64 %tmp } +define i16 @func16(i16 %x, i16 %y) nounwind { +; X86-LABEL: func16: +; X86: # %bb.0: +; X86-NEXT: pushl %esi +; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-NEXT: movzwl {{[0-9]+}}(%esp), %edx +; X86-NEXT: xorl %ecx, %ecx +; X86-NEXT: movl %eax, %esi +; X86-NEXT: subw %dx, %si +; X86-NEXT: setns %cl +; X86-NEXT: addl $32767, %ecx # imm = 0x7FFF +; X86-NEXT: subw %dx, %ax +; X86-NEXT: cmovol %ecx, %eax +; X86-NEXT: # kill: def $ax killed $ax killed $eax +; X86-NEXT: popl %esi +; X86-NEXT: retl +; +; X64-LABEL: func16: +; X64: # %bb.0: +; X64-NEXT: xorl %eax, %eax +; X64-NEXT: movl %edi, %ecx +; X64-NEXT: subw %si, %cx +; X64-NEXT: setns %al +; X64-NEXT: addl $32767, %eax # imm = 0x7FFF +; X64-NEXT: subw %si, %di +; X64-NEXT: cmovnol %edi, %eax +; X64-NEXT: # kill: def $ax killed $ax killed $eax +; X64-NEXT: retq + %tmp = call i16 @llvm.ssub.sat.i16(i16 %x, i16 %y) + ret i16 %tmp +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; X86-LABEL: func8: +; X86: # %bb.0: +; X86-NEXT: movb {{[0-9]+}}(%esp), %al +; X86-NEXT: movb {{[0-9]+}}(%esp), %dl +; X86-NEXT: xorl %ecx, %ecx +; X86-NEXT: movb %al, %ah +; X86-NEXT: subb %dl, %ah +; X86-NEXT: setns %cl +; X86-NEXT: addl $127, %ecx +; X86-NEXT: subb %dl, %al +; X86-NEXT: movzbl %al, %eax +; X86-NEXT: cmovol %ecx, %eax +; X86-NEXT: # kill: def $al killed $al killed $eax +; X86-NEXT: retl +; +; X64-LABEL: func8: +; X64: # %bb.0: +; X64-NEXT: xorl %ecx, %ecx +; X64-NEXT: movl %edi, %eax +; X64-NEXT: subb %sil, %al +; X64-NEXT: setns %cl +; X64-NEXT: addl $127, %ecx +; X64-NEXT: subb %sil, %dil +; X64-NEXT: movzbl %dil, %eax +; X64-NEXT: cmovol %ecx, %eax +; X64-NEXT: # kill: def $al killed $al killed $eax +; X64-NEXT: retq + %tmp = call i8 @llvm.ssub.sat.i8(i8 %x, i8 %y) + ret i8 %tmp +} + define i4 @func3(i4 %x, i4 %y) nounwind { ; X86-LABEL: func3: ; X86: # %bb.0: diff --git a/llvm/test/CodeGen/X86/uadd_sat.ll b/llvm/test/CodeGen/X86/uadd_sat.ll index 6290017222d44..203d039a3a0bf 100644 --- a/llvm/test/CodeGen/X86/uadd_sat.ll +++ b/llvm/test/CodeGen/X86/uadd_sat.ll @@ -2,10 +2,12 @@ ; RUN: llc < %s -mtriple=i686 -mattr=cmov | FileCheck %s --check-prefixes=CHECK,X86 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefixes=CHECK,X64 -declare i4 @llvm.uadd.sat.i4 (i4, i4) -declare i32 @llvm.uadd.sat.i32 (i32, i32) -declare i64 @llvm.uadd.sat.i64 (i64, i64) -declare <4 x i32> @llvm.uadd.sat.v4i32(<4 x i32>, <4 x i32>) +declare i4 @llvm.uadd.sat.i4(i4, i4) +declare i8 @llvm.uadd.sat.i8(i8, i8) +declare i16 @llvm.uadd.sat.i16(i16, i16) +declare i32 @llvm.uadd.sat.i32(i32, i32) +declare i64 @llvm.uadd.sat.i64(i64, i64) +declare <4 x i32> @llvm.uadd.sat.v4i32(<4 x i32>, <4 x i32>) define i32 @func(i32 %x, i32 %y) nounwind { ; X86-LABEL: func: @@ -48,6 +50,50 @@ define i64 @func2(i64 %x, i64 %y) nounwind { ret i64 %tmp } +define i16 @func16(i16 %x, i16 %y) nounwind { +; X86-LABEL: func16: +; X86: # %bb.0: +; X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx +; X86-NEXT: addw {{[0-9]+}}(%esp), %cx +; X86-NEXT: movl $65535, %eax # imm = 0xFFFF +; X86-NEXT: cmovael %ecx, %eax +; X86-NEXT: # kill: def $ax killed $ax killed $eax +; X86-NEXT: retl +; +; X64-LABEL: func16: +; X64: # %bb.0: +; X64-NEXT: addw %si, %di +; X64-NEXT: movl $65535, %eax # imm = 0xFFFF +; X64-NEXT: cmovael %edi, %eax +; X64-NEXT: # kill: def $ax killed $ax killed $eax +; X64-NEXT: retq + %tmp = call i16 @llvm.uadd.sat.i16(i16 %x, i16 %y) + ret i16 %tmp +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; X86-LABEL: func8: +; X86: # %bb.0: +; X86-NEXT: movb {{[0-9]+}}(%esp), %al +; X86-NEXT: addb {{[0-9]+}}(%esp), %al +; X86-NEXT: movzbl %al, %ecx +; X86-NEXT: movl $255, %eax +; X86-NEXT: cmovael %ecx, %eax +; X86-NEXT: # kill: def $al killed $al killed $eax +; X86-NEXT: retl +; +; X64-LABEL: func8: +; X64: # %bb.0: +; X64-NEXT: addb %sil, %dil +; X64-NEXT: movzbl %dil, %ecx +; X64-NEXT: movl $255, %eax +; X64-NEXT: cmovael %ecx, %eax +; X64-NEXT: # kill: def $al killed $al killed $eax +; X64-NEXT: retq + %tmp = call i8 @llvm.uadd.sat.i8(i8 %x, i8 %y) + ret i8 %tmp +} + define i4 @func3(i4 %x, i4 %y) nounwind { ; X86-LABEL: func3: ; X86: # %bb.0: diff --git a/llvm/test/CodeGen/X86/usub_sat.ll b/llvm/test/CodeGen/X86/usub_sat.ll index 3bdf83e425278..55cb6e8fd7f22 100644 --- a/llvm/test/CodeGen/X86/usub_sat.ll +++ b/llvm/test/CodeGen/X86/usub_sat.ll @@ -2,10 +2,12 @@ ; RUN: llc < %s -mtriple=i686 -mattr=cmov | FileCheck %s --check-prefixes=CHECK,X86 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefixes=CHECK,X64 -declare i4 @llvm.usub.sat.i4 (i4, i4) -declare i32 @llvm.usub.sat.i32 (i32, i32) -declare i64 @llvm.usub.sat.i64 (i64, i64) -declare <4 x i32> @llvm.usub.sat.v4i32(<4 x i32>, <4 x i32>) +declare i4 @llvm.usub.sat.i4(i4, i4) +declare i8 @llvm.usub.sat.i8(i8, i8) +declare i16 @llvm.usub.sat.i16(i16, i16) +declare i32 @llvm.usub.sat.i32(i32, i32) +declare i64 @llvm.usub.sat.i64(i64, i64) +declare <4 x i32> @llvm.usub.sat.v4i32(<4 x i32>, <4 x i32>) define i32 @func(i32 %x, i32 %y) nounwind { ; X86-LABEL: func: @@ -48,6 +50,50 @@ define i64 @func2(i64 %x, i64 %y) nounwind { ret i64 %tmp } +define i16 @func16(i16 %x, i16 %y) nounwind { +; X86-LABEL: func16: +; X86: # %bb.0: +; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-NEXT: xorl %ecx, %ecx +; X86-NEXT: subw {{[0-9]+}}(%esp), %ax +; X86-NEXT: cmovbl %ecx, %eax +; X86-NEXT: # kill: def $ax killed $ax killed $eax +; X86-NEXT: retl +; +; X64-LABEL: func16: +; X64: # %bb.0: +; X64-NEXT: xorl %eax, %eax +; X64-NEXT: subw %si, %di +; X64-NEXT: cmovael %edi, %eax +; X64-NEXT: # kill: def $ax killed $ax killed $eax +; X64-NEXT: retq + %tmp = call i16 @llvm.usub.sat.i16(i16 %x, i16 %y) + ret i16 %tmp +} + +define i8 @func8(i8 %x, i8 %y) nounwind { +; X86-LABEL: func8: +; X86: # %bb.0: +; X86-NEXT: movb {{[0-9]+}}(%esp), %al +; X86-NEXT: xorl %ecx, %ecx +; X86-NEXT: subb {{[0-9]+}}(%esp), %al +; X86-NEXT: movzbl %al, %eax +; X86-NEXT: cmovbl %ecx, %eax +; X86-NEXT: # kill: def $al killed $al killed $eax +; X86-NEXT: retl +; +; X64-LABEL: func8: +; X64: # %bb.0: +; X64-NEXT: xorl %ecx, %ecx +; X64-NEXT: subb %sil, %dil +; X64-NEXT: movzbl %dil, %eax +; X64-NEXT: cmovbl %ecx, %eax +; X64-NEXT: # kill: def $al killed $al killed $eax +; X64-NEXT: retq + %tmp = call i8 @llvm.usub.sat.i8(i8 %x, i8 %y) + ret i8 %tmp +} + define i4 @func3(i4 %x, i4 %y) nounwind { ; X86-LABEL: func3: ; X86: # %bb.0: From 04a9a0eb0dd459ee209d001eaaaf6c9a73b76869 Mon Sep 17 00:00:00 2001 From: Clement Courbet Date: Wed, 9 Oct 2019 14:25:08 +0000 Subject: [PATCH 03/44] [llvm-exegesis] Ensure that ExecutableFunction are aligned. Summary: Experiments show that this is the alignment we get (for ELF+Linux), but let's ensure that we have it. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68703 llvm-svn: 374170 --- llvm/tools/llvm-exegesis/lib/Assembler.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/llvm/tools/llvm-exegesis/lib/Assembler.cpp b/llvm/tools/llvm-exegesis/lib/Assembler.cpp index c19cac834ba05..4067098534c4e 100644 --- a/llvm/tools/llvm-exegesis/lib/Assembler.cpp +++ b/llvm/tools/llvm-exegesis/lib/Assembler.cpp @@ -21,6 +21,7 @@ #include "llvm/ExecutionEngine/SectionMemoryManager.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/MC/MCInstrInfo.h" +#include "llvm/Support/Alignment.h" #include "llvm/Support/MemoryBuffer.h" namespace llvm { @@ -28,6 +29,7 @@ namespace exegesis { static constexpr const char ModuleID[] = "ExegesisInfoTest"; static constexpr const char FunctionID[] = "foo"; +static const Align kFunctionAlignment(4096); // Fills the given basic block with register setup code, and returns true if // all registers could be setup correctly. @@ -169,13 +171,13 @@ void assembleToStream(const ExegesisTarget &ET, ArrayRef LiveIns, ArrayRef RegisterInitialValues, const FillFunction &Fill, raw_pwrite_stream &AsmStream) { - std::unique_ptr Context = std::make_unique(); + auto Context = std::make_unique(); std::unique_ptr Module = createModule(Context, TM->createDataLayout()); - std::unique_ptr MMIWP = - std::make_unique(TM.get()); + auto MMIWP = std::make_unique(TM.get()); MachineFunction &MF = createVoidVoidPtrMachineFunction( FunctionID, Module.get(), &MMIWP.get()->getMMI()); + MF.ensureAlignment(kFunctionAlignment); // We need to instruct the passes that we're done with SSA and virtual // registers. @@ -305,9 +307,11 @@ ExecutableFunction::ExecutableFunction( // executable page. ExecEngine->addObjectFile(std::move(ObjectFileHolder)); // Fetching function bytes. - FunctionBytes = StringRef(reinterpret_cast( - ExecEngine->getFunctionAddress(FunctionID)), - CodeSize); + const uint64_t FunctionAddress = ExecEngine->getFunctionAddress(FunctionID); + assert(isAligned(kFunctionAlignment, FunctionAddress) && + "function is not properly aligned"); + FunctionBytes = + StringRef(reinterpret_cast(FunctionAddress), CodeSize); } } // namespace exegesis From 604b7c22beb48edb29c605d9c3e75a7d2d1b3c2a Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 9 Oct 2019 14:26:09 +0000 Subject: [PATCH 04/44] Fix Wdocumentation unknown parameter warning. NFCI. llvm-svn: 374171 --- llvm/include/llvm-c/DebugInfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h index e9e0947620ad4..41e9f96bbb928 100644 --- a/llvm/include/llvm-c/DebugInfo.h +++ b/llvm/include/llvm-c/DebugInfo.h @@ -539,7 +539,7 @@ LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder, * @param Builder The DIBuilder. * @param ParentMacroFile Macro parent (could be NULL). * @param Line Source line number where the macro is defined. - * @param MacroType DW_MACINFO_define or DW_MACINFO_undef. + * @param RecordType DW_MACINFO_define or DW_MACINFO_undef. * @param Name Macro name. * @param NameLen Macro name length. * @param Value Macro value. From ae1b7859cbd61d2284d9690bc53482d0b6a46f63 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Wed, 9 Oct 2019 14:46:08 +0000 Subject: [PATCH 05/44] [clang-format] Update noexcept reference qualifiers detection Summary: r373165 fixed an issue where a templated noexcept member function with a reference qualifier would be indented more than expected: ``` // Formatting produced with LLVM style with AlwaysBreakTemplateDeclarations: Yes // before r373165: struct f { template void bar() && noexcept {} }; // after: struct f { template void bar() && noexcept {} }; ``` The way this is done is that in the AnnotatingParser in `lib/FormatTokenAnnotator.cpp` the determination of the usage of a `&` or `&&` (the line in determineTokenType ``` Current.Type = determineStarAmpUsage(... ``` is not performed in some cases anymore, combining with a few additional related checks afterwards. The net effect of these checks results in the `&` or `&&` token to start being classified as `TT_Unknown` in cases where before `r373165` it would be classified as `TT_UnaryOperator` or `TT_PointerOrReference` by `determineStarAmpUsage`. This inadvertently caused 2 classes of regressions I'm aware of: - The address-of `&` after a function assignment would be classified as `TT_Unknown`, causing spaces to surround it, disregarding style options: ``` // before r373165: void (*fun_ptr)(void) = &fun; // after: void (*fun_ptr)(void) = & fun; ``` - In cases where there is a function declaration list -- looking macro between a template line and the start of the function declaration, an `&` as part of the return type would be classified as `TT_Unknown`, causing spaces to surround it: ``` // before r373165: template DEPRECATED("lala") Type& foo(); // after: template DEPRECATED("lala") Type & foo(); ``` In these cases the problems are rooted in the skipping of the classification of a `&` (and similarly `&&`) by determineStarAmpUsage which effects the formatting decisions later in the pipeline. I've looked into the goal of r373165 and noticed that replacing `noexcept` with `const` in the given example produces no extra indentation with the old code: ``` // before r373165: struct f { template int foo() & const {} }; struct f { template int foo() & noexcept {} }; ``` I investigated how clang-format annotated these two examples differently to determine the places where the processing of both diverges in the pipeline. There were two places where the processing diverges, causing the extra indent in the `noexcept` case: 1. The `const` is annotated as a `TT_TrailingAnnotation`, whereas `noexcept` is annotated as `TT_Unknown`. I've updated the `determineTokenType` function to account for this by adding a missing `tok:kw_noexcept` to the clause that marks a token as `TT_TrailingAnnotation`. 2. The `&` in the second example is wrongly identified as `TT_BinaryOperator` in `determineStarAmpUsage`. This is the reason for the extra indentation -- clang-format gets confused and thinks this is an expression. I've updated `determineStarAmpUsage` to check for `tok:kw_noexcept`. With these two updates in place, the additional parsing introduced by r373165 becomes unnecessary and all added tests pass (with updates, as now clang-format respects the style configuration for spaces around the `&` in the test examples). I've removed these additions and added regression tests for the cases above. Reviewers: AndWass, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: cfe-commits Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D68695 llvm-svn: 374172 --- clang/lib/Format/TokenAnnotator.cpp | 22 +++++++----------- clang/unittests/Format/FormatTest.cpp | 32 +++++++++++++++++++++------ 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index d4519fe9c4a39..88f7468122930 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -15,6 +15,7 @@ #include "TokenAnnotator.h" #include "FormatToken.h" #include "clang/Basic/SourceManager.h" +#include "clang/Basic/TokenKinds.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Support/Debug.h" @@ -65,7 +66,7 @@ class AnnotatingParser { AnnotatingParser(const FormatStyle &Style, AnnotatedLine &Line, const AdditionalKeywords &Keywords) : Style(Style), Line(Line), CurrentToken(Line.First), AutoFound(false), - TrailingReturnFound(false), Keywords(Keywords) { + Keywords(Keywords) { Contexts.push_back(Context(tok::unknown, 1, /*IsExpression=*/false)); resetTokenMetadata(CurrentToken); } @@ -1397,11 +1398,7 @@ class AnnotatingParser { !Current.Previous->is(tok::kw_operator)) { // not auto operator->() -> xxx; Current.Type = TT_TrailingReturnArrow; - TrailingReturnFound = true; - } else if (Current.is(tok::star) || - (Current.isOneOf(tok::amp, tok::ampamp) && - (Current.NestingLevel != 0 || !Line.MightBeFunctionDecl || - TrailingReturnFound))) { + } else if (Current.isOneOf(tok::star, tok::amp, tok::ampamp)) { Current.Type = determineStarAmpUsage(Current, Contexts.back().CanBeExpression && Contexts.back().IsExpression, @@ -1424,8 +1421,6 @@ class AnnotatingParser { Current.Type = TT_ConditionalExpr; } } else if (Current.isBinaryOperator() && - !(Line.MightBeFunctionDecl && Current.NestingLevel == 0 && - Current.isOneOf(tok::amp, tok::ampamp)) && (!Current.Previous || Current.Previous->isNot(tok::l_square)) && (!Current.is(tok::greater) && Style.Language != FormatStyle::LK_TextProto)) { @@ -1500,12 +1495,11 @@ class AnnotatingParser { // colon after this, this is the only place which annotates the identifier // as a selector.) Current.Type = TT_SelectorName; - } else if (Current.isOneOf(tok::identifier, tok::kw_const, tok::amp, - tok::ampamp) && + } else if (Current.isOneOf(tok::identifier, tok::kw_const, + tok::kw_noexcept) && Current.Previous && !Current.Previous->isOneOf(tok::equal, tok::at) && - Line.MightBeFunctionDecl && !TrailingReturnFound && - Contexts.size() == 1) { + Line.MightBeFunctionDecl && Contexts.size() == 1) { // Line.MightBeFunctionDecl can only be true after the parentheses of a // function declaration have been found. Current.Type = TT_TrailingAnnotation; @@ -1689,7 +1683,8 @@ class AnnotatingParser { const FormatToken *NextToken = Tok.getNextNonComment(); if (!NextToken || - NextToken->isOneOf(tok::arrow, tok::equal, tok::kw_const) || + NextToken->isOneOf(tok::arrow, tok::equal, tok::kw_const, + tok::kw_noexcept) || (NextToken->is(tok::l_brace) && !NextToken->getNextNonComment())) return TT_PointerOrReference; @@ -1790,7 +1785,6 @@ class AnnotatingParser { AnnotatedLine &Line; FormatToken *CurrentToken; bool AutoFound; - bool TrailingReturnFound; const AdditionalKeywords &Keywords; // Set of "<" tokens that do not open a template parameter list. If parseAngle diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 8c2bc1ab22839..dde065ad818c7 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -7037,31 +7037,31 @@ TEST_F(FormatTest, UnderstandsFunctionRefQualification) { verifyFormat("struct f {\n" " template \n" - " int &foo(const std::string &str) & noexcept {}\n" + " int &foo(const std::string &str) &noexcept {}\n" "};", BreakTemplate); verifyFormat("struct f {\n" " template \n" - " int &foo(const std::string &str) && noexcept {}\n" + " int &foo(const std::string &str) &&noexcept {}\n" "};", BreakTemplate); verifyFormat("struct f {\n" " template \n" - " int &foo(const std::string &str) const & noexcept {}\n" + " int &foo(const std::string &str) const &noexcept {}\n" "};", BreakTemplate); verifyFormat("struct f {\n" " template \n" - " int &foo(const std::string &str) const & noexcept {}\n" + " int &foo(const std::string &str) const &noexcept {}\n" "};", BreakTemplate); verifyFormat("struct f {\n" " template \n" - " auto foo(const std::string &str) && noexcept -> int & {}\n" + " auto foo(const std::string &str) &&noexcept -> int & {}\n" "};", BreakTemplate); @@ -7084,13 +7084,13 @@ TEST_F(FormatTest, UnderstandsFunctionRefQualification) { verifyFormat("struct f {\n" " template \n" - " int& foo(const std::string& str) const & noexcept {}\n" + " int& foo(const std::string& str) const& noexcept {}\n" "};", AlignLeftBreakTemplate); verifyFormat("struct f {\n" " template \n" - " int& foo(const std::string& str) const & noexcept {}\n" + " int& foo(const std::string& str) const&& noexcept {}\n" "};", AlignLeftBreakTemplate); @@ -7099,6 +7099,24 @@ TEST_F(FormatTest, UnderstandsFunctionRefQualification) { " auto foo(const std::string& str) && noexcept -> int& {}\n" "};", AlignLeftBreakTemplate); + + // The `&` in `Type&` should not be confused with a trailing `&` of + // DEPRECATED(reason) member function. + verifyFormat("struct f {\n" + " template \n" + " DEPRECATED(reason)\n" + " Type &foo(arguments) {}\n" + "};", + BreakTemplate); + + verifyFormat("struct f {\n" + " template \n" + " DEPRECATED(reason)\n" + " Type& foo(arguments) {}\n" + "};", + AlignLeftBreakTemplate); + + verifyFormat("void (*foopt)(int) = &func;"); } TEST_F(FormatTest, UnderstandsNewAndDelete) { From f7b1489ffc5106aff3135b3ed664c99cf9a57481 Mon Sep 17 00:00:00 2001 From: Kostya Kortchinsky Date: Wed, 9 Oct 2019 15:09:28 +0000 Subject: [PATCH 06/44] [scudo][standalone] Get statistics in a char buffer Summary: Following up on D68471, this CL introduces some `getStats` APIs to gather statistics in char buffers (`ScopedString` really) instead of printing them out right away. Ultimately `printStats` will just output the buffer, but that allows us to potentially do some work on the intermediate buffer, and can be used for a `mallocz` type of functionality. This allows us to pretty much get rid of all the `Printf` calls around, but I am keeping the function in for debugging purposes. This changes the existing tests to use the new APIs when required. I will add new tests as suggested in D68471 in another CL. Reviewers: morehouse, hctim, vitalybuka, eugenis, cferris Reviewed By: morehouse Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D68653 llvm-svn: 374173 --- compiler-rt/lib/scudo/standalone/combined.h | 32 ++++++++++++++-- compiler-rt/lib/scudo/standalone/crc32_hw.cpp | 2 +- compiler-rt/lib/scudo/standalone/primary32.h | 22 +++++------ compiler-rt/lib/scudo/standalone/primary64.h | 37 ++++++++++--------- compiler-rt/lib/scudo/standalone/quarantine.h | 20 +++++----- .../lib/scudo/standalone/secondary.cpp | 13 ++++--- compiler-rt/lib/scudo/standalone/secondary.h | 3 +- .../lib/scudo/standalone/size_class_map.h | 8 ++-- .../lib/scudo/standalone/string_utils.cpp | 17 +++++++-- .../lib/scudo/standalone/string_utils.h | 1 + .../scudo/standalone/tests/combined_test.cpp | 16 +++++++- .../scudo/standalone/tests/primary_test.cpp | 19 +++++++--- .../standalone/tests/quarantine_test.cpp | 8 +++- .../scudo/standalone/tests/secondary_test.cpp | 16 ++++++-- 14 files changed, 145 insertions(+), 69 deletions(-) diff --git a/compiler-rt/lib/scudo/standalone/combined.h b/compiler-rt/lib/scudo/standalone/combined.h index b2dc25f78b594..60be1dd20d398 100644 --- a/compiler-rt/lib/scudo/standalone/combined.h +++ b/compiler-rt/lib/scudo/standalone/combined.h @@ -369,12 +369,31 @@ template class Allocator { Primary.enable(); } + // The function returns the amount of bytes required to store the statistics, + // which might be larger than the amount of bytes provided. Note that the + // statistics buffer is not necessarily constant between calls to this + // function. This can be called with a null buffer or zero size for buffer + // sizing purposes. + uptr getStats(char *Buffer, uptr Size) { + ScopedString Str(1024); + disable(); + const uptr Length = getStats(&Str) + 1; + enable(); + if (Length < Size) + Size = Length; + if (Buffer && Size) { + memcpy(Buffer, Str.data(), Size); + Buffer[Size - 1] = '\0'; + } + return Length; + } + void printStats() { + ScopedString Str(1024); disable(); - Primary.printStats(); - Secondary.printStats(); - Quarantine.printStats(); + getStats(&Str); enable(); + Str.output(); } void releaseToOS() { Primary.releaseToOS(); } @@ -563,6 +582,13 @@ template class Allocator { *Size = getSize(Ptr, &Header); return P; } + + uptr getStats(ScopedString *Str) { + Primary.getStats(Str); + Secondary.getStats(Str); + Quarantine.getStats(Str); + return Str->length(); + } }; } // namespace scudo diff --git a/compiler-rt/lib/scudo/standalone/crc32_hw.cpp b/compiler-rt/lib/scudo/standalone/crc32_hw.cpp index f4dae7b5fea83..62841ba510199 100644 --- a/compiler-rt/lib/scudo/standalone/crc32_hw.cpp +++ b/compiler-rt/lib/scudo/standalone/crc32_hw.cpp @@ -1,4 +1,4 @@ -//===-- crc32_hw.h ----------------------------------------------*- C++ -*-===// +//===-- crc32_hw.cpp --------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/compiler-rt/lib/scudo/standalone/primary32.h b/compiler-rt/lib/scudo/standalone/primary32.h index a9fbb70bccf8d..9123d07b49b95 100644 --- a/compiler-rt/lib/scudo/standalone/primary32.h +++ b/compiler-rt/lib/scudo/standalone/primary32.h @@ -143,7 +143,7 @@ template class SizeClassAllocator32 { } } - void printStats() { + void getStats(ScopedString *Str) { // TODO(kostyak): get the RSS per region. uptr TotalMapped = 0; uptr PoppedBlocks = 0; @@ -154,11 +154,11 @@ template class SizeClassAllocator32 { PoppedBlocks += Sci->Stats.PoppedBlocks; PushedBlocks += Sci->Stats.PushedBlocks; } - Printf("Stats: SizeClassAllocator32: %zuM mapped in %zu allocations; " - "remains %zu\n", - TotalMapped >> 20, PoppedBlocks, PoppedBlocks - PushedBlocks); + Str->append("Stats: SizeClassAllocator32: %zuM mapped in %zu allocations; " + "remains %zu\n", + TotalMapped >> 20, PoppedBlocks, PoppedBlocks - PushedBlocks); for (uptr I = 0; I < NumClasses; I++) - printStats(I, 0); + getStats(Str, I, 0); } uptr releaseToOS() { @@ -328,17 +328,17 @@ template class SizeClassAllocator32 { return B; } - void printStats(uptr ClassId, uptr Rss) { + void getStats(ScopedString *Str, uptr ClassId, uptr Rss) { SizeClassInfo *Sci = getSizeClassInfo(ClassId); if (Sci->AllocatedUser == 0) return; const uptr InUse = Sci->Stats.PoppedBlocks - Sci->Stats.PushedBlocks; const uptr AvailableChunks = Sci->AllocatedUser / getSizeByClassId(ClassId); - Printf(" %02zu (%6zu): mapped: %6zuK popped: %7zu pushed: %7zu inuse: %6zu" - " avail: %6zu rss: %6zuK\n", - ClassId, getSizeByClassId(ClassId), Sci->AllocatedUser >> 10, - Sci->Stats.PoppedBlocks, Sci->Stats.PushedBlocks, InUse, - AvailableChunks, Rss >> 10); + Str->append(" %02zu (%6zu): mapped: %6zuK popped: %7zu pushed: %7zu " + "inuse: %6zu avail: %6zu rss: %6zuK\n", + ClassId, getSizeByClassId(ClassId), Sci->AllocatedUser >> 10, + Sci->Stats.PoppedBlocks, Sci->Stats.PushedBlocks, InUse, + AvailableChunks, Rss >> 10); } NOINLINE uptr releaseToOSMaybe(SizeClassInfo *Sci, uptr ClassId, diff --git a/compiler-rt/lib/scudo/standalone/primary64.h b/compiler-rt/lib/scudo/standalone/primary64.h index f56387b05004c..8f443ea7fa3f3 100644 --- a/compiler-rt/lib/scudo/standalone/primary64.h +++ b/compiler-rt/lib/scudo/standalone/primary64.h @@ -147,7 +147,7 @@ template class SizeClassAllocator64 { } } - void printStats() const { + void getStats(ScopedString *Str) const { // TODO(kostyak): get the RSS per region. uptr TotalMapped = 0; uptr PoppedBlocks = 0; @@ -159,12 +159,13 @@ template class SizeClassAllocator64 { PoppedBlocks += Region->Stats.PoppedBlocks; PushedBlocks += Region->Stats.PushedBlocks; } - Printf("Stats: Primary64: %zuM mapped (%zuM rss) in %zu allocations; " - "remains %zu\n", - TotalMapped >> 20, 0, PoppedBlocks, PoppedBlocks - PushedBlocks); + Str->append("Stats: SizeClassAllocator64: %zuM mapped (%zuM rss) in %zu " + "allocations; remains %zu\n", + TotalMapped >> 20, 0, PoppedBlocks, + PoppedBlocks - PushedBlocks); for (uptr I = 0; I < NumClasses; I++) - printStats(I, 0); + getStats(Str, I, 0); } uptr releaseToOS() { @@ -269,10 +270,12 @@ template class SizeClassAllocator64 { if (UNLIKELY(RegionBase + MappedUser + UserMapSize > RegionSize)) { if (!Region->Exhausted) { Region->Exhausted = true; - printStats(); - Printf( + ScopedString Str(1024); + getStats(&Str); + Str.append( "Scudo OOM: The process has Exhausted %zuM for size class %zu.\n", RegionSize >> 20, Size); + Str.output(); } return nullptr; } @@ -322,21 +325,21 @@ template class SizeClassAllocator64 { return B; } - void printStats(uptr ClassId, uptr Rss) const { + void getStats(ScopedString *Str, uptr ClassId, uptr Rss) const { RegionInfo *Region = getRegionInfo(ClassId); if (Region->MappedUser == 0) return; const uptr InUse = Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks; const uptr TotalChunks = Region->AllocatedUser / getSizeByClassId(ClassId); - Printf("%s %02zu (%6zu): mapped: %6zuK popped: %7zu pushed: %7zu inuse: " - "%6zu total: %6zu rss: %6zuK releases: %6zu last released: %6zuK " - "region: 0x%zx (0x%zx)\n", - Region->Exhausted ? "F" : " ", ClassId, getSizeByClassId(ClassId), - Region->MappedUser >> 10, Region->Stats.PoppedBlocks, - Region->Stats.PushedBlocks, InUse, TotalChunks, Rss >> 10, - Region->ReleaseInfo.RangesReleased, - Region->ReleaseInfo.LastReleasedBytes >> 10, Region->RegionBeg, - getRegionBaseByClassId(ClassId)); + Str->append("%s %02zu (%6zu): mapped: %6zuK popped: %7zu pushed: %7zu " + "inuse: %6zu total: %6zu rss: %6zuK releases: %6zu last " + "released: %6zuK region: 0x%zx (0x%zx)\n", + Region->Exhausted ? "F" : " ", ClassId, + getSizeByClassId(ClassId), Region->MappedUser >> 10, + Region->Stats.PoppedBlocks, Region->Stats.PushedBlocks, InUse, + TotalChunks, Rss >> 10, Region->ReleaseInfo.RangesReleased, + Region->ReleaseInfo.LastReleasedBytes >> 10, Region->RegionBeg, + getRegionBaseByClassId(ClassId)); } NOINLINE uptr releaseToOSMaybe(RegionInfo *Region, uptr ClassId, diff --git a/compiler-rt/lib/scudo/standalone/quarantine.h b/compiler-rt/lib/scudo/standalone/quarantine.h index 732373abad3b0..35fd0bc197ea6 100644 --- a/compiler-rt/lib/scudo/standalone/quarantine.h +++ b/compiler-rt/lib/scudo/standalone/quarantine.h @@ -130,7 +130,7 @@ template class QuarantineCache { subFromSize(ExtractedSize); } - void printStats() const { + void getStats(ScopedString *Str) const { uptr BatchCount = 0; uptr TotalOverheadBytes = 0; uptr TotalBytes = 0; @@ -152,11 +152,11 @@ template class QuarantineCache { (TotalQuarantinedBytes == 0) ? 0 : TotalOverheadBytes * 100 / TotalQuarantinedBytes; - Printf("Global quarantine stats: batches: %zu; bytes: %zu (user: %zu); " - "chunks: %zu (capacity: %zu); %zu%% chunks used; %zu%% memory " - "overhead\n", - BatchCount, TotalBytes, TotalQuarantinedBytes, TotalQuarantineChunks, - QuarantineChunksCapacity, ChunksUsagePercent, MemoryOverheadPercent); + Str->append( + "Stats: Quarantine: batches: %zu; bytes: %zu (user: %zu); chunks: %zu " + "(capacity: %zu); %zu%% chunks used; %zu%% memory overhead\n", + BatchCount, TotalBytes, TotalQuarantinedBytes, TotalQuarantineChunks, + QuarantineChunksCapacity, ChunksUsagePercent, MemoryOverheadPercent); } private: @@ -218,11 +218,11 @@ template class GlobalQuarantine { recycle(0, Cb); } - void printStats() const { + void getStats(ScopedString *Str) const { // It assumes that the world is stopped, just as the allocator's printStats. - Printf("Quarantine limits: global: %zuM; thread local: %zuK\n", - getMaxSize() >> 20, getCacheSize() >> 10); - Cache.printStats(); + Cache.getStats(Str); + Str->append("Quarantine limits: global: %zuK; thread local: %zuK\n", + getMaxSize() >> 10, getCacheSize() >> 10); } private: diff --git a/compiler-rt/lib/scudo/standalone/secondary.cpp b/compiler-rt/lib/scudo/standalone/secondary.cpp index d725034ee9141..db7361d7134aa 100644 --- a/compiler-rt/lib/scudo/standalone/secondary.cpp +++ b/compiler-rt/lib/scudo/standalone/secondary.cpp @@ -123,12 +123,13 @@ void MapAllocator::deallocate(void *Ptr) { unmap(Addr, Size, UNMAP_ALL, &Data); } -void MapAllocator::printStats() const { - Printf("Stats: MapAllocator: allocated %zu times (%zuK), freed %zu times " - "(%zuK), remains %zu (%zuK) max %zuM\n", - NumberOfAllocs, AllocatedBytes >> 10, NumberOfFrees, FreedBytes >> 10, - NumberOfAllocs - NumberOfFrees, (AllocatedBytes - FreedBytes) >> 10, - LargestSize >> 20); +void MapAllocator::getStats(ScopedString *Str) const { + Str->append( + "Stats: MapAllocator: allocated %zu times (%zuK), freed %zu times " + "(%zuK), remains %zu (%zuK) max %zuM\n", + NumberOfAllocs, AllocatedBytes >> 10, NumberOfFrees, FreedBytes >> 10, + NumberOfAllocs - NumberOfFrees, (AllocatedBytes - FreedBytes) >> 10, + LargestSize >> 20); } } // namespace scudo diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h index 80cae9fd22c7d..9d074a57c7722 100644 --- a/compiler-rt/lib/scudo/standalone/secondary.h +++ b/compiler-rt/lib/scudo/standalone/secondary.h @@ -12,6 +12,7 @@ #include "common.h" #include "mutex.h" #include "stats.h" +#include "string_utils.h" namespace scudo { @@ -70,7 +71,7 @@ class MapAllocator { return getBlockEnd(Ptr) - reinterpret_cast(Ptr); } - void printStats() const; + void getStats(ScopedString *Str) const; void disable() { Mutex.lock(); } diff --git a/compiler-rt/lib/scudo/standalone/size_class_map.h b/compiler-rt/lib/scudo/standalone/size_class_map.h index 3b494afb3bbf6..dfef0865b9d93 100644 --- a/compiler-rt/lib/scudo/standalone/size_class_map.h +++ b/compiler-rt/lib/scudo/standalone/size_class_map.h @@ -86,6 +86,7 @@ class SizeClassMap { } static void print() { + ScopedString Buffer(1024); uptr PrevS = 0; uptr TotalCached = 0; for (uptr I = 0; I < NumClasses; I++) { @@ -93,19 +94,20 @@ class SizeClassMap { continue; const uptr S = getSizeByClassId(I); if (S >= MidSize / 2 && (S & (S - 1)) == 0) - Printf("\n"); + Buffer.append("\n"); const uptr D = S - PrevS; const uptr P = PrevS ? (D * 100 / PrevS) : 0; const uptr L = S ? getMostSignificantSetBitIndex(S) : 0; const uptr Cached = getMaxCachedHint(S) * S; - Printf( + Buffer.append( "C%02zu => S: %zu diff: +%zu %02zu%% L %zu Cached: %zu %zu; id %zu\n", I, getSizeByClassId(I), D, P, L, getMaxCachedHint(S), Cached, getClassIdBySize(S)); TotalCached += Cached; PrevS = S; } - Printf("Total Cached: %zu\n", TotalCached); + Buffer.append("Total Cached: %zu\n", TotalCached); + Buffer.output(); } static void validate() { diff --git a/compiler-rt/lib/scudo/standalone/string_utils.cpp b/compiler-rt/lib/scudo/standalone/string_utils.cpp index 22b4fbd744706..5de8b57bfcd12 100644 --- a/compiler-rt/lib/scudo/standalone/string_utils.cpp +++ b/compiler-rt/lib/scudo/standalone/string_utils.cpp @@ -208,9 +208,18 @@ int formatString(char *Buffer, uptr BufferLength, const char *Format, } void ScopedString::append(const char *Format, va_list Args) { - CHECK_LT(Length, String.size()); - formatString(String.data() + Length, String.size() - Length, Format, Args); - Length += strlen(String.data() + Length); + DCHECK_LT(Length, String.size()); + va_list ArgsCopy; + va_copy(ArgsCopy, Args); + // formatString doesn't currently support a null buffer or zero buffer length, + // so in order to get the resulting formatted string length, we use a one-char + // buffer. + char C[1]; + const uptr AdditionalLength = + static_cast(formatString(C, sizeof(C), Format, Args)) + 1; + String.resize(Length + AdditionalLength); + formatString(String.data() + Length, AdditionalLength, Format, ArgsCopy); + Length = strlen(String.data()); CHECK_LT(Length, String.size()); } @@ -226,7 +235,7 @@ FORMAT(1, 2) void Printf(const char *Format, ...) { va_list Args; va_start(Args, Format); - ScopedString Msg(512); + ScopedString Msg(1024); Msg.append(Format, Args); outputRaw(Msg.data()); va_end(Args); diff --git a/compiler-rt/lib/scudo/standalone/string_utils.h b/compiler-rt/lib/scudo/standalone/string_utils.h index aea7b3ffd7a50..acd60bda9d8d3 100644 --- a/compiler-rt/lib/scudo/standalone/string_utils.h +++ b/compiler-rt/lib/scudo/standalone/string_utils.h @@ -29,6 +29,7 @@ class ScopedString { } void append(const char *Format, va_list Args); void append(const char *Format, ...); + void output() const { outputRaw(String.data()); } private: Vector String; diff --git a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp index 3f971a3042886..d74c07e8458bb 100644 --- a/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/combined_test.cpp @@ -136,7 +136,21 @@ template static void testAllocator() { } Allocator->releaseToOS(); - Allocator->printStats(); + + scudo::uptr BufferSize = 8192; + std::vector Buffer(BufferSize); + scudo::uptr ActualSize = Allocator->getStats(Buffer.data(), BufferSize); + while (ActualSize > BufferSize) { + BufferSize = ActualSize + 1024; + Buffer.resize(BufferSize); + ActualSize = Allocator->getStats(Buffer.data(), BufferSize); + } + std::string Stats(Buffer.begin(), Buffer.end()); + // Basic checks on the contents of the statistics output, which also allows us + // to verify that we got it all. + EXPECT_NE(Stats.find("Stats: SizeClassAllocator"), std::string::npos); + EXPECT_NE(Stats.find("Stats: MapAllocator"), std::string::npos); + EXPECT_NE(Stats.find("Stats: Quarantine"), std::string::npos); } TEST(ScudoCombinedTest, BasicCombined) { diff --git a/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp b/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp index a6cfc6bdb1b79..7da7b25ca67ed 100644 --- a/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/primary_test.cpp @@ -46,7 +46,9 @@ template static void testPrimary() { } Cache.destroy(nullptr); Allocator->releaseToOS(); - Allocator->printStats(); + scudo::ScopedString Str(1024); + Allocator->getStats(&Str); + Str.output(); } TEST(ScudoPrimaryTest, BasicPrimary) { @@ -86,7 +88,9 @@ TEST(ScudoPrimaryTest, Primary64OOM) { } Cache.destroy(nullptr); Allocator.releaseToOS(); - Allocator.printStats(); + scudo::ScopedString Str(1024); + Allocator.getStats(&Str); + Str.output(); EXPECT_EQ(AllocationFailed, true); Allocator.unmapTestOnly(); } @@ -125,7 +129,9 @@ template static void testIteratePrimary() { } Cache.destroy(nullptr); Allocator->releaseToOS(); - Allocator->printStats(); + scudo::ScopedString Str(1024); + Allocator->getStats(&Str); + Str.output(); } TEST(ScudoPrimaryTest, PrimaryIterate) { @@ -180,7 +186,9 @@ template static void testPrimaryThreaded() { for (auto &T : Threads) T.join(); Allocator->releaseToOS(); - Allocator->printStats(); + scudo::ScopedString Str(1024); + Allocator->getStats(&Str); + Str.output(); } TEST(ScudoPrimaryTest, PrimaryThreaded) { @@ -203,8 +211,7 @@ template static void testReleaseToOS() { Cache.init(nullptr, Allocator.get()); const scudo::uptr Size = scudo::getPageSizeCached() * 2; EXPECT_TRUE(Primary::canAllocate(Size)); - const scudo::uptr ClassId = - Primary::SizeClassMap::getClassIdBySize(Size); + const scudo::uptr ClassId = Primary::SizeClassMap::getClassIdBySize(Size); void *P = Cache.allocate(ClassId); EXPECT_NE(P, nullptr); Cache.deallocate(ClassId, P); diff --git a/compiler-rt/lib/scudo/standalone/tests/quarantine_test.cpp b/compiler-rt/lib/scudo/standalone/tests/quarantine_test.cpp index d7453aa422513..28baf8feb653f 100644 --- a/compiler-rt/lib/scudo/standalone/tests/quarantine_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/quarantine_test.cpp @@ -213,7 +213,9 @@ TEST(ScudoQuarantineTest, GlobalQuarantine) { Quarantine.drainAndRecycle(&Cache, Cb); EXPECT_EQ(Cache.getSize(), 0UL); - Quarantine.printStats(); + scudo::ScopedString Str(1024); + Quarantine.getStats(&Str); + Str.output(); } void *populateQuarantine(void *Param) { @@ -236,5 +238,7 @@ TEST(ScudoQuarantineTest, ThreadedGlobalQuarantine) { for (scudo::uptr I = 0; I < NumberOfThreads; I++) pthread_join(T[I], 0); - Quarantine.printStats(); + scudo::ScopedString Str(1024); + Quarantine.getStats(&Str); + Str.output(); } diff --git a/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp b/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp index 84c375449e3ee..b602b8d63e32d 100644 --- a/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp @@ -45,7 +45,9 @@ TEST(ScudoSecondaryTest, SecondaryBasic) { L->deallocate(V.back()); V.pop_back(); } - L->printStats(); + scudo::ScopedString Str(1024); + L->getStats(&Str); + Str.output(); } // This exercises a variety of combinations of size and alignment for the @@ -76,7 +78,9 @@ TEST(ScudoSecondaryTest, SecondaryCombinations) { } } } - L->printStats(); + scudo::ScopedString Str(1024); + L->getStats(&Str); + Str.output(); } TEST(ScudoSecondaryTest, SecondaryIterate) { @@ -97,7 +101,9 @@ TEST(ScudoSecondaryTest, SecondaryIterate) { L->deallocate(V.back()); V.pop_back(); } - L->printStats(); + scudo::ScopedString Str(1024); + L->getStats(&Str); + Str.output(); } static std::mutex Mutex; @@ -133,5 +139,7 @@ TEST(ScudoSecondaryTest, SecondaryThreadsRace) { } for (auto &T : Threads) T.join(); - L->printStats(); + scudo::ScopedString Str(1024); + L->getStats(&Str); + Str.output(); } From 791b0e416016c9ebedd4b0cd95f8aca3a0208689 Mon Sep 17 00:00:00 2001 From: Mitchell Balan Date: Wed, 9 Oct 2019 15:11:34 +0000 Subject: [PATCH 07/44] [NFC] Test commit. Testing llvm commit access only. llvm-svn: 374174 --- clang/docs/ClangFormatStyleOptions.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst index 3cd47d3c0ac08..2ff48eee865bc 100644 --- a/clang/docs/ClangFormatStyleOptions.rst +++ b/clang/docs/ClangFormatStyleOptions.rst @@ -2507,3 +2507,5 @@ The result is: r(); } } + + \ No newline at end of file From 77c9736ef3e0c95e1dbe5c85ad3c1061ce072b50 Mon Sep 17 00:00:00 2001 From: Mitchell Balan Date: Wed, 9 Oct 2019 15:12:22 +0000 Subject: [PATCH 08/44] [NFC] Reverting changes from test commit. llvm commit access test succeeded. llvm-svn: 374175 --- clang/docs/ClangFormatStyleOptions.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst index 2ff48eee865bc..3cd47d3c0ac08 100644 --- a/clang/docs/ClangFormatStyleOptions.rst +++ b/clang/docs/ClangFormatStyleOptions.rst @@ -2507,5 +2507,3 @@ The result is: r(); } } - - \ No newline at end of file From 7faa14a98bdc668822e99758f81a662f186ad35b Mon Sep 17 00:00:00 2001 From: Alina Sbirlea Date: Wed, 9 Oct 2019 15:54:24 +0000 Subject: [PATCH 09/44] [MemorySSA] Make the use of moveAllAfterMergeBlocks consistent. Summary: The rule for the moveAllAfterMergeBlocks API si for all instructions from `From` to have been moved to `To`, while keeping the CFG edges (and block terminators) unchanged. Update all the callsites for moveAllAfterMergeBlocks to follow this. Pending follow-up: since the same behavior is needed everytime, merge all callsites into one. The common denominator may be the call to `MergeBlockIntoPredecessor`. Resolves PR43569. Reviewers: george.burgess.iv Subscribers: Prazek, sanjoy.google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68659 llvm-svn: 374177 --- llvm/lib/Analysis/MemorySSAUpdater.cpp | 37 ++++++++------ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 22 +++++++-- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 27 +++++++--- .../Transforms/Utils/LoopRotationUtils.cpp | 7 ++- llvm/test/Analysis/MemorySSA/pr43569.ll | 49 +++++++++++++++++++ 5 files changed, 113 insertions(+), 29 deletions(-) create mode 100644 llvm/test/Analysis/MemorySSA/pr43569.ll diff --git a/llvm/lib/Analysis/MemorySSAUpdater.cpp b/llvm/lib/Analysis/MemorySSAUpdater.cpp index d103c3a8b831f..78e197aad5545 100644 --- a/llvm/lib/Analysis/MemorySSAUpdater.cpp +++ b/llvm/lib/Analysis/MemorySSAUpdater.cpp @@ -1159,25 +1159,32 @@ void MemorySSAUpdater::moveAllAccesses(BasicBlock *From, BasicBlock *To, if (!Accs) return; + assert(Start->getParent() == To && "Incorrect Start instruction"); MemoryAccess *FirstInNew = nullptr; for (Instruction &I : make_range(Start->getIterator(), To->end())) if ((FirstInNew = MSSA->getMemoryAccess(&I))) break; - if (!FirstInNew) - return; + if (FirstInNew) { + auto *MUD = cast(FirstInNew); + do { + auto NextIt = ++MUD->getIterator(); + MemoryUseOrDef *NextMUD = (!Accs || NextIt == Accs->end()) + ? nullptr + : cast(&*NextIt); + MSSA->moveTo(MUD, To, MemorySSA::End); + // Moving MUD from Accs in the moveTo above, may delete Accs, so we need + // to retrieve it again. + Accs = MSSA->getWritableBlockAccesses(From); + MUD = NextMUD; + } while (MUD); + } - auto *MUD = cast(FirstInNew); - do { - auto NextIt = ++MUD->getIterator(); - MemoryUseOrDef *NextMUD = (!Accs || NextIt == Accs->end()) - ? nullptr - : cast(&*NextIt); - MSSA->moveTo(MUD, To, MemorySSA::End); - // Moving MUD from Accs in the moveTo above, may delete Accs, so we need to - // retrieve it again. - Accs = MSSA->getWritableBlockAccesses(From); - MUD = NextMUD; - } while (MUD); + // If all accesses were moved and only a trivial Phi remains, we try to remove + // that Phi. This is needed when From is going to be deleted. + auto *Defs = MSSA->getWritableBlockDefs(From); + if (Defs && !Defs->empty()) + if (auto *Phi = dyn_cast(&*Defs->begin())) + tryRemoveTrivialPhi(Phi); } void MemorySSAUpdater::moveAllAfterSpliceBlocks(BasicBlock *From, @@ -1193,7 +1200,7 @@ void MemorySSAUpdater::moveAllAfterSpliceBlocks(BasicBlock *From, void MemorySSAUpdater::moveAllAfterMergeBlocks(BasicBlock *From, BasicBlock *To, Instruction *Start) { - assert(From->getSinglePredecessor() == To && + assert(From->getUniquePredecessor() == To && "From block is expected to have a single predecessor (To)."); moveAllAccesses(From, To, Start); for (BasicBlock *Succ : successors(From)) diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index 9938dd89c1975..880f5389171ff 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -1629,15 +1629,27 @@ void LoopUnswitch::SimplifyCode(std::vector &Worklist, Loop *L) { ReplaceUsesOfWith(PN, PN->getIncomingValue(0), Worklist, L, LPM, MSSAU.get()); - // If Succ has any successors with PHI nodes, update them to have - // entries coming from Pred instead of Succ. - Succ->replaceAllUsesWith(Pred); + Instruction *STI = Succ->getTerminator(); + Instruction *Start = &*Succ->begin(); + // If there's nothing to move, mark the starting instruction as the last + // instruction in the block. + if (Start == STI) + Start = BI; // Move all of the successor contents from Succ to Pred. Pred->getInstList().splice(BI->getIterator(), Succ->getInstList(), - Succ->begin(), Succ->end()); + Succ->begin(), STI->getIterator()); if (MSSAU) - MSSAU->moveAllAfterMergeBlocks(Succ, Pred, BI); + MSSAU->moveAllAfterMergeBlocks(Succ, Pred, Start); + + // Move terminator instruction from Succ now, we're deleting BI below. + // FIXME: remove BI first might be more intuitive. + Pred->getInstList().splice(Pred->end(), Succ->getInstList()); + + // If Succ has any successors with PHI nodes, update them to have + // entries coming from Pred instead of Succ. + Succ->replaceAllUsesWith(Pred); + LPM->deleteSimpleAnalysisValue(BI, L); RemoveFromWorklist(BI, Worklist); BI->eraseFromParent(); diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index 6e20ef21d9c95..b3dd3c9d724c7 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -227,17 +227,29 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU, Updates.push_back({DominatorTree::Delete, PredBB, BB}); } - if (MSSAU) - MSSAU->moveAllAfterMergeBlocks(BB, PredBB, &*(BB->begin())); + Instruction *PTI = PredBB->getTerminator(); + Instruction *STI = BB->getTerminator(); + Instruction *Start = &*BB->begin(); + // If there's nothing to move, mark the starting instruction as the last + // instruction in the block. + if (Start == STI) + Start = PTI; - // Delete the unconditional branch from the predecessor... - PredBB->getInstList().pop_back(); + // Move all definitions in the successor to the predecessor... + PredBB->getInstList().splice(PTI->getIterator(), BB->getInstList(), + BB->begin(), STI->getIterator()); + + if (MSSAU) + MSSAU->moveAllAfterMergeBlocks(BB, PredBB, Start); // Make all PHI nodes that referred to BB now refer to Pred as their // source... BB->replaceAllUsesWith(PredBB); - // Move all definitions in the successor to the predecessor... + // Delete the unconditional branch from the predecessor... + PredBB->getInstList().pop_back(); + + // Move terminator instruction and add unreachable to now empty BB. PredBB->getInstList().splice(PredBB->end(), BB->getInstList()); new UnreachableInst(BB->getContext(), BB); @@ -274,11 +286,10 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU, "applying corresponding DTU updates."); DTU->applyUpdatesPermissive(Updates); DTU->deleteBB(BB); - } - - else { + } else { BB->eraseFromParent(); // Nuke BB if DTU is nullptr. } + return true; } diff --git a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp index 37389a695b455..4765aa115d17f 100644 --- a/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopRotationUtils.cpp @@ -615,8 +615,13 @@ bool LoopRotate::simplifyLoopLatch(Loop *L) { LLVM_DEBUG(dbgs() << "Folding loop latch " << Latch->getName() << " into " << LastExit->getName() << "\n"); + Instruction *FirstLatchInst = &*Latch->begin(); + // If there's nothing to move, mark the starting instruction as the last + // instruction in the block. + if (FirstLatchInst == Jmp) + FirstLatchInst = BI; + // Hoist the instructions from Latch into LastExit. - Instruction *FirstLatchInst = &*(Latch->begin()); LastExit->getInstList().splice(BI->getIterator(), Latch->getInstList(), Latch->begin(), Jmp->getIterator()); diff --git a/llvm/test/Analysis/MemorySSA/pr43569.ll b/llvm/test/Analysis/MemorySSA/pr43569.ll new file mode 100644 index 0000000000000..c9c68451e6a78 --- /dev/null +++ b/llvm/test/Analysis/MemorySSA/pr43569.ll @@ -0,0 +1,49 @@ +; RUN: opt -pgo-kind=pgo-instr-gen-pipeline -aa-pipeline=default -passes="default" -enable-nontrivial-unswitch -S < %s | FileCheck %s +; REQUIRES: asserts + +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@__profn_c = private constant [1 x i8] c"c" +@b = common dso_local global i32 0, align 4 +@a = common dso_local global i16 0, align 2 + +; CHECK-LABEL: @c() +; Function Attrs: nounwind uwtable +define dso_local void @c() #0 { +entry: + call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_c, i32 0, i32 0), i64 68269137, i32 3, i32 0) + br label %for.cond + +for.cond: ; preds = %for.end, %entry + call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_c, i32 0, i32 0), i64 68269137, i32 3, i32 1) + store i32 0, i32* @b, align 4 + br label %for.cond1 + +for.cond1: ; preds = %for.inc, %for.cond + %0 = load i32, i32* @b, align 4 + %1 = load i16, i16* @a, align 2 + %conv = sext i16 %1 to i32 + %cmp = icmp slt i32 %0, %conv + br i1 %cmp, label %for.body, label %for.end + +for.body: ; preds = %for.cond1 + call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_c, i32 0, i32 0), i64 68269137, i32 3, i32 2) + br label %for.inc + +for.inc: ; preds = %for.body + %2 = load i32, i32* @b, align 4 + %inc = add nsw i32 %2, 1 + store i32 %inc, i32* @b, align 4 + br label %for.cond1 + +for.end: ; preds = %for.cond1 + br label %for.cond +} + +; Function Attrs: nounwind +declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #1 + +attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind } + From e7affcdbd2ee57a7e132f23a46b4ba8fe7808ead Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 9 Oct 2019 16:19:13 +0000 Subject: [PATCH 10/44] Re-land "[dsymutil] Fix handling of common symbols in multiple object files." The original patch got reverted because it hit a long-standing legacy issue on Windows that prevents files from being named `com`. Thanks Kristina & Jeremy for pointing this out. llvm-svn: 374178 --- .../Inputs/private/tmp/common/common.x86_64 | Bin 0 -> 4688 bytes .../Inputs/private/tmp/common/common1.o | Bin 0 -> 2108 bytes .../Inputs/private/tmp/common/common2.o | Bin 0 -> 2096 bytes .../tools/dsymutil/X86/common-sym-multi.test | 39 ++++++++++++++++++ llvm/tools/dsymutil/MachODebugMapParser.cpp | 35 +++++++++++++++- 5 files changed, 72 insertions(+), 2 deletions(-) create mode 100755 llvm/test/tools/dsymutil/Inputs/private/tmp/common/common.x86_64 create mode 100644 llvm/test/tools/dsymutil/Inputs/private/tmp/common/common1.o create mode 100644 llvm/test/tools/dsymutil/Inputs/private/tmp/common/common2.o create mode 100644 llvm/test/tools/dsymutil/X86/common-sym-multi.test diff --git a/llvm/test/tools/dsymutil/Inputs/private/tmp/common/common.x86_64 b/llvm/test/tools/dsymutil/Inputs/private/tmp/common/common.x86_64 new file mode 100755 index 0000000000000000000000000000000000000000..8260af4a1b79072761618d3ef6d10f01e59248d1 GIT binary patch literal 4688 zcmeHL&ubGw6rOETEwME5;4c(iq=*&FYETpeNud@?JP;;MLL31~fRyFJ_2PQ*&TVR=Vnpdg#yFnKG1)X zIe3}CEMWDz9c#;}S&f~o1~}y?z&buVUms<1SFY|pedngvRzBpQGXXzmI)xuV%0Kfh zgqWE+gB7L!lGC_9lX0L3_KP^{S&RA`W1Qn=Ghv9-p6461^B!3& zteNKyFdyR7%>#!33i&dYFmF()WITT#`fxq>!I^({@H}o|5V&Wfw-`_~`b)+Mt|5hA# zW!LM~WDWml;0dkmj&rx_*_P*STfzScmI(Iq+4@AYwj!(_GvK+udgrq6R+an&aGtX; literal 0 HcmV?d00001 diff --git a/llvm/test/tools/dsymutil/Inputs/private/tmp/common/common1.o b/llvm/test/tools/dsymutil/Inputs/private/tmp/common/common1.o new file mode 100644 index 0000000000000000000000000000000000000000..f238fc8fd03a87824e1a7120b6ddc8a360f6cc5d GIT binary patch literal 2108 zcma)7&2JM|5TCdHh>4SpsgaV1s&XVMK_zSlLgJ(aVu7nf;((G+5+d}vUhgIw+3S_P z2^1kU5-KX9t$IXAl~9lU1KQ@?LvQUrz<~>h3wK0Y(wVpO5@Uk!So7xN&HQ%Wybu5V z>c#6m01*QmkmJbPG~|$xMv+rwzk|+FBGMy{(KccN@c>OCNf|mf!$^gJkkhb`rj^5WI5>vH>wr|pj)!Tc+YXY+|mQ_8kVgfyYaqfJQi>= z`M&zBAgDXiw;E3Sfck!5pk;>1_lVc5ZrGI4UEedtJH~i-d&E=q1(w~7*U#P2c)#?B z7k(8SxZXVDxm@30@5Qs54Xi7aoBj>YuSt37BBv_xfbnwdEa`ns@p*ph{5k8=ZQ*W2 z2~xg!KYnMtS;kw|cx&0TpXa*gE5z>py=1%!Cp|zsqSQO;qdsRSV5px)b$Lcm zW-y+hiYV!>V;yiAxszz?HFx@Z(XY(idpdVtU5-C1|5C>N+4%K8?7HQz<+hww+iUu{ z@nRl-x#R0$7_?^!g*7i+->l|whYI!jRy3RpTFni|4s)j`r(O4yHC1z_imp>DO`f(V z&bY<#qFtPrE{#uGRrgHIJykjZnBQpn<9QnjLCf2+LZ=WmfNKj&?yWG2bfzd&(YUt$BFgp z9_?;)WpvfvUDTdme_7mG0C6)T zG6Q|7A2Es`K14qLAFXM3SN~5z+05KEE)42tr;IUi7{gHr@sBx3fR>(*JwMf{`|3F)?1*sf~LrBt+fY4*T-c2^L*DHII zrW{bDDiIMq_9sm&s9FR5SO&YSuNN12!G(U#MC=lr>`$TiZ1mb>LM3OSFH-bY*MNkk-N)vl~9%T~}-CMj>+F3o)tEklI!j4jVOzkLUQSeuUdg?MJA z(zMqp-@|w>*!e!oTZ#5)r5}msdQO8@JMjk9rU0UnykNZ7xL+>mk$82}Qjnc^Ta3p7 z&L>aG&-DG8Ej_btw~okfn}HS?=0cZvjmoM;A)WdC!FWTA_pnPmm7i}~op>>>PK5V! zmw3Ss{*n8=z<3Vl_v?vxR-=x21#->%-u0?d-n_w~O6)RTmW>5I*SAqWf6#ySigcQI z8exExhwsO8#w#-3>_ML>iw>~DOG-rjTys5z*jc~7881qD7x9SR9g`o`S>36DKIKQ@ zr;)W(xRD{0bk{Ktm_=?UI{Jv)?cM0#mUsRvKUSCHaZ$VX%Bq>(a(3Nrw%mr79WLbX z%YMER1b*vEKELb+D{GY;9!P$E>PqzkcMPa^hHFYk75fo~Ysfs~(LnGBM47;%QE!I% z6gD5}cUwQbF5;YOL3JQ}+AVcD64iuEw9F>d_DS7^&|}|5O7v&(U=GAaTBQ4XQoD#l z5T79z-qW7;_BbA(WTdxa*H1;yO%Z)GIESMU;$Pzw2}%Q5wDl!g0D5V=iZY45zF!jY vWpXl<##x@Dp!H;qCE*Xyz(l#=RC_wW21$)AU7Gz5e4pY( literal 0 HcmV?d00001 diff --git a/llvm/test/tools/dsymutil/X86/common-sym-multi.test b/llvm/test/tools/dsymutil/X86/common-sym-multi.test new file mode 100644 index 0000000000000..1f33b37283b42 --- /dev/null +++ b/llvm/test/tools/dsymutil/X86/common-sym-multi.test @@ -0,0 +1,39 @@ +RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/common/common.x86_64 -f -o - | llvm-dwarfdump -debug-info - | FileCheck %s +RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/common/common.x86_64 -dump-debug-map | FileCheck %s --check-prefix DEBUGMAP + +The test was compiled from two source files: +$ cd /private/tmp/common +$ cat common1.c +int i[1000]; +int main() { + return i[1]; +} +$ cat common2.c +extern int i[1000]; +int bar() { + return i[0]; +} +$ clang -fcommon -g -c common1.c -o common1.o +$ clang -fcommon -g -c common2.c -o common2.o +$ clang -fcommon -g common1.o common2.o -o common.x86_64 + +CHECK: DW_TAG_compile_unit +CHECK: DW_TAG_variable +CHECK-NOT: {{NULL|DW_TAG}} +CHECK: DW_AT_name{{.*}}"i" +CHECK-NOT: {{NULL|DW_TAG}} +CHECK: DW_AT_location{{.*}}DW_OP_addr 0x100001000) + +CHECK: DW_TAG_compile_unit +CHECK: DW_TAG_variable +CHECK-NOT: {{NULL|DW_TAG}} +CHECK: DW_AT_name{{.*}}"i" +CHECK-NOT: {{NULL|DW_TAG}} +CHECK: DW_AT_location{{.*}}DW_OP_addr 0x100001000) + +DEBUGMAP: filename:{{.*}}common1.o +DEBUGMAP: symbols: +DEBUGMAP: sym: _i, binAddr: 0x0000000100001000, size: 0x00000000 +DEBUGMAP: filename:{{.*}}common2.o +DEBUGMAP: symbols: +DEBUGMAP: sym: _i, binAddr: 0x0000000100001000, size: 0x00000000 diff --git a/llvm/tools/dsymutil/MachODebugMapParser.cpp b/llvm/tools/dsymutil/MachODebugMapParser.cpp index 27379c232decd..487fbfff50cfa 100644 --- a/llvm/tools/dsymutil/MachODebugMapParser.cpp +++ b/llvm/tools/dsymutil/MachODebugMapParser.cpp @@ -14,6 +14,7 @@ #include "llvm/Support/Path.h" #include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" +#include namespace { using namespace llvm; @@ -51,6 +52,8 @@ class MachODebugMapParser { StringRef MainBinaryStrings; /// The constructed DebugMap. std::unique_ptr Result; + /// List of common symbols that need to be added to the debug map. + std::vector CommonSymbols; /// Map of the currently processed object file symbol addresses. StringMap> CurrentObjectAddresses; @@ -81,6 +84,8 @@ class MachODebugMapParser { STE.n_value); } + void addCommonSymbols(); + /// Dump the symbol table output header. void dumpSymTabHeader(raw_ostream &OS, StringRef Arch); @@ -122,11 +127,32 @@ void MachODebugMapParser::resetParserState() { CurrentDebugMapObject = nullptr; } +/// Commons symbols won't show up in the symbol map but might need to be +/// relocated. We can add them to the symbol table ourselves by combining the +/// information in the object file (the symbol name) and the main binary (the +/// address). +void MachODebugMapParser::addCommonSymbols() { + for (auto &CommonSymbol : CommonSymbols) { + uint64_t CommonAddr = getMainBinarySymbolAddress(CommonSymbol); + if (CommonAddr == 0) { + // The main binary doesn't have an address for the given symbol. + continue; + } + if (!CurrentDebugMapObject->addSymbol(CommonSymbol, None /*ObjectAddress*/, + CommonAddr, 0 /*size*/)) { + // The symbol is already present. + continue; + } + } + CommonSymbols.clear(); +} + /// Create a new DebugMapObject. This function resets the state of the /// parser that was referring to the last object file and sets /// everything up to add symbols to the new one. void MachODebugMapParser::switchToNewDebugMapObject( StringRef Filename, sys::TimePoint Timestamp) { + addCommonSymbols(); resetParserState(); SmallString<80> Path(PathPrefix); @@ -466,10 +492,15 @@ void MachODebugMapParser::loadCurrentObjectFileSymbols( // relocations will use the symbol itself, and won't need an // object file address. The object file address field is optional // in the DebugMap, leave it unassigned for these symbols. - if (Sym.getFlags() & (SymbolRef::SF_Absolute | SymbolRef::SF_Common)) + uint32_t Flags = Sym.getFlags(); + if (Flags & SymbolRef::SF_Absolute) { CurrentObjectAddresses[*Name] = None; - else + } else if (Flags & SymbolRef::SF_Common) { + CurrentObjectAddresses[*Name] = None; + CommonSymbols.push_back(*Name); + } else { CurrentObjectAddresses[*Name] = Addr; + } } } From 6453f700f29a93ceb17ac43d6e8b802f9898fa6a Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Wed, 9 Oct 2019 16:19:39 +0000 Subject: [PATCH 11/44] [AIX][XCOFF][NFC] Change the SectionLen field name of CSect Auxiliary entry to SectionOrLength. Summary: According the the XCOFF document, If Then XTY_SD x_scnlen contains the csect length. XTY_LD x_scnlen contains the symbol table index of the containing csect. XTY_CM x_scnlen contains the csect length. XTY_ER x_scnlen contains 0. Change the SectionLen member name to SectionOrLength is more reasonable. Authored By: DiggerLin Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D68650 llvm-svn: 374179 --- llvm/D68650.diff | 34 ++++++++++++++++++++++ llvm/include/llvm/Object/XCOFFObjectFile.h | 7 ++++- llvm/tools/llvm-readobj/XCOFFDumper.cpp | 4 +-- 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 llvm/D68650.diff diff --git a/llvm/D68650.diff b/llvm/D68650.diff new file mode 100644 index 0000000000000..063f1b8ae90eb --- /dev/null +++ b/llvm/D68650.diff @@ -0,0 +1,34 @@ +Index: llvm/include/llvm/Object/XCOFFObjectFile.h +=================================================================== +--- llvm/include/llvm/Object/XCOFFObjectFile.h ++++ llvm/include/llvm/Object/XCOFFObjectFile.h +@@ -113,7 +113,12 @@ + }; + + struct XCOFFCsectAuxEnt32 { +- support::ubig32_t SectionLen; ++ support::ubig32_t ++ SectionOrLength; // If the symbol type is XTY_SD or XTY_CM, the csect ++ // length. ++ // If the symbol type is XTY_LD, the symbol table ++ // index of the containing csect. ++ // If the symbol type is XTY_ER, 0. + support::ubig32_t ParameterHashIndex; + support::ubig16_t TypeChkSectNum; + uint8_t SymbolAlignmentAndType; +Index: llvm/tools/llvm-readobj/XCOFFDumper.cpp +=================================================================== +--- llvm/tools/llvm-readobj/XCOFFDumper.cpp ++++ llvm/tools/llvm-readobj/XCOFFDumper.cpp +@@ -213,9 +213,9 @@ + W.printNumber("Index", + Obj.getSymbolIndex(reinterpret_cast(AuxEntPtr))); + if ((AuxEntPtr->SymbolAlignmentAndType & SymbolTypeMask) == XCOFF::XTY_LD) +- W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionLen); ++ W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionOrLength); + else +- W.printNumber("SectionLen", AuxEntPtr->SectionLen); ++ W.printNumber("SectionLen", AuxEntPtr->SectionOrLength); + W.printHex("ParameterHashIndex", AuxEntPtr->ParameterHashIndex); + W.printHex("TypeChkSectNum", AuxEntPtr->TypeChkSectNum); + // Print out symbol alignment and type. diff --git a/llvm/include/llvm/Object/XCOFFObjectFile.h b/llvm/include/llvm/Object/XCOFFObjectFile.h index 9942e0de82ff1..eb4b45f230c82 100644 --- a/llvm/include/llvm/Object/XCOFFObjectFile.h +++ b/llvm/include/llvm/Object/XCOFFObjectFile.h @@ -113,7 +113,12 @@ struct XCOFFStringTable { }; struct XCOFFCsectAuxEnt32 { - support::ubig32_t SectionLen; + support::ubig32_t + SectionOrLength; // If the symbol type is XTY_SD or XTY_CM, the csect + // length. + // If the symbol type is XTY_LD, the symbol table + // index of the containing csect. + // If the symbol type is XTY_ER, 0. support::ubig32_t ParameterHashIndex; support::ubig16_t TypeChkSectNum; uint8_t SymbolAlignmentAndType; diff --git a/llvm/tools/llvm-readobj/XCOFFDumper.cpp b/llvm/tools/llvm-readobj/XCOFFDumper.cpp index 4fabead59fc82..c48d7ed78e0c4 100644 --- a/llvm/tools/llvm-readobj/XCOFFDumper.cpp +++ b/llvm/tools/llvm-readobj/XCOFFDumper.cpp @@ -161,9 +161,9 @@ void XCOFFDumper::printCsectAuxEnt32(const XCOFFCsectAuxEnt32 *AuxEntPtr) { W.printNumber("Index", Obj.getSymbolIndex(reinterpret_cast(AuxEntPtr))); if ((AuxEntPtr->SymbolAlignmentAndType & SymbolTypeMask) == XCOFF::XTY_LD) - W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionLen); + W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionOrLength); else - W.printNumber("SectionLen", AuxEntPtr->SectionLen); + W.printNumber("SectionLen", AuxEntPtr->SectionOrLength); W.printHex("ParameterHashIndex", AuxEntPtr->ParameterHashIndex); W.printHex("TypeChkSectNum", AuxEntPtr->TypeChkSectNum); // Print out symbol alignment and type. From 939411c1aaa8830de2273849d5b8417788a25f67 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 9 Oct 2019 16:22:14 +0000 Subject: [PATCH 12/44] Remove the is_mangled flag from Mangled and Symbol Testing whether a name is mangled or not is extremely cheap and can be done by looking at the first two characters. Mangled knows how to do it. On the flip side, many call sites that currently pass in an is_mangled determination do not know how to correctly do it (for example, they leave out Swift mangling prefixes). This patch removes this entry point and just forced Mangled to determine the mangledness of a string itself. Differential Revision: https://reviews.llvm.org/D68674 llvm-svn: 374180 --- lldb/include/lldb/Core/Mangled.h | 20 ------------------- lldb/include/lldb/Symbol/Function.h | 2 +- lldb/include/lldb/Symbol/Symbol.h | 5 ++--- lldb/source/API/SBType.cpp | 2 +- lldb/source/Core/Mangled.cpp | 16 --------------- lldb/source/Expression/IRExecutionUnit.cpp | 4 ++-- .../ItaniumABI/ItaniumABILanguageRuntime.cpp | 2 +- .../Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 8 +------- .../Breakpad/SymbolFileBreakpad.cpp | 4 ++-- .../Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | 1 - lldb/source/Symbol/Function.cpp | 5 +++-- lldb/source/Symbol/Symbol.cpp | 9 ++++----- lldb/unittests/Core/MangledTest.cpp | 8 ++------ 13 files changed, 19 insertions(+), 67 deletions(-) diff --git a/lldb/include/lldb/Core/Mangled.h b/lldb/include/lldb/Core/Mangled.h index b60b0dd7c950f..63fa0f618dae3 100644 --- a/lldb/include/lldb/Core/Mangled.h +++ b/lldb/include/lldb/Core/Mangled.h @@ -51,20 +51,6 @@ class Mangled { /// Initialize with both mangled and demangled names empty. Mangled() = default; - /// Construct with name. - /// - /// Constructor with an optional string and a boolean indicating if it is - /// the mangled version. - /// - /// \param[in] name - /// The already const name to copy into this object. - /// - /// \param[in] is_mangled - /// If \b true then \a name is a mangled name, if \b false then - /// \a name is demangled. - Mangled(ConstString name, bool is_mangled); - Mangled(llvm::StringRef name, bool is_mangled); - /// Construct with name. /// /// Constructor with an optional string and auto-detect if \a name is @@ -76,12 +62,6 @@ class Mangled { explicit Mangled(llvm::StringRef name); - /// Destructor - /// - /// Releases its ref counts on the mangled and demangled strings that live - /// in the global string pool. - ~Mangled(); - /// Convert to pointer operator. /// /// This allows code to check a Mangled object to see if it contains a valid diff --git a/lldb/include/lldb/Symbol/Function.h b/lldb/include/lldb/Symbol/Function.h index ba4839e5c8e98..1b23a99373ca4 100644 --- a/lldb/include/lldb/Symbol/Function.h +++ b/lldb/include/lldb/Symbol/Function.h @@ -140,7 +140,7 @@ class InlineFunctionInfo : public FunctionInfo { /// \param[in] call_decl_ptr /// Optional calling location declaration information that /// describes from where this inlined function was called. - InlineFunctionInfo(const char *name, const char *mangled, + InlineFunctionInfo(const char *name, llvm::StringRef mangled, const Declaration *decl_ptr, const Declaration *call_decl_ptr); diff --git a/lldb/include/lldb/Symbol/Symbol.h b/lldb/include/lldb/Symbol/Symbol.h index 1cbc2f5492f4e..b7f179d1449ba 100644 --- a/lldb/include/lldb/Symbol/Symbol.h +++ b/lldb/include/lldb/Symbol/Symbol.h @@ -24,9 +24,8 @@ class Symbol : public SymbolContextScope { // drastically different meanings and sorting requirements. Symbol(); - Symbol(uint32_t symID, const char *name, bool name_is_mangled, - lldb::SymbolType type, bool external, bool is_debug, - bool is_trampoline, bool is_artificial, + Symbol(uint32_t symID, llvm::StringRef name, lldb::SymbolType type, + bool external, bool is_debug, bool is_trampoline, bool is_artificial, const lldb::SectionSP §ion_sp, lldb::addr_t value, lldb::addr_t size, bool size_is_valid, bool contains_linker_annotations, uint32_t flags); diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp index 5402128b3faeb..8efc701a79fb7 100644 --- a/lldb/source/API/SBType.cpp +++ b/lldb/source/API/SBType.cpp @@ -799,7 +799,7 @@ const char *SBTypeMemberFunction::GetDemangledName() { if (m_opaque_sp) { ConstString mangled_str = m_opaque_sp->GetMangledName(); if (mangled_str) { - Mangled mangled(mangled_str, true); + Mangled mangled(mangled_str); return mangled.GetDemangledName(mangled.GuessLanguage()).GetCString(); } } diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp index 1153d05331f29..4ad57881e1f35 100644 --- a/lldb/source/Core/Mangled.cpp +++ b/lldb/source/Core/Mangled.cpp @@ -125,19 +125,6 @@ get_demangled_name_without_arguments(ConstString mangled, #pragma mark Mangled -// Constructor with an optional string and a boolean indicating if it is the -// mangled version. -Mangled::Mangled(ConstString s, bool mangled) - : m_mangled(), m_demangled() { - if (s) - SetValue(s, mangled); -} - -Mangled::Mangled(llvm::StringRef name, bool is_mangled) { - if (!name.empty()) - SetValue(ConstString(name), is_mangled); -} - Mangled::Mangled(ConstString s) : m_mangled(), m_demangled() { if (s) SetValue(s); @@ -148,9 +135,6 @@ Mangled::Mangled(llvm::StringRef name) { SetValue(ConstString(name)); } -// Destructor -Mangled::~Mangled() {} - // Convert to pointer operator. This allows code to check any Mangled objects // to see if they contain anything valid using code such as: // diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp index cbcea13396b5e..bf5f1a6acc613 100644 --- a/lldb/source/Expression/IRExecutionUnit.cpp +++ b/lldb/source/Expression/IRExecutionUnit.cpp @@ -669,7 +669,7 @@ FindBestAlternateMangledName(ConstString demangled, std::vector param_matches; for (size_t i = 0; i < alternates.size(); i++) { ConstString alternate_mangled_name = alternates[i]; - Mangled mangled(alternate_mangled_name, true); + Mangled mangled(alternate_mangled_name); ConstString demangled = mangled.GetDemangledName(lang_type); CPlusPlusLanguage::MethodName alternate_cpp_name(demangled); @@ -717,7 +717,7 @@ void IRExecutionUnit::CollectCandidateCPlusPlusNames( ConstString name = C_spec.name; if (CPlusPlusLanguage::IsCPPMangledName(name.GetCString())) { - Mangled mangled(name, true); + Mangled mangled(name); ConstString demangled = mangled.GetDemangledName(lldb::eLanguageTypeC_plus_plus); diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp index 72aea1f2a5a4a..02e62a2632866 100644 --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -356,7 +356,7 @@ class CommandObjectMultiwordItaniumABI_Demangle : public CommandObjectParsed { if (name.startswith("__Z")) name = name.drop_front(); - Mangled mangled(name, true); + Mangled mangled(name); if (mangled.GuessLanguage() == lldb::eLanguageTypeC_plus_plus) { ConstString demangled( mangled.GetDisplayDemangledName(lldb::eLanguageTypeC_plus_plus)); diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index a52f774e4e19a..d773832a97571 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -2209,8 +2209,6 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id, bool is_global = symbol.getBinding() == STB_GLOBAL; uint32_t flags = symbol.st_other << 8 | symbol.st_info | additional_flags; - bool is_mangled = (symbol_name[0] == '_' && symbol_name[1] == 'Z'); - llvm::StringRef symbol_ref(symbol_name); // Symbol names may contain @VERSION suffixes. Find those and strip them @@ -2218,7 +2216,7 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id, size_t version_pos = symbol_ref.find('@'); bool has_suffix = version_pos != llvm::StringRef::npos; llvm::StringRef symbol_bare = symbol_ref.substr(0, version_pos); - Mangled mangled(ConstString(symbol_bare), is_mangled); + Mangled mangled(symbol_bare); // Now append the suffix back to mangled and unmangled names. Only do it if // the demangling was successful (string is not empty). @@ -2449,14 +2447,11 @@ static unsigned ParsePLTRelocations( break; const char *symbol_name = strtab_data.PeekCStr(symbol.st_name); - bool is_mangled = - symbol_name ? (symbol_name[0] == '_' && symbol_name[1] == 'Z') : false; uint64_t plt_index = plt_offset + i * plt_entsize; Symbol jump_symbol( i + start_id, // Symbol table index symbol_name, // symbol name. - is_mangled, // is the symbol name mangled? eSymbolTypeTrampoline, // Type of this symbol false, // Is this globally visible? false, // Is this symbol debug info? @@ -2899,7 +2894,6 @@ void ObjectFileELF::ParseUnwindSymbols(Symtab *symbol_table, Symbol eh_symbol( symbol_id, // Symbol table index. symbol_name, // Symbol name. - false, // Is the symbol name mangled? eSymbolTypeCode, // Type of this symbol. true, // Is this globally visible? false, // Is this symbol debug info? diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp index e665a3e9c0642..bed066f31e2fa 100644 --- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp +++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp @@ -340,8 +340,8 @@ void SymbolFileBreakpad::AddSymbols(Symtab &symtab) { return; } symbols.try_emplace( - address, /*symID*/ 0, Mangled(name, /*is_mangled*/ false), - eSymbolTypeCode, /*is_global*/ true, /*is_debug*/ false, + address, /*symID*/ 0, Mangled(name), eSymbolTypeCode, + /*is_global*/ true, /*is_debug*/ false, /*is_trampoline*/ false, /*is_artificial*/ false, AddressRange(section_sp, address - section_sp->GetFileAddress(), size.getValueOr(0)), diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp index 80eb1c7603077..5d74b2537e6c9 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -1422,7 +1422,6 @@ void SymbolFilePDB::AddSymbols(lldb_private::Symtab &symtab) { symtab.AddSymbol( Symbol(pub_symbol->getSymIndexId(), // symID pub_symbol->getName().c_str(), // name - true, // name_is_mangled pub_symbol->isCode() ? eSymbolTypeCode : eSymbolTypeData, // type true, // external false, // is_debug diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index be5ea258de5be..9c4f5bcd98202 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -59,10 +59,11 @@ size_t FunctionInfo::MemorySize() const { return m_name.MemorySize() + m_declaration.MemorySize(); } -InlineFunctionInfo::InlineFunctionInfo(const char *name, const char *mangled, +InlineFunctionInfo::InlineFunctionInfo(const char *name, + llvm::StringRef mangled, const Declaration *decl_ptr, const Declaration *call_decl_ptr) - : FunctionInfo(name, decl_ptr), m_mangled(ConstString(mangled), true), + : FunctionInfo(name, decl_ptr), m_mangled(mangled), m_call_decl(call_decl_ptr) {} InlineFunctionInfo::InlineFunctionInfo(ConstString name, diff --git a/lldb/source/Symbol/Symbol.cpp b/lldb/source/Symbol/Symbol.cpp index 589f69244a480..3f24143358138 100644 --- a/lldb/source/Symbol/Symbol.cpp +++ b/lldb/source/Symbol/Symbol.cpp @@ -31,9 +31,8 @@ Symbol::Symbol() m_is_weak(false), m_type(eSymbolTypeInvalid), m_mangled(), m_addr_range(), m_flags() {} -Symbol::Symbol(uint32_t symID, const char *name, bool name_is_mangled, - SymbolType type, bool external, bool is_debug, - bool is_trampoline, bool is_artificial, +Symbol::Symbol(uint32_t symID, llvm::StringRef name, SymbolType type, bool external, + bool is_debug, bool is_trampoline, bool is_artificial, const lldb::SectionSP §ion_sp, addr_t offset, addr_t size, bool size_is_valid, bool contains_linker_annotations, uint32_t flags) @@ -42,9 +41,9 @@ Symbol::Symbol(uint32_t symID, const char *name, bool name_is_mangled, m_is_debug(is_debug), m_is_external(external), m_size_is_sibling(false), m_size_is_synthesized(false), m_size_is_valid(size_is_valid || size > 0), m_demangled_is_synthesized(false), - m_contains_linker_annotations(contains_linker_annotations), + m_contains_linker_annotations(contains_linker_annotations), m_is_weak(false), m_type(type), - m_mangled(ConstString(name), name_is_mangled), + m_mangled(name), m_addr_range(section_sp, offset, size), m_flags(flags) {} Symbol::Symbol(uint32_t symID, const Mangled &mangled, SymbolType type, diff --git a/lldb/unittests/Core/MangledTest.cpp b/lldb/unittests/Core/MangledTest.cpp index 917df06f2abb9..9108d83a77edb 100644 --- a/lldb/unittests/Core/MangledTest.cpp +++ b/lldb/unittests/Core/MangledTest.cpp @@ -29,9 +29,7 @@ using namespace lldb_private; TEST(MangledTest, ResultForValidName) { ConstString MangledName("_ZN1a1b1cIiiiEEvm"); - bool IsMangled = true; - - Mangled TheMangled(MangledName, IsMangled); + Mangled TheMangled(MangledName); ConstString TheDemangled = TheMangled.GetDemangledName(eLanguageTypeC_plus_plus); @@ -41,9 +39,7 @@ TEST(MangledTest, ResultForValidName) { TEST(MangledTest, EmptyForInvalidName) { ConstString MangledName("_ZN1a1b1cmxktpEEvm"); - bool IsMangled = true; - - Mangled TheMangled(MangledName, IsMangled); + Mangled TheMangled(MangledName); ConstString TheDemangled = TheMangled.GetDemangledName(eLanguageTypeC_plus_plus); From 5448fac509ff7aee9b73c8fea05daad2032bf69b Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Wed, 9 Oct 2019 16:24:25 +0000 Subject: [PATCH 13/44] [NFC] Remove files got accidentally upload in llvm-svn 374179 llvm-svn: 374181 --- llvm/D68650.diff | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 llvm/D68650.diff diff --git a/llvm/D68650.diff b/llvm/D68650.diff deleted file mode 100644 index 063f1b8ae90eb..0000000000000 --- a/llvm/D68650.diff +++ /dev/null @@ -1,34 +0,0 @@ -Index: llvm/include/llvm/Object/XCOFFObjectFile.h -=================================================================== ---- llvm/include/llvm/Object/XCOFFObjectFile.h -+++ llvm/include/llvm/Object/XCOFFObjectFile.h -@@ -113,7 +113,12 @@ - }; - - struct XCOFFCsectAuxEnt32 { -- support::ubig32_t SectionLen; -+ support::ubig32_t -+ SectionOrLength; // If the symbol type is XTY_SD or XTY_CM, the csect -+ // length. -+ // If the symbol type is XTY_LD, the symbol table -+ // index of the containing csect. -+ // If the symbol type is XTY_ER, 0. - support::ubig32_t ParameterHashIndex; - support::ubig16_t TypeChkSectNum; - uint8_t SymbolAlignmentAndType; -Index: llvm/tools/llvm-readobj/XCOFFDumper.cpp -=================================================================== ---- llvm/tools/llvm-readobj/XCOFFDumper.cpp -+++ llvm/tools/llvm-readobj/XCOFFDumper.cpp -@@ -213,9 +213,9 @@ - W.printNumber("Index", - Obj.getSymbolIndex(reinterpret_cast(AuxEntPtr))); - if ((AuxEntPtr->SymbolAlignmentAndType & SymbolTypeMask) == XCOFF::XTY_LD) -- W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionLen); -+ W.printNumber("ContainingCsectSymbolIndex", AuxEntPtr->SectionOrLength); - else -- W.printNumber("SectionLen", AuxEntPtr->SectionLen); -+ W.printNumber("SectionLen", AuxEntPtr->SectionOrLength); - W.printHex("ParameterHashIndex", AuxEntPtr->ParameterHashIndex); - W.printHex("TypeChkSectNum", AuxEntPtr->TypeChkSectNum); - // Print out symbol alignment and type. From d037a5f06538f658f451c5dad106ec02f3cc56c2 Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Wed, 9 Oct 2019 16:31:50 +0000 Subject: [PATCH 14/44] [AArch64] Ensure no tagged memory is left in the unallocated portion of the stack This patch makes sure that if we tag some memory, we untag that memory before the function returns/throws via any exit, reachable from the tag operation. For that we place the untag operation either at: a) the lifetime end call for the alloca, if that call post-dominates the lifetime start call (where the tag operation is placed), or it (the lifetime end call) dominates all reachable exits, otherwise b) at the reachable exits Differential Revision: https://reviews.llvm.org/D68469 llvm-svn: 374182 --- .../Target/AArch64/AArch64StackTagging.cpp | 83 ++++++-- .../CodeGen/AArch64/stack-tagging-ex-1.ll | 69 +++++++ .../CodeGen/AArch64/stack-tagging-ex-2.ll | 183 ++++++++++++++++++ .../AArch64/stack-tagging-untag-placement.ll | 82 ++++++++ 4 files changed, 402 insertions(+), 15 deletions(-) create mode 100644 llvm/test/CodeGen/AArch64/stack-tagging-ex-1.ll create mode 100644 llvm/test/CodeGen/AArch64/stack-tagging-ex-2.ll create mode 100644 llvm/test/CodeGen/AArch64/stack-tagging-untag-placement.ll diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 0c52711a8d7e9..e6dbe01d3807a 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -19,6 +19,7 @@ #include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Analysis/CFG.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" @@ -491,6 +492,24 @@ void AArch64StackTagging::alignAndPadAlloca(AllocaInfo &Info) { Info.AI = NewAI; } +// Helper function to check for post-dominance. +static bool postDominates(const PostDominatorTree *PDT, const IntrinsicInst *A, + const IntrinsicInst *B) { + const BasicBlock *ABB = A->getParent(); + const BasicBlock *BBB = B->getParent(); + + if (ABB != BBB) + return PDT->dominates(ABB, BBB); + + for (const Instruction &I : *ABB) { + if (&I == B) + return true; + if (&I == A) + return false; + } + llvm_unreachable("Corrupt instruction list"); +} + // FIXME: check for MTE extension bool AArch64StackTagging::runOnFunction(Function &Fn) { if (!Fn.hasFnAttribute(Attribute::SanitizeMemTag)) @@ -565,23 +584,31 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) { if (NumInterestingAllocas == 0) return true; + std::unique_ptr DeleteDT; + DominatorTree *DT = nullptr; + if (auto *P = getAnalysisIfAvailable()) + DT = &P->getDomTree(); + + if (DT == nullptr && (NumInterestingAllocas > 1 || + !F->hasFnAttribute(Attribute::OptimizeNone))) { + DeleteDT = std::make_unique(*F); + DT = DeleteDT.get(); + } + + std::unique_ptr DeletePDT; + PostDominatorTree *PDT = nullptr; + if (auto *P = getAnalysisIfAvailable()) + PDT = &P->getPostDomTree(); + + if (PDT == nullptr && !F->hasFnAttribute(Attribute::OptimizeNone)) { + DeletePDT = std::make_unique(*F); + PDT = DeletePDT.get(); + } + SetTagFunc = Intrinsic::getDeclaration(F->getParent(), Intrinsic::aarch64_settag); - // Compute DT only if the function has the attribute, there are more than 1 - // interesting allocas, and it is not available for free. - Instruction *Base; - if (NumInterestingAllocas > 1) { - auto *DTWP = getAnalysisIfAvailable(); - if (DTWP) { - Base = insertBaseTaggedPointer(Allocas, &DTWP->getDomTree()); - } else { - DominatorTree DT(*F); - Base = insertBaseTaggedPointer(Allocas, &DT); - } - } else { - Base = insertBaseTaggedPointer(Allocas, nullptr); - } + Instruction *Base = insertBaseTaggedPointer(Allocas, DT); for (auto &I : Allocas) { const AllocaInfo &Info = I.second; @@ -604,11 +631,37 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) { if (UnrecognizedLifetimes.empty() && Info.LifetimeStart.size() == 1 && Info.LifetimeEnd.size() == 1) { IntrinsicInst *Start = Info.LifetimeStart[0]; + IntrinsicInst *End = Info.LifetimeEnd[0]; uint64_t Size = dyn_cast(Start->getArgOperand(0))->getZExtValue(); Size = alignTo(Size, kTagGranuleSize); tagAlloca(AI, Start->getNextNode(), Start->getArgOperand(1), Size); - untagAlloca(AI, Info.LifetimeEnd[0], Size); + // We need to ensure that if we tag some object, we certainly untag it + // before the function exits. + if (PDT != nullptr && postDominates(PDT, End, Start)) { + untagAlloca(AI, End, Size); + } else { + SmallVector ReachableRetVec; + unsigned NumCoveredExits = 0; + for (auto &RI : RetVec) { + if (!isPotentiallyReachable(Start, RI, nullptr, DT)) + continue; + ReachableRetVec.push_back(RI); + if (DT != nullptr && DT->dominates(End, RI)) + ++NumCoveredExits; + } + // If there's a mix of covered and non-covered exits, just put the untag + // on exits, so we avoid the redundancy of untagging twice. + if (NumCoveredExits == ReachableRetVec.size()) { + untagAlloca(AI, End, Size); + } else { + for (auto &RI : ReachableRetVec) + untagAlloca(AI, RI, Size); + // We may have inserted untag outside of the lifetime interval. + // Remove the lifetime end call for this alloca. + End->eraseFromParent(); + } + } } else { uint64_t Size = Info.AI->getAllocationSizeInBits(*DL).getValue() / 8; Value *Ptr = IRB.CreatePointerCast(TagPCall, IRB.getInt8PtrTy()); diff --git a/llvm/test/CodeGen/AArch64/stack-tagging-ex-1.ll b/llvm/test/CodeGen/AArch64/stack-tagging-ex-1.ll new file mode 100644 index 0000000000000..258586824530c --- /dev/null +++ b/llvm/test/CodeGen/AArch64/stack-tagging-ex-1.ll @@ -0,0 +1,69 @@ +; RUN: opt -S -stack-tagging %s -o - | FileCheck %s + +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" +target triple = "aarch64-arm-unknown-eabi" + +define void @f() local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +start: +; CHECK-LABEL: start: + %a = alloca i8, i32 48, align 8 + call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %a) #2 +; CHECK: call void @llvm.aarch64.settag(i8* %a.tag, i64 48) + %b = alloca i8, i32 48, align 8 + call void @llvm.lifetime.start.p0i8(i64 48, i8* nonnull %b) #2 +; CHECK: call void @llvm.aarch64.settag(i8* %b.tag, i64 48) + invoke void @g (i8 * nonnull %a, i8 * nonnull %b) to label %next0 unwind label %lpad0 +; CHECK-NOT: settag + +next0: +; CHECK-LABEL: next0: + call void @llvm.lifetime.end.p0i8(i64 40, i8* nonnull %a) + call void @llvm.lifetime.end.p0i8(i64 40, i8* nonnull %b) + br label %exit +; CHECK-NOT: settag + +lpad0: +; CHECK-LABEL: lpad0: + %pad0v = landingpad { i8*, i32 } catch i8* null + %v = extractvalue { i8*, i32 } %pad0v, 0 + %x = call i8* @__cxa_begin_catch(i8* %v) #2 + invoke void @__cxa_end_catch() to label %next1 unwind label %lpad1 +; CHECK-NOT: settag + +next1: +; CHECK-LABEL: next1: + br label %exit +; CHECK-NOT: settag + +lpad1: +; CHECK-LABEL: lpad1: +; CHECK-DAG: call void @llvm.aarch64.settag(i8* %a, i64 48) +; CHECK-DAG: call void @llvm.aarch64.settag(i8* %b, i64 48) + %pad1v = landingpad { i8*, i32 } cleanup + resume { i8*, i32 } %pad1v + +exit: +; CHECK-LABEL: exit: +; CHECK-DAG: call void @llvm.aarch64.settag(i8* %a, i64 48) +; CHECK-DAG: call void @llvm.aarch64.settag(i8* %b, i64 48) + ret void +; CHECK: ret void +} + +declare void @g(i8 *, i8 *) #0 + +declare dso_local i32 @__gxx_personality_v0(...) + +declare dso_local i8* @__cxa_begin_catch(i8*) local_unnamed_addr + +declare dso_local void @__cxa_end_catch() local_unnamed_addr + +; Function Attrs: argmemonly nounwind willreturn +declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1 + +; Function Attrs: argmemonly nounwind willreturn +declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1 + +attributes #0 = { sanitize_memtag "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mte,+neon,+v8.5a" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { argmemonly nounwind willreturn } +attributes #2 = { nounwind } diff --git a/llvm/test/CodeGen/AArch64/stack-tagging-ex-2.ll b/llvm/test/CodeGen/AArch64/stack-tagging-ex-2.ll new file mode 100644 index 0000000000000..820041e061a3c --- /dev/null +++ b/llvm/test/CodeGen/AArch64/stack-tagging-ex-2.ll @@ -0,0 +1,183 @@ +; clang -target aarch64-eabi -O2 -march=armv8.5-a+memtag -fsanitize=memtag -S -emit-llvm test.cc +; void bar() { +; throw 42; +; } + +; void foo() { +; int A0; +; __asm volatile("" : : "r"(&A0)); + +; try { +; bar(); +; } catch (int exc) { +; } + +; throw 15532; +; } + +; int main() { +; try { +; foo(); +; } catch (int exc) { +; } + +; return 0; +; } + +; RUN: opt -S -stack-tagging %s -o - | FileCheck %s + +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" +target triple = "aarch64-unknown-unknown-eabi" + +@_ZTIi = external dso_local constant i8* + +; Function Attrs: noreturn sanitize_memtag +define dso_local void @_Z3barv() local_unnamed_addr #0 { +entry: + %exception = tail call i8* @__cxa_allocate_exception(i64 4) #4 + %0 = bitcast i8* %exception to i32* + store i32 42, i32* %0, align 16, !tbaa !2 + tail call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #5 + unreachable +} + +declare dso_local i8* @__cxa_allocate_exception(i64) local_unnamed_addr + +declare dso_local void @__cxa_throw(i8*, i8*, i8*) local_unnamed_addr + +; Function Attrs: noreturn sanitize_memtag +define dso_local void @_Z3foov() local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +entry: + %A0 = alloca i32, align 4 + %0 = bitcast i32* %A0 to i8* + call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0) #4 + call void asm sideeffect "", "r"(i32* nonnull %A0) #4, !srcloc !6 + invoke void @_Z3barv() + to label %try.cont unwind label %lpad + +lpad: ; preds = %entry + %1 = landingpad { i8*, i32 } + cleanup + catch i8* bitcast (i8** @_ZTIi to i8*) + %2 = extractvalue { i8*, i32 } %1, 1 + %3 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #4 + %matches = icmp eq i32 %2, %3 + br i1 %matches, label %catch, label %ehcleanup + +catch: ; preds = %lpad + %4 = extractvalue { i8*, i32 } %1, 0 + %5 = call i8* @__cxa_begin_catch(i8* %4) #4 + call void @__cxa_end_catch() #4 + br label %try.cont + +try.cont: ; preds = %entry, %catch + %exception = call i8* @__cxa_allocate_exception(i64 4) #4 + %6 = bitcast i8* %exception to i32* + store i32 15532, i32* %6, align 16, !tbaa !2 + call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #5 + unreachable + +ehcleanup: ; preds = %lpad + call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %0) #4 + resume { i8*, i32 } %1 +} + +; Function Attrs: argmemonly nounwind willreturn +declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1 + +declare dso_local i32 @__gxx_personality_v0(...) + +; Function Attrs: nounwind readnone +declare i32 @llvm.eh.typeid.for(i8*) #2 + +declare dso_local i8* @__cxa_begin_catch(i8*) local_unnamed_addr + +declare dso_local void @__cxa_end_catch() local_unnamed_addr + +; Function Attrs: argmemonly nounwind willreturn +declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1 + +; Function Attrs: norecurse sanitize_memtag +define dso_local i32 @main() local_unnamed_addr #3 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { +entry: +; CHECK-LABEL: entry: + %A0.i = alloca i32, align 4 + %0 = bitcast i32* %A0.i to i8* + call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0) #4 + call void asm sideeffect "", "r"(i32* nonnull %A0.i) #4, !srcloc !6 +; CHECK: call void @llvm.aarch64.settag(i8* %1, i64 16) +; CHECK-NEXT: call void asm sideeffect + %exception.i6 = call i8* @__cxa_allocate_exception(i64 4) #4 + %1 = bitcast i8* %exception.i6 to i32* + store i32 42, i32* %1, align 16, !tbaa !2 + invoke void @__cxa_throw(i8* %exception.i6, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #5 + to label %.noexc7 unwind label %lpad.i + +.noexc7: ; preds = %entry + unreachable + +lpad.i: ; preds = %entry + %2 = landingpad { i8*, i32 } + cleanup + catch i8* bitcast (i8** @_ZTIi to i8*) + %3 = extractvalue { i8*, i32 } %2, 1 + %4 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #4 + %matches.i = icmp eq i32 %3, %4 + br i1 %matches.i, label %catch.i, label %ehcleanup.i + +catch.i: ; preds = %lpad.i + %5 = extractvalue { i8*, i32 } %2, 0 + %6 = call i8* @__cxa_begin_catch(i8* %5) #4 + call void @__cxa_end_catch() #4 + %exception.i = call i8* @__cxa_allocate_exception(i64 4) #4 + %7 = bitcast i8* %exception.i to i32* + store i32 15532, i32* %7, align 16, !tbaa !2 + invoke void @__cxa_throw(i8* %exception.i, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #5 + to label %.noexc unwind label %lpad + +.noexc: ; preds = %catch.i + unreachable + +ehcleanup.i: ; preds = %lpad.i + call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %0) #4 + br label %lpad.body + +lpad: ; preds = %catch.i + %8 = landingpad { i8*, i32 } + catch i8* bitcast (i8** @_ZTIi to i8*) + %.pre = extractvalue { i8*, i32 } %8, 1 + br label %lpad.body + +lpad.body: ; preds = %ehcleanup.i, %lpad + %.pre-phi = phi i32 [ %3, %ehcleanup.i ], [ %.pre, %lpad ] + %eh.lpad-body = phi { i8*, i32 } [ %2, %ehcleanup.i ], [ %8, %lpad ] + %matches = icmp eq i32 %.pre-phi, %4 + br i1 %matches, label %catch, label %eh.resume + +catch: ; preds = %lpad.body + %9 = extractvalue { i8*, i32 } %eh.lpad-body, 0 + %10 = call i8* @__cxa_begin_catch(i8* %9) #4 + call void @__cxa_end_catch() #4 + ret i32 0 + +eh.resume: ; preds = %lpad.body + resume { i8*, i32 } %eh.lpad-body +} + +attributes #0 = { noreturn sanitize_memtag "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mte,+neon,+v8.5a" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { argmemonly nounwind willreturn } +attributes #2 = { nounwind readnone } +attributes #3 = { norecurse sanitize_memtag "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mte,+neon,+v8.5a" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #4 = { nounwind } +attributes #5 = { noreturn } + +!llvm.module.flags = !{!0} +!llvm.ident = !{!1} + +!0 = !{i32 1, !"wchar_size", i32 4} +!1 = !{!"clang version 10.0.0 (https://github.com/llvm/llvm-project.git c38188c5fe41751fda095edde1a878b2a051ae58)"} +!2 = !{!3, !3, i64 0} +!3 = !{!"int", !4, i64 0} +!4 = !{!"omnipotent char", !5, i64 0} +!5 = !{!"Simple C++ TBAA"} +!6 = !{i32 70} diff --git a/llvm/test/CodeGen/AArch64/stack-tagging-untag-placement.ll b/llvm/test/CodeGen/AArch64/stack-tagging-untag-placement.ll new file mode 100644 index 0000000000000..3c0dc3df98dbd --- /dev/null +++ b/llvm/test/CodeGen/AArch64/stack-tagging-untag-placement.ll @@ -0,0 +1,82 @@ +;; RUN: opt -S -stack-tagging %s -o - | FileCheck %s +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" +target triple = "aarch64-arm-unknown-eabi" + +define void @f() local_unnamed_addr #0 { +S0: +; CHECK-LABEL: S0: +; CHECK: %basetag = call i8* @llvm.aarch64.irg.sp(i64 0) + %v = alloca i8, i32 48, align 8 +; CHECK: %v.tag = call i8* @llvm.aarch64.tagp.p0i8(i8* %v, i8* %basetag, i64 0) + %w = alloca i8, i32 48, align 16 +; CHECK: %w.tag = call i8* @llvm.aarch64.tagp.p0i8(i8* %w, i8* %basetag, i64 1) + + %t0 = call i32 @g0() #1 + %b0 = icmp eq i32 %t0, 0 + br i1 %b0, label %S1, label %exit3 + +S1: +; CHECK-LABEL: S1: + call void @llvm.lifetime.start.p0i8(i64 48, i8 * nonnull %v) #1 +; CHECK: call void @llvm.aarch64.settag(i8* %v.tag, i64 48) + call void @llvm.lifetime.start.p0i8(i64 48, i8 * nonnull %w) #1 +; CHECK: call void @llvm.aarch64.settag(i8* %w.tag, i64 48) + %t1 = call i32 @g1(i8 * nonnull %v, i8 * nonnull %w) #1 +; CHECK: call i32 @g1 +; CHECK-NOT: settag{{.*}}%v +; CHECK: call void @llvm.aarch64.settag(i8* %w, i64 48) +; CHECK-NOT: settag{{.*}}%v + call void @llvm.lifetime.end.p0i8(i64 48, i8 * nonnull %w) #1 +; CHECK: call void @llvm.lifetime.end.p0i8(i64 48, i8* nonnull %w.tag) + %b1 = icmp eq i32 %t1, 0 + br i1 %b1, label %S2, label %S3 +; CHECK-NOT: settag + +S2: +; CHECK-LABEL: S2: + call void @z0() #1 + br label %exit1 +; CHECK-NOT: settag + +S3: +; CHECK-LABEL: S3: + call void @llvm.lifetime.end.p0i8(i64 48, i8 * nonnull %v) #1 + tail call void @z1() #1 + br label %exit2 +; CHECK-NOT: settag + +exit1: +; CHECK-LABEL: exit1: +; CHECK: call void @llvm.aarch64.settag(i8* %v, i64 48) + ret void + +exit2: +; CHECK-LABEL: exit2: +; CHECK: call void @llvm.aarch64.settag(i8* %v, i64 48) + ret void + +exit3: +; CHECK-LABEL: exit3: + call void @z2() #1 +; CHECK-NOT: settag + ret void +; CHECK: ret void +} + +declare i32 @g0() #0 + +declare i32 @g1(i8 *, i8 *) #0 + +declare void @z0() #0 + +declare void @z1() #0 + +declare void @z2() #0 + +declare void @llvm.lifetime.start.p0i8(i64 immarg, i8 * nocapture) #1 + +declare void @llvm.lifetime.end.p0i8(i64 immarg, i8 * nocapture) #1 + +attributes #0 = { sanitize_memtag "correctly-rounded-divide-sqrt-fp-math"="false" "denormal-fp-math"="preserve-sign" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+mte,+neon,+v8.5a" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind } + From df14bd315db94d286c0c75b4b6ee5d760f311399 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 9 Oct 2019 16:32:49 +0000 Subject: [PATCH 15/44] [SLP] respect target register width for GEP vectorization (PR43578) We failed to account for the target register width (max vector factor) when vectorizing starting from GEPs. This causes vectorization to proceed to obviously illegal widths as in: https://bugs.llvm.org/show_bug.cgi?id=43578 For x86, this also means that SLP can produce rogue AVX or AVX512 code even when the user specifies a narrower vector width. The AArch64 test in ext-trunc.ll appears to be better using the narrower width. I'm not exactly sure what getelementptr.ll is trying to do, but it's testing with "-slp-threshold=-18", so I'm not worried about those diffs. The x86 test is an over-reduction from SPEC h264; this patch appears to restore the perf loss caused by SLP when using -march=haswell. Differential Revision: https://reviews.llvm.org/D68667 llvm-svn: 374183 --- .../Transforms/Vectorize/SLPVectorizer.cpp | 14 +++-- .../SLPVectorizer/AArch64/ext-trunc.ll | 30 +++++----- .../SLPVectorizer/AArch64/getelementptr.ll | 57 +++++++++---------- .../SLPVectorizer/X86/load-merge.ll | 31 +++++----- 4 files changed, 70 insertions(+), 62 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 99428c6c5dee3..75b4718392de8 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -6981,10 +6981,16 @@ bool SLPVectorizerPass::vectorizeGEPIndices(BasicBlock *BB, BoUpSLP &R) { LLVM_DEBUG(dbgs() << "SLP: Analyzing a getelementptr list of length " << Entry.second.size() << ".\n"); - // We process the getelementptr list in chunks of 16 (like we do for - // stores) to minimize compile-time. - for (unsigned BI = 0, BE = Entry.second.size(); BI < BE; BI += 16) { - auto Len = std::min(BE - BI, 16); + // Process the GEP list in chunks suitable for the target's supported + // vector size. If a vector register can't hold 1 element, we are done. + unsigned MaxVecRegSize = R.getMaxVecRegSize(); + unsigned EltSize = R.getVectorElementSize(Entry.second[0]); + if (MaxVecRegSize < EltSize) + continue; + + unsigned MaxElts = MaxVecRegSize / EltSize; + for (unsigned BI = 0, BE = Entry.second.size(); BI < BE; BI += MaxElts) { + auto Len = std::min(BE - BI, MaxElts); auto GEPList = makeArrayRef(&Entry.second[BI], Len); // Initialize a set a candidate getelementptrs. Note that we use a diff --git a/llvm/test/Transforms/SLPVectorizer/AArch64/ext-trunc.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/ext-trunc.ll index 8e36a921c758b..58da29925f2d7 100644 --- a/llvm/test/Transforms/SLPVectorizer/AArch64/ext-trunc.ll +++ b/llvm/test/Transforms/SLPVectorizer/AArch64/ext-trunc.ll @@ -61,23 +61,25 @@ define void @test2(<4 x i16> %a, <4 x i16> %b, i64 %c0, i64 %c1, i64 %c2, i64 %c ; CHECK-NEXT: [[Z0:%.*]] = zext <4 x i16> [[A:%.*]] to <4 x i32> ; CHECK-NEXT: [[Z1:%.*]] = zext <4 x i16> [[B:%.*]] to <4 x i32> ; CHECK-NEXT: [[SUB0:%.*]] = sub <4 x i32> [[Z0]], [[Z1]] -; CHECK-NEXT: [[TMP0:%.*]] = sext <4 x i32> [[SUB0]] to <4 x i64> -; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x i64> undef, i64 [[C0:%.*]], i32 0 -; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x i64> [[TMP1]], i64 [[C1:%.*]], i32 1 -; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x i64> [[TMP2]], i64 [[C2:%.*]], i32 2 -; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i64> [[TMP3]], i64 [[C3:%.*]], i32 3 -; CHECK-NEXT: [[TMP5:%.*]] = add <4 x i64> [[TMP0]], [[TMP4]] -; CHECK-NEXT: [[TMP6:%.*]] = extractelement <4 x i64> [[TMP5]], i32 0 -; CHECK-NEXT: [[GEP0:%.*]] = getelementptr inbounds i64, i64* [[P:%.*]], i64 [[TMP6]] +; CHECK-NEXT: [[E0:%.*]] = extractelement <4 x i32> [[SUB0]], i32 0 +; CHECK-NEXT: [[S0:%.*]] = sext i32 [[E0]] to i64 +; CHECK-NEXT: [[A0:%.*]] = add i64 [[S0]], [[C0:%.*]] +; CHECK-NEXT: [[GEP0:%.*]] = getelementptr inbounds i64, i64* [[P:%.*]], i64 [[A0]] ; CHECK-NEXT: [[LOAD0:%.*]] = load i64, i64* [[GEP0]] -; CHECK-NEXT: [[TMP7:%.*]] = extractelement <4 x i64> [[TMP5]], i32 1 -; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 [[TMP7]] +; CHECK-NEXT: [[E1:%.*]] = extractelement <4 x i32> [[SUB0]], i32 1 +; CHECK-NEXT: [[S1:%.*]] = sext i32 [[E1]] to i64 +; CHECK-NEXT: [[A1:%.*]] = add i64 [[S1]], [[C1:%.*]] +; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 [[A1]] ; CHECK-NEXT: [[LOAD1:%.*]] = load i64, i64* [[GEP1]] -; CHECK-NEXT: [[TMP8:%.*]] = extractelement <4 x i64> [[TMP5]], i32 2 -; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 [[TMP8]] +; CHECK-NEXT: [[E2:%.*]] = extractelement <4 x i32> [[SUB0]], i32 2 +; CHECK-NEXT: [[S2:%.*]] = sext i32 [[E2]] to i64 +; CHECK-NEXT: [[A2:%.*]] = add i64 [[S2]], [[C2:%.*]] +; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 [[A2]] ; CHECK-NEXT: [[LOAD2:%.*]] = load i64, i64* [[GEP2]] -; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x i64> [[TMP5]], i32 3 -; CHECK-NEXT: [[GEP3:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 [[TMP9]] +; CHECK-NEXT: [[E3:%.*]] = extractelement <4 x i32> [[SUB0]], i32 3 +; CHECK-NEXT: [[S3:%.*]] = sext i32 [[E3]] to i64 +; CHECK-NEXT: [[A3:%.*]] = add i64 [[S3]], [[C3:%.*]] +; CHECK-NEXT: [[GEP3:%.*]] = getelementptr inbounds i64, i64* [[P]], i64 [[A3]] ; CHECK-NEXT: [[LOAD3:%.*]] = load i64, i64* [[GEP3]] ; CHECK-NEXT: call void @foo(i64 [[LOAD0]], i64 [[LOAD1]], i64 [[LOAD2]], i64 [[LOAD3]]) ; CHECK-NEXT: ret void diff --git a/llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll index d3bbf3df85827..8278d060756f7 100644 --- a/llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll +++ b/llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll @@ -23,10 +23,7 @@ target triple = "aarch64--linux-gnu" ; } ; -; YAML: --- !Passed -; YAML-NEXT: Pass: slp-vectorizer -; YAML-NEXT: Name: VectorizedList -; YAML-NEXT: Function: getelementptr_4x32 +; YAML-LABEL: Function: getelementptr_4x32 ; YAML-NEXT: Args: ; YAML-NEXT: - String: 'SLP vectorized with cost ' ; YAML-NEXT: - Cost: '11' @@ -39,7 +36,7 @@ target triple = "aarch64--linux-gnu" ; YAML-NEXT: Function: getelementptr_4x32 ; YAML-NEXT: Args: ; YAML-NEXT: - String: 'SLP vectorized with cost ' -; YAML-NEXT: - Cost: '16' +; YAML-NEXT: - Cost: '6' ; YAML-NEXT: - String: ' and with tree size ' ; YAML-NEXT: - TreeSize: '3' @@ -49,49 +46,50 @@ define i32 @getelementptr_4x32(i32* nocapture readonly %g, i32 %n, i32 %x, i32 % ; CHECK-NEXT: [[CMP31:%.*]] = icmp sgt i32 [[N:%.*]], 0 ; CHECK-NEXT: br i1 [[CMP31]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]] ; CHECK: for.body.preheader: -; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> , i32 [[X:%.*]], i32 1 -; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> [[TMP0]], i32 [[Y:%.*]], i32 2 -; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x i32> [[TMP1]], i32 [[Z:%.*]], i32 3 +; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> , i32 [[X:%.*]], i32 1 +; CHECK-NEXT: [[TMP1:%.*]] = insertelement <2 x i32> undef, i32 [[Y:%.*]], i32 0 +; CHECK-NEXT: [[TMP2:%.*]] = insertelement <2 x i32> [[TMP1]], i32 [[Z:%.*]], i32 1 ; CHECK-NEXT: br label [[FOR_BODY:%.*]] ; CHECK: for.cond.cleanup.loopexit: -; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x i32> [[TMP21:%.*]], i32 1 +; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x i32> [[TMP22:%.*]], i32 1 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP]] ; CHECK: for.cond.cleanup: ; CHECK-NEXT: [[SUM_0_LCSSA:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP3]], [[FOR_COND_CLEANUP_LOOPEXIT:%.*]] ] ; CHECK-NEXT: ret i32 [[SUM_0_LCSSA]] ; CHECK: for.body: -; CHECK-NEXT: [[TMP4:%.*]] = phi <2 x i32> [ zeroinitializer, [[FOR_BODY_PREHEADER]] ], [ [[TMP21]], [[FOR_BODY]] ] +; CHECK-NEXT: [[TMP4:%.*]] = phi <2 x i32> [ zeroinitializer, [[FOR_BODY_PREHEADER]] ], [ [[TMP22]], [[FOR_BODY]] ] ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x i32> [[TMP4]], i32 0 ; CHECK-NEXT: [[T4:%.*]] = shl nsw i32 [[TMP5]], 1 -; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x i32> undef, i32 [[T4]], i32 0 -; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <4 x i32> [[TMP6]], <4 x i32> undef, <4 x i32> zeroinitializer -; CHECK-NEXT: [[TMP8:%.*]] = add nsw <4 x i32> [[TMP7]], [[TMP2]] -; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x i32> [[TMP8]], i32 0 +; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> undef, i32 [[T4]], i32 0 +; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <2 x i32> [[TMP6]], <2 x i32> undef, <2 x i32> zeroinitializer +; CHECK-NEXT: [[TMP8:%.*]] = add nsw <2 x i32> [[TMP7]], [[TMP0]] +; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x i32> [[TMP8]], i32 0 ; CHECK-NEXT: [[TMP10:%.*]] = sext i32 [[TMP9]] to i64 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[G:%.*]], i64 [[TMP10]] ; CHECK-NEXT: [[T6:%.*]] = load i32, i32* [[ARRAYIDX]], align 4 ; CHECK-NEXT: [[TMP11:%.*]] = extractelement <2 x i32> [[TMP4]], i32 1 ; CHECK-NEXT: [[ADD1:%.*]] = add nsw i32 [[T6]], [[TMP11]] -; CHECK-NEXT: [[TMP12:%.*]] = extractelement <4 x i32> [[TMP8]], i32 1 +; CHECK-NEXT: [[TMP12:%.*]] = extractelement <2 x i32> [[TMP8]], i32 1 ; CHECK-NEXT: [[TMP13:%.*]] = sext i32 [[TMP12]] to i64 ; CHECK-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds i32, i32* [[G]], i64 [[TMP13]] ; CHECK-NEXT: [[T8:%.*]] = load i32, i32* [[ARRAYIDX5]], align 4 ; CHECK-NEXT: [[ADD6:%.*]] = add nsw i32 [[ADD1]], [[T8]] -; CHECK-NEXT: [[TMP14:%.*]] = extractelement <4 x i32> [[TMP8]], i32 2 -; CHECK-NEXT: [[TMP15:%.*]] = sext i32 [[TMP14]] to i64 -; CHECK-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i32, i32* [[G]], i64 [[TMP15]] +; CHECK-NEXT: [[TMP14:%.*]] = add nsw <2 x i32> [[TMP7]], [[TMP2]] +; CHECK-NEXT: [[TMP15:%.*]] = extractelement <2 x i32> [[TMP14]], i32 0 +; CHECK-NEXT: [[TMP16:%.*]] = sext i32 [[TMP15]] to i64 +; CHECK-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i32, i32* [[G]], i64 [[TMP16]] ; CHECK-NEXT: [[T10:%.*]] = load i32, i32* [[ARRAYIDX10]], align 4 ; CHECK-NEXT: [[ADD11:%.*]] = add nsw i32 [[ADD6]], [[T10]] -; CHECK-NEXT: [[TMP16:%.*]] = extractelement <4 x i32> [[TMP8]], i32 3 -; CHECK-NEXT: [[TMP17:%.*]] = sext i32 [[TMP16]] to i64 -; CHECK-NEXT: [[ARRAYIDX15:%.*]] = getelementptr inbounds i32, i32* [[G]], i64 [[TMP17]] +; CHECK-NEXT: [[TMP17:%.*]] = extractelement <2 x i32> [[TMP14]], i32 1 +; CHECK-NEXT: [[TMP18:%.*]] = sext i32 [[TMP17]] to i64 +; CHECK-NEXT: [[ARRAYIDX15:%.*]] = getelementptr inbounds i32, i32* [[G]], i64 [[TMP18]] ; CHECK-NEXT: [[T12:%.*]] = load i32, i32* [[ARRAYIDX15]], align 4 -; CHECK-NEXT: [[TMP18:%.*]] = insertelement <2 x i32> undef, i32 [[TMP5]], i32 0 -; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x i32> [[TMP18]], i32 [[ADD11]], i32 1 -; CHECK-NEXT: [[TMP20:%.*]] = insertelement <2 x i32> , i32 [[T12]], i32 1 -; CHECK-NEXT: [[TMP21]] = add nsw <2 x i32> [[TMP19]], [[TMP20]] -; CHECK-NEXT: [[TMP22:%.*]] = extractelement <2 x i32> [[TMP21]], i32 0 -; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP22]], [[N]] +; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x i32> undef, i32 [[TMP5]], i32 0 +; CHECK-NEXT: [[TMP20:%.*]] = insertelement <2 x i32> [[TMP19]], i32 [[ADD11]], i32 1 +; CHECK-NEXT: [[TMP21:%.*]] = insertelement <2 x i32> , i32 [[T12]], i32 1 +; CHECK-NEXT: [[TMP22]] = add nsw <2 x i32> [[TMP20]], [[TMP21]] +; CHECK-NEXT: [[TMP23:%.*]] = extractelement <2 x i32> [[TMP22]], i32 0 +; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[TMP23]], [[N]] ; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_COND_CLEANUP_LOOPEXIT]], label [[FOR_BODY]] ; entry: @@ -133,10 +131,7 @@ for.body: br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body } -; YAML: --- !Passed -; YAML-NEXT: Pass: slp-vectorizer -; YAML-NEXT: Name: VectorizedList -; YAML-NEXT: Function: getelementptr_2x32 +; YAML-LABEL: Function: getelementptr_2x32 ; YAML-NEXT: Args: ; YAML-NEXT: - String: 'SLP vectorized with cost ' ; YAML-NEXT: - Cost: '11' diff --git a/llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll b/llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll index f52afaf2fd733..50eeead886fea 100644 --- a/llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll @@ -153,19 +153,24 @@ define void @PR43578_prefer128(i32* %r, i64* %p, i64* %q) #0 { ; CHECK-NEXT: [[Q1:%.*]] = getelementptr inbounds i64, i64* [[Q]], i64 1 ; CHECK-NEXT: [[Q2:%.*]] = getelementptr inbounds i64, i64* [[Q]], i64 2 ; CHECK-NEXT: [[Q3:%.*]] = getelementptr inbounds i64, i64* [[Q]], i64 3 -; CHECK-NEXT: [[TMP1:%.*]] = bitcast i64* [[P0]] to <4 x i64>* -; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i64>, <4 x i64>* [[TMP1]], align 2 -; CHECK-NEXT: [[TMP3:%.*]] = bitcast i64* [[Q0]] to <4 x i64>* -; CHECK-NEXT: [[TMP4:%.*]] = load <4 x i64>, <4 x i64>* [[TMP3]], align 2 -; CHECK-NEXT: [[TMP5:%.*]] = sub nsw <4 x i64> [[TMP2]], [[TMP4]] -; CHECK-NEXT: [[TMP6:%.*]] = extractelement <4 x i64> [[TMP5]], i32 0 -; CHECK-NEXT: [[G0:%.*]] = getelementptr inbounds i32, i32* [[R:%.*]], i64 [[TMP6]] -; CHECK-NEXT: [[TMP7:%.*]] = extractelement <4 x i64> [[TMP5]], i32 1 -; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds i32, i32* [[R]], i64 [[TMP7]] -; CHECK-NEXT: [[TMP8:%.*]] = extractelement <4 x i64> [[TMP5]], i32 2 -; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds i32, i32* [[R]], i64 [[TMP8]] -; CHECK-NEXT: [[TMP9:%.*]] = extractelement <4 x i64> [[TMP5]], i32 3 -; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds i32, i32* [[R]], i64 [[TMP9]] +; CHECK-NEXT: [[TMP1:%.*]] = bitcast i64* [[P0]] to <2 x i64>* +; CHECK-NEXT: [[TMP2:%.*]] = load <2 x i64>, <2 x i64>* [[TMP1]], align 2 +; CHECK-NEXT: [[TMP3:%.*]] = bitcast i64* [[P2]] to <2 x i64>* +; CHECK-NEXT: [[TMP4:%.*]] = load <2 x i64>, <2 x i64>* [[TMP3]], align 2 +; CHECK-NEXT: [[TMP5:%.*]] = bitcast i64* [[Q0]] to <2 x i64>* +; CHECK-NEXT: [[TMP6:%.*]] = load <2 x i64>, <2 x i64>* [[TMP5]], align 2 +; CHECK-NEXT: [[TMP7:%.*]] = bitcast i64* [[Q2]] to <2 x i64>* +; CHECK-NEXT: [[TMP8:%.*]] = load <2 x i64>, <2 x i64>* [[TMP7]], align 2 +; CHECK-NEXT: [[TMP9:%.*]] = sub nsw <2 x i64> [[TMP2]], [[TMP6]] +; CHECK-NEXT: [[TMP10:%.*]] = sub nsw <2 x i64> [[TMP4]], [[TMP8]] +; CHECK-NEXT: [[TMP11:%.*]] = extractelement <2 x i64> [[TMP9]], i32 0 +; CHECK-NEXT: [[G0:%.*]] = getelementptr inbounds i32, i32* [[R:%.*]], i64 [[TMP11]] +; CHECK-NEXT: [[TMP12:%.*]] = extractelement <2 x i64> [[TMP9]], i32 1 +; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds i32, i32* [[R]], i64 [[TMP12]] +; CHECK-NEXT: [[TMP13:%.*]] = extractelement <2 x i64> [[TMP10]], i32 0 +; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds i32, i32* [[R]], i64 [[TMP13]] +; CHECK-NEXT: [[TMP14:%.*]] = extractelement <2 x i64> [[TMP10]], i32 1 +; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds i32, i32* [[R]], i64 [[TMP14]] ; CHECK-NEXT: ret void ; %p0 = getelementptr inbounds i64, i64* %p, i64 0 From 22314179f0660c172514b397060fd8f34b586e82 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 9 Oct 2019 16:38:47 +0000 Subject: [PATCH 16/44] [test] Split LLDB tests into API, Shell & Unit LLDB has three major testing strategies: unit tests, tests that exercise the SB API though dotest.py and what we currently call lit tests. The later is rather confusing as we're now using lit as the driver for all three types of tests. As most of this grew organically, the directory structure in the LLDB repository doesn't really make this clear. The 'lit' tests are part of the root and among these tests there's a Unit and Suite folder for the unit and dotest-tests. This layout makes it impossible to run just the lit tests. This patch changes the directory layout to match the 3 testing strategies, each with their own directory and their own configuration file. This means there are now 3 directories under lit with 3 corresponding targets: - API (check-lldb-api): Test exercising the SB API. - Shell (check-lldb-shell): Test exercising command line utilities. - Unit (check-lldb-unit): Unit tests. Finally, there's still the `check-lldb` target that runs all three test suites. Finally, this also renames the lit folder to `test` to match the LLVM repository layout. Differential revision: https://reviews.llvm.org/D68606 llvm-svn: 374184 --- lldb/CMakeLists.txt | 1 - lldb/lit/CMakeLists.txt | 115 --------- lldb/test/API/CMakeLists.txt | 149 +++++++++++ lldb/test/API/README.md | 4 + lldb/test/{ => API}/dotest.py | 0 lldb/{lit/Suite => test/API}/lit.cfg | 4 +- lldb/{lit/Suite => test/API}/lit.site.cfg.in | 4 +- lldb/{lit/Suite => test/API}/lldbtest.py | 0 lldb/test/{ => API}/testcases | 0 lldb/test/{ => API}/use_lldb_suite.py | 0 lldb/test/CMakeLists.txt | 236 ++++++++---------- .../Shell}/Breakpoint/Inputs/case-sensitive.c | 0 .../Shell}/Breakpoint/Inputs/debug_addrx.yaml | 0 .../Inputs/debug_rnglist_basic.yaml | 0 .../Inputs/debug_rnglist_offset_pair.yaml | 0 .../Inputs/debug_rnglist_rlestartend.yaml | 0 .../Inputs/debug_rnglistx_rlex.yaml | 0 .../Inputs/implicit_const_form_support.yaml | 0 .../Shell}/Breakpoint/Inputs/jitbp.cpp | 0 .../Breakpoint/Inputs/ppc64-localentry.s | 0 .../Inputs/single-file-split-dwarf.o.yaml | 0 .../Inputs/single-file-split-dwarf.yaml | 0 .../Inputs/split-dwarf-5-addrbase.dwo.yaml | 0 .../Inputs/split-dwarf-5-addrbase.yaml | 0 ...lit-dwarf5-debug-stroffsets-file1.dwo.yaml | 0 ...lit-dwarf5-debug-stroffsets-file2.dwo.yaml | 0 .../split-dwarf5-debug-stroffsets-main.yaml | 0 .../Shell}/Breakpoint/case-insensitive.test | 0 .../Shell}/Breakpoint/case-sensitive.test | 0 .../Shell}/Breakpoint/debug_addrx.test | 0 .../Breakpoint/debug_rnglist_basic.test | 0 .../Breakpoint/debug_rnglist_offset_pair.test | 0 .../Breakpoint/debug_rnglist_rlestartend.test | 0 .../Breakpoint/debug_rnglistx_rlex.test | 0 .../implicit_const_form_support.test | 0 .../Shell}/Breakpoint/jitbp_elf.test | 0 .../Shell}/Breakpoint/ppc64-localentry.test | 0 .../Breakpoint/single-file-split-dwarf.test | 0 .../Breakpoint/split-dwarf-5-addrbase.test | 0 .../split-dwarf5-debug-stroffsets.test | 0 .../BuildScript/compiler-full-path.test | 0 .../Shell}/BuildScript/modes.test | 0 .../Shell}/BuildScript/script-args.test | 0 .../BuildScript/toolchain-clang-cl.test | 0 .../Shell}/BuildScript/toolchain-clang.test | 0 .../Shell}/BuildScript/toolchain-msvc.test | 0 .../CommandScriptImmediateOutputConsole.test | 0 .../CommandScriptImmediateOutputFile.test | 0 .../Inputs/custom_command.py | 0 .../lit.local.cfg | 0 .../Shell}/Commands/Inputs/frame.py | 0 .../Shell}/Commands/Inputs/main.c | 0 .../Shell}/Commands/command-backtrace.test | 0 .../Shell}/Commands/command-regex-delete.test | 0 .../Commands/command-regex-unalias.test | 0 .../Commands/command-script-import.test | 0 .../Shell}/Commands/command-source.test | 0 .../Shell}/Driver/Inputs/.lldbinit | 0 .../Shell}/Driver/Inputs/Print0.in | 0 .../Shell}/Driver/Inputs/Print2.in | 0 .../Shell}/Driver/Inputs/Print4.in | 0 .../Shell}/Driver/Inputs/Print6.in | 0 .../Shell}/Driver/Inputs/convenience.in | 0 .../{lit => test/Shell}/Driver/Inputs/hello.c | 0 .../Shell}/Driver/Inputs/hello.cpp | 0 .../Driver/Inputs/process_attach_pid.in | 0 .../Shell}/Driver/Inputs/syntax_error.py | 0 .../Shell}/Driver/LocalLLDBInit.test | 0 .../Shell}/Driver/TestCommands.test | 0 .../Driver/TestConvenienceVariables.test | 0 lldb/{lit => test/Shell}/Driver/TestCore.test | 0 lldb/{lit => test/Shell}/Driver/TestFile.test | 0 .../Shell}/Driver/TestNoUseColor.test | 0 .../Shell}/Driver/TestProcessAttach.test | 0 lldb/{lit => test/Shell}/Driver/TestRepl.test | 0 .../Shell}/Driver/TestSingleQuote.test | 0 .../Shell}/Driver/TestTarget.test | 0 .../StopHook/Inputs/stop-hook-1.lldbinit | 0 .../StopHook/Inputs/stop-hook-2.lldbinit | 0 .../StopHook/Inputs/stop-hook-3.lldbinit | 0 .../Inputs/stop-hook-threads-1.lldbinit | 0 .../Inputs/stop-hook-threads-2.lldbinit | 0 .../StopHook/Inputs/stop-hook-threads.cpp | 0 .../ExecControl/StopHook/Inputs/stop-hook.c | 0 .../StopHook/stop-hook-threads.test | 0 .../ExecControl/StopHook/stop-hook.test | 0 .../Shell}/Expr/Inputs/call-function.cpp | 0 .../Shell}/Expr/Inputs/ir-memory-map-basic | 0 .../Expr/Inputs/ir-memory-map-mix-malloc-free | 0 .../Shell}/Expr/Inputs/ir-memory-map-overlap1 | 0 .../Shell}/Expr/TestIRMemoryMap.test | 0 .../Shell}/Expr/TestIRMemoryMapWindows.test | 0 .../Shell}/Expr/TestMultilineExpr.test | 0 .../Shell}/Expr/TestTypeOfDeclTypeExpr.test | 0 lldb/{lit => test/Shell}/Heap/Inputs/cstr.c | 0 lldb/{lit => test/Shell}/Heap/heap-cstr.test | 0 lldb/{lit => test/Shell}/Host/Inputs/simple.c | 0 .../Shell}/Host/TestCustomShell.test | 0 .../Shell}/Minidump/Inputs/linux-x86_64.syms | 0 .../Shell}/Minidump/Inputs/linux-x86_64.yaml | 0 .../Windows/Inputs/find-module.dmp.yaml | 0 .../Windows/Inputs/find-module.exe.yaml | 0 .../Windows/Sigsegv/Inputs/sigsegv.cpp | 0 .../Windows/Sigsegv/Inputs/sigsegv.dmp | Bin .../Windows/Sigsegv/Inputs/sigsegv.lldbinit | 0 .../Windows/Sigsegv/Inputs/sigsegv.pdb | Bin .../Minidump/Windows/Sigsegv/sigsegv.test | 0 .../Shell}/Minidump/Windows/find-module.test | 0 .../Shell}/Minidump/breakpad-symbols.test | 0 .../Minidump/disassemble-no-module.yaml | 0 .../Shell}/Minidump/dump-all.test | 0 .../{lit => test/Shell}/Minidump/fb-dump.test | 0 .../Shell}/Minidump/lit.local.cfg | 0 .../Breakpad/Inputs/bad-module-id-1.syms | 0 .../Breakpad/Inputs/bad-module-id-2.syms | 0 .../Breakpad/Inputs/bad-module-id-3.syms | 0 .../Inputs/discontiguous-sections.syms | 0 .../Breakpad/Inputs/identification-linux.syms | 0 .../Inputs/identification-macosx-arm64e.syms | 0 .../Inputs/identification-macosx.syms | 0 .../Inputs/identification-windows.syms | 0 .../Inputs/sections-trailing-func.syms | 0 .../ObjectFile/Breakpad/Inputs/sections.syms | 0 .../Breakpad/Inputs/uuid-matching-mac.syms | 0 .../Breakpad/Inputs/uuid-matching-mac.yaml | 0 .../Breakpad/breakpad-identification.test | 0 .../Breakpad/discontiguous-sections.test | 0 .../Shell}/ObjectFile/Breakpad/lit.local.cfg | 0 .../Breakpad/sections-trailing-func.test | 0 .../Shell}/ObjectFile/Breakpad/sections.test | 0 .../Breakpad/uuid-matching-mac.test | 0 .../ELF/Inputs/PT_LOAD-overlap-section.elf | Bin .../ELF/Inputs/minidebuginfo-main.c | 0 .../ObjectFile/ELF/Inputs/netbsd-amd64.core | Bin .../Shell}/ObjectFile/ELF/PT_LOAD-empty.yaml | 0 .../ELF/PT_LOAD-overlap-PT_INTERP.yaml | 0 .../ELF/PT_LOAD-overlap-PT_TLS.yaml | 0 .../ELF/PT_LOAD-overlap-section.yaml | 0 .../ObjectFile/ELF/PT_LOAD-overlap.yaml | 0 .../Shell}/ObjectFile/ELF/PT_LOAD.yaml | 0 .../ELF/PT_TLS-overlap-PT_LOAD.yaml | 0 .../ObjectFile/ELF/aarch64-relocations.yaml | 0 .../Shell}/ObjectFile/ELF/base-address.yaml | 0 .../Shell}/ObjectFile/ELF/basic-info.yaml | 0 .../Shell}/ObjectFile/ELF/build-id-case.yaml | 0 .../ObjectFile/ELF/compressed-sections.yaml | 0 .../ObjectFile/ELF/duplicate-section.yaml | 0 .../Shell}/ObjectFile/ELF/gnu-debuglink.yaml | 0 .../Shell}/ObjectFile/ELF/many-sections.s | 0 .../ELF/minidebuginfo-corrupt-xz.yaml | 0 .../ELF/minidebuginfo-find-symbols.yaml | 0 .../ObjectFile/ELF/minidebuginfo-no-lzma.yaml | 0 .../minidebuginfo-set-and-hit-breakpoint.test | 0 .../ObjectFile/ELF/netbsd-core-amd64.test | 0 .../ELF/netbsd-exec-8.99.30-amd64.yaml | 0 .../ObjectFile/ELF/section-addresses.yaml | 0 .../ObjectFile/ELF/section-overlap.yaml | 0 .../ObjectFile/ELF/section-permissions.yaml | 0 .../ELF/section-types-edgecases.yaml | 0 .../Shell}/ObjectFile/ELF/section-types.yaml | 0 .../Shell}/ObjectFile/ELF/short-build-id.yaml | 0 .../ObjectFile/MachO/lc_build_version.yaml | 0 .../MachO/lc_build_version_notools.yaml | 0 .../ObjectFile/MachO/lc_version_min.yaml | 0 .../Shell}/ObjectFile/MachO/subsections.yaml | 0 .../Shell}/ObjectFile/MachO/symtab.yaml | 0 .../ObjectFile/PECOFF/basic-info-arm.yaml | 0 .../ObjectFile/PECOFF/basic-info-arm64.yaml | 0 .../Shell}/ObjectFile/PECOFF/basic-info.yaml | 0 .../Shell}/ObjectFile/PECOFF/dep-modules.yaml | 0 .../ObjectFile/PECOFF/export-dllfunc.yaml | 0 .../Shell}/ObjectFile/PECOFF/lit.local.cfg | 0 .../ObjectFile/PECOFF/sections-names.yaml | 0 .../Shell}/ObjectFile/PECOFF/subsections.yaml | 0 .../Shell}/ObjectFile/PECOFF/uuid.yaml | 0 .../Shell}/ObjectFile/lit.local.cfg | 0 .../Shell}/Process/Inputs/env.cpp | 0 .../Shell}/Process/TestEnvironment.test | 0 .../Windows/exception_access_violation.cpp | 0 lldb/{lit => test/Shell}/Python/crashlog.test | 4 +- .../Shell}/Quit/TestQuitExitCode-30.test | 0 .../Shell}/Quit/TestQuitExitCode0.test | 0 .../Shell}/Quit/TestQuitExitCode30.test | 0 .../Shell}/Quit/TestQuitExitCodeHex0.test | 0 .../Shell}/Quit/TestQuitExitCodeHexA.test | 0 .../Quit/TestQuitExitCodeImplicit0.test | 0 .../Shell}/Quit/TestQuitExitCodeNonInt.test | 0 .../Quit/TestQuitExitCodeTooManyArgs.test | 0 .../Shell}/Quit/expect_exit_code.py | 0 .../Shell}/Register/Inputs/x86-64-gp-read.cpp | 0 .../Register/Inputs/x86-64-gp-write.cpp | 0 .../Shell}/Register/Inputs/x86-64-read.cpp | 0 .../Shell}/Register/Inputs/x86-64-write.cpp | 0 .../Shell}/Register/Inputs/x86-gp-read.cpp | 0 .../Shell}/Register/Inputs/x86-gp-write.cpp | 0 .../Register/Inputs/x86-mm-xmm-read.cpp | 0 .../Register/Inputs/x86-mm-xmm-write.cpp | 0 .../Shell}/Register/Inputs/x86-ymm-read.cpp | 0 .../Shell}/Register/Inputs/x86-ymm-write.cpp | 0 .../Shell}/Register/Inputs/x86-zmm-read.cpp | 0 .../Shell}/Register/Inputs/x86-zmm-write.cpp | 0 .../Shell}/Register/x86-64-gp-read.test | 0 .../Shell}/Register/x86-64-gp-write.test | 0 .../Shell}/Register/x86-64-read.test | 0 .../Shell}/Register/x86-64-write.test | 0 .../Shell}/Register/x86-64-xmm16-read.test | 0 .../Shell}/Register/x86-64-xmm16-write.test | 0 .../Shell}/Register/x86-64-ymm-read.test | 0 .../Shell}/Register/x86-64-ymm-write.test | 0 .../Shell}/Register/x86-64-ymm16-read.test | 0 .../Shell}/Register/x86-64-ymm16-write.test | 0 .../Shell}/Register/x86-64-zmm-read.test | 0 .../Shell}/Register/x86-64-zmm-write.test | 0 .../Shell}/Register/x86-gp-read.test | 0 .../Shell}/Register/x86-gp-write.test | 0 .../Shell}/Register/x86-mm-xmm-read.test | 0 .../Shell}/Register/x86-mm-xmm-write.test | 0 .../Shell}/Register/x86-ymm-read.test | 0 .../Shell}/Register/x86-ymm-write.test | 0 .../Shell}/Register/x86-zmm-read.test | 0 .../Shell}/Register/x86-zmm-write.test | 0 .../Functionalities/Inputs/DataFormatter.in | 0 .../Reproducer/Functionalities/Inputs/foo.cpp | 0 .../Functionalities/Inputs/stepping.c | 0 .../Functionalities/TestDataFormatter.test | 0 .../Functionalities/TestImageList.test | 0 .../Functionalities/TestStepping.test | 0 .../Shell}/Reproducer/Inputs/FileCapture.in | 0 .../Reproducer/Inputs/GDBRemoteCapture.in | 0 .../Shell}/Reproducer/Inputs/simple.c | 0 .../Shell}/Reproducer/Modules/Inputs/Bar.h | 0 .../Shell}/Reproducer/Modules/Inputs/Foo.h | 0 .../Reproducer/Modules/Inputs/ModuleCXX.in | 0 .../Shell}/Reproducer/Modules/Inputs/main.cpp | 0 .../Modules/Inputs/module.modulemap | 0 .../Reproducer/Modules/TestModuleCXX.test | 0 .../Shell}/Reproducer/TestDriverOptions.test | 0 .../Shell}/Reproducer/TestDump.test | 0 .../Shell}/Reproducer/TestFileRepro.test | 0 .../Shell}/Reproducer/TestGDBRemoteRepro.test | 0 .../Shell}/Reproducer/TestRelativePath.test | 0 .../Shell}/Reproducer/TestReuseDirectory.test | 0 .../Shell}/Reproducer/TestSynchronous.test | 0 .../Settings/Inputs/DontStopCommandSource.in | 0 .../Settings/Inputs/EchoCommandsAll.out | 0 .../Inputs/EchoCommandsNoComments.out | 0 .../Settings/Inputs/EchoCommandsNone.out | 0 .../Settings/Inputs/EchoCommandsQuiet.out | 0 .../Settings/Inputs/EchoCommandsTest.in | 0 .../Settings/Inputs/StopCommandSource.in | 0 .../Shell}/Settings/Inputs/main.c | 0 .../Shell}/Settings/TestDisableColor.test | 0 .../Settings/TestDisassemblyFormat.test | 0 .../Shell}/Settings/TestEchoCommands.test | 0 .../Shell}/Settings/TestFrameFormatColor.test | 0 .../Settings/TestFrameFormatNoColor.test | 0 .../Settings/TestModuleCacheSanity.test | 0 .../Shell}/Settings/TestSettingsSet.test | 0 .../Shell}/Settings/TestSettingsWrite.test | 0 .../TestStopCommandSourceOnError.test | 0 .../SymbolFile/Breakpad/Inputs/basic-elf.yaml | 0 .../Breakpad/Inputs/basic-macho.yaml | 0 .../line-table-discontinuous-file-ids.syms | 0 .../Breakpad/Inputs/line-table-edgecases.syms | 0 .../Inputs/line-table-missing-file.syms | 0 .../Inputs/line-table-mixed-path-styles.syms | 0 .../Breakpad/Inputs/line-table.syms | 0 .../Breakpad/Inputs/stack-cfi-parsing.syms | 0 .../Breakpad/Inputs/stack-cfi-parsing.yaml | 0 .../Breakpad/Inputs/symtab-macho.syms | 0 .../SymbolFile/Breakpad/Inputs/symtab.syms | 0 .../Breakpad/Inputs/unwind-via-raSearch.syms | 0 .../Breakpad/Inputs/unwind-via-stack-cfi.syms | 0 .../Breakpad/Inputs/unwind-via-stack-cfi.yaml | 0 .../Breakpad/Inputs/unwind-via-stack-win.syms | 0 .../Breakpad/Inputs/unwind-via-stack-win.yaml | 0 .../line-table-discontinuous-file-ids.test | 0 .../Breakpad/line-table-edgecases.test | 0 .../Breakpad/line-table-missing-file.test | 0 .../line-table-mixed-path-styles.test | 0 .../SymbolFile/Breakpad/line-table.test | 0 .../Breakpad/stack-cfi-parsing.test | 0 .../SymbolFile/Breakpad/symtab-macho.test | 0 .../Shell}/SymbolFile/Breakpad/symtab.test | 0 .../Breakpad/unwind-via-raSearch.test | 0 .../Breakpad/unwind-via-stack-cfi.test | 0 .../Breakpad/unwind-via-stack-win.test | 0 .../DWARF/Inputs/debug-line-basic.script | 0 .../DWARF/Inputs/debug-types-basic.cpp | 0 .../DWARF/Inputs/debug-types-expressions.cpp | 0 ...parator-no-comp-dir-relative-name.lldbinit | 0 .../DWARF/Inputs/dir-separator-posix.lldbinit | 0 .../Inputs/dir-separator-windows.lldbinit | 0 .../DWARF/Inputs/find-variable-file-2.cpp | 0 .../SymbolFile/DWARF/apple-index-is-used.cpp | 0 .../Shell}/SymbolFile/DWARF/array-sizes.s | 0 .../SymbolFile/DWARF/childless-compile-unit.s | 0 .../SymbolFile/DWARF/compilercontext.ll | 0 .../SymbolFile/DWARF/debug-line-basic.s | 0 .../DWARF/debug-names-compressed.cpp | 0 .../DWARF/debug-types-address-ranges.s | 0 .../SymbolFile/DWARF/debug-types-basic.test | 0 .../SymbolFile/DWARF/debug-types-dwarf5.s | 0 .../DWARF/debug-types-dwo-cross-reference.cpp | 0 .../DWARF/debug-types-expressions.test | 0 .../DWARF/debug-types-line-tables.s | 0 .../DWARF/debug-types-missing-signature.test | 0 .../DWARF/debug-types-signature-loop.s | 0 .../DWARF/debug_aranges-empty-section.s | 0 .../Shell}/SymbolFile/DWARF/debug_loc.s | 0 .../DWARF/debug_ranges-missing-section.s | 0 .../Shell}/SymbolFile/DWARF/debug_ranges.s | 0 .../DWARF/debug_ranges_and_rnglists.test | 0 .../Shell}/SymbolFile/DWARF/debug_rnglists.s | 0 .../SymbolFile/DWARF/deterministic-build.cpp | 0 .../dir-separator-no-comp-dir-relative-name.s | 0 .../DWARF/dir-separator-no-comp-dir.s | 0 .../SymbolFile/DWARF/dir-separator-posix.s | 0 .../SymbolFile/DWARF/dir-separator-windows.s | 0 .../SymbolFile/DWARF/dwarf5-index-is-used.cpp | 0 .../SymbolFile/DWARF/dwarf5-partial-index.cpp | 0 .../SymbolFile/DWARF/dwarf5_locations.s | 0 .../SymbolFile/DWARF/find-basic-function.cpp | 0 .../SymbolFile/DWARF/find-basic-namespace.cpp | 0 .../SymbolFile/DWARF/find-basic-type.cpp | 0 .../SymbolFile/DWARF/find-basic-variable.cpp | 0 .../SymbolFile/DWARF/find-function-regex.cpp | 0 .../SymbolFile/DWARF/find-inline-method.s | 0 .../DWARF/find-method-local-struct.cpp | 0 .../Shell}/SymbolFile/DWARF/find-method.cpp | 0 .../DWARF/find-qualified-variable.cpp | 0 .../DWARF/find-type-in-function.cpp | 0 .../SymbolFile/DWARF/find-variable-dwo.cpp | 0 .../SymbolFile/DWARF/find-variable-file.cpp | 0 .../SymbolFile/DWARF/forward-declarations.s | 0 .../DWARF/gnu-style-compression.cpp | 0 .../Shell}/SymbolFile/DWARF/lit.local.cfg | 0 .../DWARF/parallel-indexing-stress.s | 0 .../SymbolFile/DWARF/split-dwarf-inlining.cpp | 0 .../DWARF/split-dwarf-multiple-cu.ll | 0 .../SymbolFile/Inputs/sizeless-symbol.s | 0 .../Inputs/target-symbols-add-unwind.c | 0 .../NativePDB/Inputs/ast-functions.lldbinit | 0 .../NativePDB/Inputs/ast-methods.lldbinit | 0 .../NativePDB/Inputs/ast-types.lldbinit | 0 .../NativePDB/Inputs/bitfields.lldbinit | 0 .../Inputs/break-by-function.lldbinit | 0 .../NativePDB/Inputs/break-by-line.lldbinit | 0 .../NativePDB/Inputs/disassembly.lldbinit | 0 .../Inputs/function-types-builtins.lldbinit | 0 .../function-types-calling-conv.lldbinit | 0 .../Inputs/function-types-classes.lldbinit | 0 .../NativePDB/Inputs/globals-bss.lldbinit | 0 .../NativePDB/Inputs/globals-classes.lldbinit | 0 .../Inputs/globals-fundamental.lldbinit | 0 .../NativePDB/Inputs/local-variables.lldbinit | 0 .../NativePDB/Inputs/nested-types.lldbinit | 0 .../NativePDB/Inputs/s_constant.lldbinit | 0 .../SymbolFile/NativePDB/Inputs/s_constant.s | 0 .../NativePDB/Inputs/source-list.lldbinit | 0 .../Inputs/stack_unwinding01.lldbinit | 0 .../NativePDB/Inputs/tag-types.lldbinit | 0 .../NativePDB/ast-functions-msvc.cpp | 0 .../SymbolFile/NativePDB/ast-functions.cpp | 0 .../SymbolFile/NativePDB/ast-methods.cpp | 0 .../Shell}/SymbolFile/NativePDB/ast-types.cpp | 0 .../Shell}/SymbolFile/NativePDB/bitfields.cpp | 0 .../NativePDB/break-by-function.cpp | 0 .../SymbolFile/NativePDB/break-by-line.cpp | 0 .../SymbolFile/NativePDB/disassembly.cpp | 0 .../NativePDB/function-types-builtins.cpp | 0 .../NativePDB/function-types-calling-conv.cpp | 0 .../NativePDB/function-types-classes.cpp | 0 .../SymbolFile/NativePDB/global-classes.cpp | 0 .../SymbolFile/NativePDB/globals-bss.cpp | 0 .../NativePDB/globals-fundamental.cpp | 0 .../SymbolFile/NativePDB/local-variables.cpp | 0 .../SymbolFile/NativePDB/nested-types.cpp | 0 .../SymbolFile/NativePDB/s_constant.cpp | 0 .../SymbolFile/NativePDB/source-list.cpp | 0 .../NativePDB/stack_unwinding01.cpp | 0 .../Shell}/SymbolFile/NativePDB/tag-types.cpp | 0 .../Shell}/SymbolFile/NativePDB/typedefs.cpp | 0 .../SymbolFile/PDB/Inputs/AstRestoreTest.cpp | 0 .../PDB/Inputs/CallingConventionsTest.cpp | 0 .../SymbolFile/PDB/Inputs/ClassLayoutTest.cpp | 0 .../SymbolFile/PDB/Inputs/CompilandsTest.cpp | 0 .../SymbolFile/PDB/Inputs/ExpressionsTest.cpp | 0 .../PDB/Inputs/ExpressionsTest0.script | 0 .../PDB/Inputs/ExpressionsTest1.script | 0 .../PDB/Inputs/ExpressionsTest2.script | 0 .../SymbolFile/PDB/Inputs/FuncSymbols.cpp | 0 .../PDB/Inputs/FuncSymbolsTestMain.cpp | 0 .../PDB/Inputs/FunctionLevelLinkingTest.cpp | 0 .../PDB/Inputs/FunctionLevelLinkingTest.h | 0 .../PDB/Inputs/FunctionLevelLinkingTest.ord | 0 .../PDB/Inputs/FunctionNestedBlockTest.cpp | 0 .../SymbolFile/PDB/Inputs/PointerTypeTest.cpp | 0 .../SymbolFile/PDB/Inputs/SimpleTypesTest.cpp | 0 .../SymbolFile/PDB/Inputs/TypeQualsTest.cpp | 0 .../SymbolFile/PDB/Inputs/UdtLayoutTest.cpp | 0 .../PDB/Inputs/UdtLayoutTest.script | 0 .../Shell}/SymbolFile/PDB/Inputs/VBases.cpp | 0 .../SymbolFile/PDB/Inputs/VBases.script | 0 .../PDB/Inputs/VariablesLocationsTest.cpp | 0 .../PDB/Inputs/VariablesLocationsTest.script | 0 .../SymbolFile/PDB/Inputs/VariablesTest.cpp | 0 .../Shell}/SymbolFile/PDB/ast-restore.test | 0 .../SymbolFile/PDB/calling-conventions.test | 0 .../Shell}/SymbolFile/PDB/class-layout.test | 0 .../Shell}/SymbolFile/PDB/compilands.test | 0 .../Shell}/SymbolFile/PDB/enums-layout.test | 0 .../Shell}/SymbolFile/PDB/expressions.test | 0 .../Shell}/SymbolFile/PDB/func-symbols.test | 0 .../PDB/function-level-linking.test | 0 .../SymbolFile/PDB/function-nested-block.test | 0 .../Shell}/SymbolFile/PDB/pointers.test | 0 .../Shell}/SymbolFile/PDB/type-quals.test | 0 .../Shell}/SymbolFile/PDB/typedefs.test | 0 .../Shell}/SymbolFile/PDB/udt-layout.test | 0 .../SymbolFile/PDB/variables-locations.test | 0 .../Shell}/SymbolFile/PDB/variables.test | 0 .../Shell}/SymbolFile/PDB/vbases.test | 0 .../SymbolFile/dissassemble-entry-point.s | 0 .../Shell}/SymbolFile/sizeless-symbol.test | 0 .../SymbolFile/target-symbols-add-unwind.test | 0 .../Shell}/Unwind/Inputs/call-asm.c | 0 .../Unwind/Inputs/eh-frame-dwarf-unwind.s | 0 .../Shell}/Unwind/Inputs/eh-frame-small-fde.s | 0 .../Inputs/prefer-debug-over-eh-frame.s | 0 .../Shell}/Unwind/Inputs/trap_frame_sym_ctx.s | 0 .../Unwind/Inputs/unwind-plan-dwarf-dump.s | 0 .../Shell}/Unwind/eh-frame-dwarf-unwind.test | 0 .../Shell}/Unwind/eh-frame-small-fde.test | 0 .../Unwind/prefer-debug-over-eh-frame.test | 0 .../Shell}/Unwind/trap_frame_sym_ctx.test | 0 .../Shell}/Unwind/unwind-plan-dwarf-dump.test | 0 .../Shell}/Watchpoint/Inputs/main.cpp | 0 .../Shell}/Watchpoint/SetErrorCases.test | 0 lldb/{lit => test/Shell}/helper/__init__.py | 0 lldb/{lit => test/Shell}/helper/build.py | 0 lldb/{lit => test/Shell}/helper/toolchain.py | 2 +- lldb/{lit => test/Shell}/lit-lldb-init.in | 0 lldb/{lit => test/Shell}/lit.cfg.py | 4 +- lldb/{lit => test/Shell}/lit.site.cfg.py.in | 2 +- lldb/test/Unit/README.md | 4 + lldb/{lit => test}/Unit/lit.cfg.py | 2 +- lldb/{lit => test}/Unit/lit.site.cfg.py.in | 2 +- lldb/test/lit.cfg.py | 41 +++ 449 files changed, 312 insertions(+), 262 deletions(-) delete mode 100644 lldb/lit/CMakeLists.txt create mode 100644 lldb/test/API/CMakeLists.txt create mode 100644 lldb/test/API/README.md rename lldb/test/{ => API}/dotest.py (100%) rename lldb/{lit/Suite => test/API}/lit.cfg (96%) rename lldb/{lit/Suite => test/API}/lit.site.cfg.in (93%) rename lldb/{lit/Suite => test/API}/lldbtest.py (100%) rename lldb/test/{ => API}/testcases (100%) rename lldb/test/{ => API}/use_lldb_suite.py (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/case-sensitive.c (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_addrx.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_rnglist_basic.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_rnglistx_rlex.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/implicit_const_form_support.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/jitbp.cpp (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/ppc64-localentry.s (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/single-file-split-dwarf.o.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/single-file-split-dwarf.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/case-insensitive.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/case-sensitive.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_addrx.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_rnglist_basic.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_rnglist_offset_pair.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_rnglist_rlestartend.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_rnglistx_rlex.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/implicit_const_form_support.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/jitbp_elf.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/ppc64-localentry.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/single-file-split-dwarf.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/split-dwarf-5-addrbase.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/split-dwarf5-debug-stroffsets.test (100%) rename lldb/{lit => test/Shell}/BuildScript/compiler-full-path.test (100%) rename lldb/{lit => test/Shell}/BuildScript/modes.test (100%) rename lldb/{lit => test/Shell}/BuildScript/script-args.test (100%) rename lldb/{lit => test/Shell}/BuildScript/toolchain-clang-cl.test (100%) rename lldb/{lit => test/Shell}/BuildScript/toolchain-clang.test (100%) rename lldb/{lit => test/Shell}/BuildScript/toolchain-msvc.test (100%) rename lldb/{lit => test/Shell}/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test (100%) rename lldb/{lit => test/Shell}/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test (100%) rename lldb/{lit => test/Shell}/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py (100%) rename lldb/{lit => test/Shell}/Commands/CommandScriptImmediateOutput/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/Commands/Inputs/frame.py (100%) rename lldb/{lit => test/Shell}/Commands/Inputs/main.c (100%) rename lldb/{lit => test/Shell}/Commands/command-backtrace.test (100%) rename lldb/{lit => test/Shell}/Commands/command-regex-delete.test (100%) rename lldb/{lit => test/Shell}/Commands/command-regex-unalias.test (100%) rename lldb/{lit => test/Shell}/Commands/command-script-import.test (100%) rename lldb/{lit => test/Shell}/Commands/command-source.test (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/.lldbinit (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/Print0.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/Print2.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/Print4.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/Print6.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/convenience.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/hello.c (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/hello.cpp (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/process_attach_pid.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/syntax_error.py (100%) rename lldb/{lit => test/Shell}/Driver/LocalLLDBInit.test (100%) rename lldb/{lit => test/Shell}/Driver/TestCommands.test (100%) rename lldb/{lit => test/Shell}/Driver/TestConvenienceVariables.test (100%) rename lldb/{lit => test/Shell}/Driver/TestCore.test (100%) rename lldb/{lit => test/Shell}/Driver/TestFile.test (100%) rename lldb/{lit => test/Shell}/Driver/TestNoUseColor.test (100%) rename lldb/{lit => test/Shell}/Driver/TestProcessAttach.test (100%) rename lldb/{lit => test/Shell}/Driver/TestRepl.test (100%) rename lldb/{lit => test/Shell}/Driver/TestSingleQuote.test (100%) rename lldb/{lit => test/Shell}/Driver/TestTarget.test (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-threads.cpp (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook.c (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/stop-hook-threads.test (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/stop-hook.test (100%) rename lldb/{lit => test/Shell}/Expr/Inputs/call-function.cpp (100%) rename lldb/{lit => test/Shell}/Expr/Inputs/ir-memory-map-basic (100%) rename lldb/{lit => test/Shell}/Expr/Inputs/ir-memory-map-mix-malloc-free (100%) rename lldb/{lit => test/Shell}/Expr/Inputs/ir-memory-map-overlap1 (100%) rename lldb/{lit => test/Shell}/Expr/TestIRMemoryMap.test (100%) rename lldb/{lit => test/Shell}/Expr/TestIRMemoryMapWindows.test (100%) rename lldb/{lit => test/Shell}/Expr/TestMultilineExpr.test (100%) rename lldb/{lit => test/Shell}/Expr/TestTypeOfDeclTypeExpr.test (100%) rename lldb/{lit => test/Shell}/Heap/Inputs/cstr.c (100%) rename lldb/{lit => test/Shell}/Heap/heap-cstr.test (100%) rename lldb/{lit => test/Shell}/Host/Inputs/simple.c (100%) rename lldb/{lit => test/Shell}/Host/TestCustomShell.test (100%) rename lldb/{lit => test/Shell}/Minidump/Inputs/linux-x86_64.syms (100%) rename lldb/{lit => test/Shell}/Minidump/Inputs/linux-x86_64.yaml (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Inputs/find-module.dmp.yaml (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Inputs/find-module.exe.yaml (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/sigsegv.test (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/find-module.test (100%) rename lldb/{lit => test/Shell}/Minidump/breakpad-symbols.test (100%) rename lldb/{lit => test/Shell}/Minidump/disassemble-no-module.yaml (100%) rename lldb/{lit => test/Shell}/Minidump/dump-all.test (100%) rename lldb/{lit => test/Shell}/Minidump/fb-dump.test (100%) rename lldb/{lit => test/Shell}/Minidump/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/identification-linux.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/identification-macosx.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/identification-windows.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/sections.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/breakpad-identification.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/discontiguous-sections.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/sections-trailing-func.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/sections.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/uuid-matching-mac.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/Inputs/minidebuginfo-main.c (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/Inputs/netbsd-amd64.core (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-empty.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-overlap-section.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-overlap.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/aarch64-relocations.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/base-address.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/basic-info.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/build-id-case.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/compressed-sections.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/duplicate-section.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/gnu-debuglink.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/many-sections.s (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/minidebuginfo-find-symbols.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/minidebuginfo-no-lzma.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/netbsd-core-amd64.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-addresses.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-overlap.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-permissions.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-types-edgecases.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-types.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/short-build-id.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/lc_build_version.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/lc_build_version_notools.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/lc_version_min.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/subsections.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/symtab.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/basic-info-arm.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/basic-info-arm64.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/basic-info.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/dep-modules.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/export-dllfunc.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/sections-names.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/subsections.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/uuid.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/Process/Inputs/env.cpp (100%) rename lldb/{lit => test/Shell}/Process/TestEnvironment.test (100%) rename lldb/{lit => test/Shell}/Process/Windows/exception_access_violation.cpp (100%) rename lldb/{lit => test/Shell}/Python/crashlog.test (97%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCode-30.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCode0.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCode30.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeHex0.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeHexA.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeImplicit0.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeNonInt.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeTooManyArgs.test (100%) rename lldb/{lit => test/Shell}/Quit/expect_exit_code.py (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-64-gp-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-64-gp-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-64-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-64-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-gp-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-gp-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-mm-xmm-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-mm-xmm-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-ymm-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-ymm-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-zmm-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-zmm-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/x86-64-gp-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-gp-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-xmm16-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-xmm16-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-ymm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-ymm-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-ymm16-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-ymm16-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-zmm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-zmm-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-gp-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-gp-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-mm-xmm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-mm-xmm-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-ymm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-ymm-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-zmm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-zmm-write.test (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/Inputs/DataFormatter.in (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/Inputs/foo.cpp (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/Inputs/stepping.c (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/TestDataFormatter.test (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/TestImageList.test (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/TestStepping.test (100%) rename lldb/{lit => test/Shell}/Reproducer/Inputs/FileCapture.in (100%) rename lldb/{lit => test/Shell}/Reproducer/Inputs/GDBRemoteCapture.in (100%) rename lldb/{lit => test/Shell}/Reproducer/Inputs/simple.c (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/Bar.h (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/Foo.h (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/ModuleCXX.in (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/main.cpp (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/module.modulemap (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/TestModuleCXX.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestDriverOptions.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestDump.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestFileRepro.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestGDBRemoteRepro.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestRelativePath.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestReuseDirectory.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestSynchronous.test (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/DontStopCommandSource.in (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsAll.out (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsNoComments.out (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsNone.out (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsQuiet.out (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsTest.in (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/StopCommandSource.in (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/main.c (100%) rename lldb/{lit => test/Shell}/Settings/TestDisableColor.test (100%) rename lldb/{lit => test/Shell}/Settings/TestDisassemblyFormat.test (100%) rename lldb/{lit => test/Shell}/Settings/TestEchoCommands.test (100%) rename lldb/{lit => test/Shell}/Settings/TestFrameFormatColor.test (100%) rename lldb/{lit => test/Shell}/Settings/TestFrameFormatNoColor.test (100%) rename lldb/{lit => test/Shell}/Settings/TestModuleCacheSanity.test (100%) rename lldb/{lit => test/Shell}/Settings/TestSettingsSet.test (100%) rename lldb/{lit => test/Shell}/Settings/TestSettingsWrite.test (100%) rename lldb/{lit => test/Shell}/Settings/TestStopCommandSourceOnError.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/basic-elf.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/basic-macho.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/symtab-macho.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/symtab.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table-edgecases.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table-missing-file.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table-mixed-path-styles.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/stack-cfi-parsing.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/symtab-macho.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/symtab.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/unwind-via-raSearch.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/unwind-via-stack-cfi.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/unwind-via-stack-win.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/debug-line-basic.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/debug-types-basic.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/apple-index-is-used.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/array-sizes.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/childless-compile-unit.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/compilercontext.ll (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-line-basic.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-names-compressed.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-address-ranges.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-basic.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-dwarf5.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-expressions.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-line-tables.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-missing-signature.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-signature-loop.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_aranges-empty-section.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_loc.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_ranges-missing-section.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_ranges.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_ranges_and_rnglists.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_rnglists.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/deterministic-build.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dir-separator-no-comp-dir.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dir-separator-posix.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dir-separator-windows.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dwarf5-index-is-used.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dwarf5-partial-index.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dwarf5_locations.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-basic-function.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-basic-namespace.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-basic-type.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-basic-variable.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-function-regex.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-inline-method.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-method-local-struct.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-method.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-qualified-variable.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-type-in-function.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-variable-dwo.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-variable-file.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/forward-declarations.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/gnu-style-compression.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/parallel-indexing-stress.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/split-dwarf-inlining.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/split-dwarf-multiple-cu.ll (100%) rename lldb/{lit => test/Shell}/SymbolFile/Inputs/sizeless-symbol.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/Inputs/target-symbols-add-unwind.c (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/ast-types.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/bitfields.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/disassembly.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/local-variables.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/nested-types.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/s_constant.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/s_constant.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/source-list.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/tag-types.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/ast-functions-msvc.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/ast-functions.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/ast-methods.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/ast-types.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/bitfields.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/break-by-function.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/break-by-line.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/disassembly.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/function-types-builtins.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/function-types-calling-conv.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/function-types-classes.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/global-classes.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/globals-bss.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/globals-fundamental.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/local-variables.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/nested-types.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/s_constant.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/source-list.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/stack_unwinding01.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/tag-types.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/typedefs.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/AstRestoreTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/CompilandsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ExpressionsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ExpressionsTest0.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ExpressionsTest1.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ExpressionsTest2.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FuncSymbols.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/PointerTypeTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/TypeQualsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/UdtLayoutTest.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VBases.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VBases.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VariablesLocationsTest.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VariablesTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/ast-restore.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/calling-conventions.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/class-layout.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/compilands.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/enums-layout.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/expressions.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/func-symbols.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/function-level-linking.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/function-nested-block.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/pointers.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/type-quals.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/typedefs.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/udt-layout.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/variables-locations.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/variables.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/vbases.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/dissassemble-entry-point.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/sizeless-symbol.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/target-symbols-add-unwind.test (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/call-asm.c (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/eh-frame-dwarf-unwind.s (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/eh-frame-small-fde.s (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/prefer-debug-over-eh-frame.s (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/trap_frame_sym_ctx.s (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/unwind-plan-dwarf-dump.s (100%) rename lldb/{lit => test/Shell}/Unwind/eh-frame-dwarf-unwind.test (100%) rename lldb/{lit => test/Shell}/Unwind/eh-frame-small-fde.test (100%) rename lldb/{lit => test/Shell}/Unwind/prefer-debug-over-eh-frame.test (100%) rename lldb/{lit => test/Shell}/Unwind/trap_frame_sym_ctx.test (100%) rename lldb/{lit => test/Shell}/Unwind/unwind-plan-dwarf-dump.test (100%) rename lldb/{lit => test/Shell}/Watchpoint/Inputs/main.cpp (100%) rename lldb/{lit => test/Shell}/Watchpoint/SetErrorCases.test (100%) rename lldb/{lit => test/Shell}/helper/__init__.py (100%) rename lldb/{lit => test/Shell}/helper/build.py (100%) rename lldb/{lit => test/Shell}/helper/toolchain.py (98%) rename lldb/{lit => test/Shell}/lit-lldb-init.in (100%) rename lldb/{lit => test/Shell}/lit.cfg.py (97%) rename lldb/{lit => test/Shell}/lit.site.cfg.py.in (96%) create mode 100644 lldb/test/Unit/README.md rename lldb/{lit => test}/Unit/lit.cfg.py (97%) rename lldb/{lit => test}/Unit/lit.site.cfg.py.in (93%) create mode 100644 lldb/test/lit.cfg.py diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 317643a44225f..58a7ef1a9a785 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -185,7 +185,6 @@ if(LLDB_INCLUDE_TESTS) add_subdirectory(test) add_subdirectory(unittests) - add_subdirectory(lit) add_subdirectory(utils/lit-cpuid) add_subdirectory(utils/lldb-dotest) endif() diff --git a/lldb/lit/CMakeLists.txt b/lldb/lit/CMakeLists.txt deleted file mode 100644 index 3e759b0e187a3..0000000000000 --- a/lldb/lit/CMakeLists.txt +++ /dev/null @@ -1,115 +0,0 @@ -# Test runner infrastructure for LLDB. This configures the LLDB test trees -# for use by Lit, and delegates to LLVM's lit test handlers. - -# LLVM_BUILD_MODE is used in lit.site.cfg -if (CMAKE_CFG_INTDIR STREQUAL ".") - set(LLVM_BUILD_MODE ".") -else () - set(LLVM_BUILD_MODE "%(build_mode)s") -endif () - -if (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(LLDB_IS_64_BITS 1) -endif() - -get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY) -set(dotest_args_replacement ${LLVM_BUILD_MODE}) - -set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.") -set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.") - -if(LLDB_BUILT_STANDALONE) - # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder. - string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR}) - string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") - - # Remaining ones must be paths to the provided LLVM build-tree. - if(LLVM_CONFIGURATION_TYPES) - # LLDB uses single-config; LLVM multi-config; pick one and prefer Release types. - # Otherwise, if both use multi-config the default is fine. - if(NOT CMAKE_CONFIGURATION_TYPES) - if(RelWithDebInfo IN_LIST LLVM_CONFIGURATION_TYPES) - set(dotest_args_replacement RelWithDebInfo) - elseif(Release IN_LIST LLVM_CONFIGURATION_TYPES) - set(dotest_args_replacement Release) - else() - list(GET LLVM_CONFIGURATION_TYPES 0 dotest_args_replacement) - endif() - endif() - else() - # Common case: LLVM used a single-configuration generator like Ninja. - set(dotest_args_replacement ".") - endif() -endif() - -string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") -string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) -string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) - -add_lldb_test_dependency( - lit-cpuid - llc - lli - llvm-config - llvm-dwarfdump - llvm-nm - llvm-mc - llvm-objcopy - llvm-readobj - llvm-strip - ) - -if(TARGET lld) - add_lldb_test_dependency(lld) -endif() - -# the value is not canonicalized within LLVM -llvm_canonicalize_cmake_booleans( - LLDB_DISABLE_PYTHON - LLVM_ENABLE_ZLIB - LLVM_ENABLE_SHARED_LIBS - LLDB_IS_64_BITS) - -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py - MAIN_CONFIG - ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py) -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py - MAIN_CONFIG - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py) -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg) - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/lit-lldb-init.in - ${CMAKE_CURRENT_BINARY_DIR}/lit-lldb-init) - -if(NOT LLDB_BUILT_STANDALONE) - add_lldb_test_dependency( - FileCheck - count - not - ) -endif() - -add_lit_testsuite(check-lldb-lit "Running lldb lit test suite" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS lldb-test-deps - ) - -set_target_properties(check-lldb-lit PROPERTIES FOLDER "lldb tests") - -# If we're building with an in-tree clang, then list clang as a dependency -# to run tests. -if (TARGET clang) - add_dependencies(check-lldb-lit clang) -endif() - -add_lit_testsuites(LLDB - ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS lldb-test-deps - ) diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt new file mode 100644 index 0000000000000..7080dc4520457 --- /dev/null +++ b/lldb/test/API/CMakeLists.txt @@ -0,0 +1,149 @@ +function(add_python_test_target name test_script args comment) + set(PYTHON_TEST_COMMAND + ${PYTHON_EXECUTABLE} + ${test_script} + ${args} + ) + + add_custom_target(${name} + COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS} + COMMENT "${comment}" + USES_TERMINAL + ) + add_dependencies(${name} lldb-test-deps) +endfunction() + +# The default architecture with which to compile test executables is the default LLVM target +# architecture, which itself defaults to the host architecture. +string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH) +if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" ) + string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE}) +endif () + +# Allow the user to override the default by setting LLDB_TEST_ARCH +set(LLDB_TEST_ARCH + ${LLDB_DEFAULT_TEST_ARCH} + CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") + +# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script +set(LLDB_TEST_USER_ARGS + "" + CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") + +# The .noindex suffix is a marker for Spotlight to never index the +# build directory. LLDB queries Spotlight to locate .dSYM bundles +# based on the UUID embedded in a binary, and because the UUID is a +# hash of filename and .text section, there *will* be conflicts inside +# the build directory. +set(LLDB_TEST_COMMON_ARGS + --arch=${LLDB_TEST_ARCH} + -s + ${CMAKE_BINARY_DIR}/lldb-test-traces + -S nm + -u CXXFLAGS + -u CFLAGS + ) + +list(APPEND LLDB_TEST_COMMON_ARGS + --executable ${LLDB_TEST_EXECUTABLE} + --dsymutil ${LLDB_TEST_DSYMUTIL} + --filecheck ${LLDB_TEST_FILECHECK} + -C ${LLDB_TEST_C_COMPILER} + ) + +if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) + # All tests are currently flaky on Windows, so rerun them all once when they fail. + set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues) + + set(LLDB_TEST_DEBUG_TEST_CRASHES + 0 + CACHE BOOL "(Windows only) Enables debugging of tests in the test suite by showing the crash dialog when lldb crashes") + + set(LLDB_TEST_HIDE_CONSOLE_WINDOWS + 1 + CACHE BOOL "(Windows only) Hides the console window for an inferior when it is launched through the test suite") + + if (LLDB_TEST_DEBUG_TEST_CRASHES) + set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --enable-crash-dialog) + endif() + + if (NOT LLDB_TEST_HIDE_CONSOLE_WINDOWS) + set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --show-inferior-console) + endif() +endif() + +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin") + list(APPEND LLDB_TEST_COMMON_ARGS + --env ARCHIVER=${CMAKE_AR} --env OBJCOPY=${CMAKE_OBJCOPY}) +endif() + +if (NOT "${LLDB_LIT_TOOLS_DIR}" STREQUAL "") + if (NOT EXISTS "${LLDB_LIT_TOOLS_DIR}") + message(WARNING "LLDB_LIT_TOOLS_DIR ${LLDB_LIT_TOOLS_DIR} does not exist.") + endif() +endif() + +if(CMAKE_HOST_APPLE) + if(LLDB_BUILD_FRAMEWORK) + get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) + list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_build_dir}/LLDB.framework) + endif() + + # Use the same identity for testing + get_property(code_sign_identity_used GLOBAL PROPERTY LLDB_DEBUGSERVER_CODESIGN_IDENTITY) + if(code_sign_identity_used) + list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${code_sign_identity_used}") + endif() + + if(LLDB_USE_SYSTEM_DEBUGSERVER) + lldb_find_system_debugserver(system_debugserver_path) + add_custom_target(debugserver + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${system_debugserver_path} ${LLVM_RUNTIME_OUTPUT_INTDIR} + COMMENT "Copying the system debugserver to LLDB's binaries directory for testing.") + # The custom target for the system debugserver has no install target, so we + # need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list. + if (LLVM_DISTRIBUTION_COMPONENTS) + list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS debugserver) + set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} PARENT_SCOPE) + endif() + message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver) + add_lldb_test_dependency(debugserver) + elseif(TARGET debugserver) + set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver) + message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path}) + add_lldb_test_dependency(debugserver) + elseif(TARGET lldb-server) + set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server) + message(STATUS "LLDB Tests use just-built lldb-server: ${lldb_server_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path}) + add_lldb_test_dependency(lldb-server) + else() + message(WARNING "LLDB Tests enabled, but no server available") + endif() +endif() + +set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}) +set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS}) + +add_custom_target(check-lldb) +add_dependencies(check-lldb lldb-test-deps) +set_target_properties(check-lldb PROPERTIES FOLDER "lldb misc") + +# LLD is required to link test executables on Windows. +if (CMAKE_SYSTEM_NAME MATCHES "Windows") + if (TARGET lld) + add_lldb_test_dependency(lld) + else () + message(WARNING "lld required to test LLDB on Windows") + endif () +endif () + +# Run the lit-style tests and the unittests as part of the check-lldb target. +add_dependencies(check-lldb check-lldb-lit) + +# This will add LLDB's test dependencies to the dependencies for check-all and +# include them in the test-depends target. +set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS}) diff --git a/lldb/test/API/README.md b/lldb/test/API/README.md new file mode 100644 index 0000000000000..fbb37136e26de --- /dev/null +++ b/lldb/test/API/README.md @@ -0,0 +1,4 @@ +# LLDB API Tests + +This directory only exists for the lit test driver. The actual tests live in +the `tests` directory in top level LLDB directory. diff --git a/lldb/test/dotest.py b/lldb/test/API/dotest.py similarity index 100% rename from lldb/test/dotest.py rename to lldb/test/API/dotest.py diff --git a/lldb/lit/Suite/lit.cfg b/lldb/test/API/lit.cfg similarity index 96% rename from lldb/lit/Suite/lit.cfg rename to lldb/test/API/lit.cfg index 9504f4ca1d845..bb9e3aaaaa44d 100644 --- a/lldb/lit/Suite/lit.cfg +++ b/lldb/test/API/lit.cfg @@ -9,7 +9,7 @@ import shlex import lit.formats # name: The name of this test suite. -config.name = 'lldb-Suite' +config.name = 'lldb-api' # suffixes: A list of file extensions to treat as test files. config.suffixes = ['.py'] @@ -73,7 +73,7 @@ if config.lldb_module_cache: dotest_cmd += ['--module-cache-dir', config.lldb_module_cache] # Load LLDB test format. -sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite")) +sys.path.append(os.path.join(config.lldb_src_root, "test", "API")) import lldbtest # testFormat: The test format to use to interpret tests. diff --git a/lldb/lit/Suite/lit.site.cfg.in b/lldb/test/API/lit.site.cfg.in similarity index 93% rename from lldb/lit/Suite/lit.site.cfg.in rename to lldb/test/API/lit.site.cfg.in index 306967d61fd00..883bc4033005b 100644 --- a/lldb/lit/Suite/lit.site.cfg.in +++ b/lldb/test/API/lit.site.cfg.in @@ -20,7 +20,7 @@ config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@" config.lldb_module_cache = "@LLDB_TEST_MODULE_CACHE_LLDB@" config.clang_module_cache = "@LLDB_TEST_MODULE_CACHE_CLANG@" config.python_executable = "@PYTHON_EXECUTABLE@" -config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py" +config.dotest_path = "@LLDB_SOURCE_DIR@/test/API/dotest.py" config.dotest_args_str = "@LLDB_DOTEST_ARGS@" config.lldb_disable_python = @LLDB_DISABLE_PYTHON@ config.dotest_lit_args_str = None @@ -43,4 +43,4 @@ except KeyError as e: lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Suite/lit.cfg") +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/API/lit.cfg") diff --git a/lldb/lit/Suite/lldbtest.py b/lldb/test/API/lldbtest.py similarity index 100% rename from lldb/lit/Suite/lldbtest.py rename to lldb/test/API/lldbtest.py diff --git a/lldb/test/testcases b/lldb/test/API/testcases similarity index 100% rename from lldb/test/testcases rename to lldb/test/API/testcases diff --git a/lldb/test/use_lldb_suite.py b/lldb/test/API/use_lldb_suite.py similarity index 100% rename from lldb/test/use_lldb_suite.py rename to lldb/test/API/use_lldb_suite.py diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index 7080dc4520457..a5178764bfcbc 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -1,149 +1,117 @@ -function(add_python_test_target name test_script args comment) - set(PYTHON_TEST_COMMAND - ${PYTHON_EXECUTABLE} - ${test_script} - ${args} - ) - - add_custom_target(${name} - COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS} - COMMENT "${comment}" - USES_TERMINAL - ) - add_dependencies(${name} lldb-test-deps) -endfunction() - -# The default architecture with which to compile test executables is the default LLVM target -# architecture, which itself defaults to the host architecture. -string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH) -if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" ) - string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE}) -endif () - -# Allow the user to override the default by setting LLDB_TEST_ARCH -set(LLDB_TEST_ARCH - ${LLDB_DEFAULT_TEST_ARCH} - CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") - -# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script -set(LLDB_TEST_USER_ARGS - "" - CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") - -# The .noindex suffix is a marker for Spotlight to never index the -# build directory. LLDB queries Spotlight to locate .dSYM bundles -# based on the UUID embedded in a binary, and because the UUID is a -# hash of filename and .text section, there *will* be conflicts inside -# the build directory. -set(LLDB_TEST_COMMON_ARGS - --arch=${LLDB_TEST_ARCH} - -s - ${CMAKE_BINARY_DIR}/lldb-test-traces - -S nm - -u CXXFLAGS - -u CFLAGS - ) - -list(APPEND LLDB_TEST_COMMON_ARGS - --executable ${LLDB_TEST_EXECUTABLE} - --dsymutil ${LLDB_TEST_DSYMUTIL} - --filecheck ${LLDB_TEST_FILECHECK} - -C ${LLDB_TEST_C_COMPILER} - ) - -if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - # All tests are currently flaky on Windows, so rerun them all once when they fail. - set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues) - - set(LLDB_TEST_DEBUG_TEST_CRASHES - 0 - CACHE BOOL "(Windows only) Enables debugging of tests in the test suite by showing the crash dialog when lldb crashes") +# Test runner infrastructure for LLDB. This configures the LLDB test trees +# for use by Lit, and delegates to LLVM's lit test handlers. - set(LLDB_TEST_HIDE_CONSOLE_WINDOWS - 1 - CACHE BOOL "(Windows only) Hides the console window for an inferior when it is launched through the test suite") +add_subdirectory(API) - if (LLDB_TEST_DEBUG_TEST_CRASHES) - set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --enable-crash-dialog) - endif() - - if (NOT LLDB_TEST_HIDE_CONSOLE_WINDOWS) - set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --show-inferior-console) - endif() -endif() +# LLVM_BUILD_MODE is used in lit.site.cfg +if (CMAKE_CFG_INTDIR STREQUAL ".") + set(LLVM_BUILD_MODE ".") +else () + set(LLVM_BUILD_MODE "%(build_mode)s") +endif () -if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin") - list(APPEND LLDB_TEST_COMMON_ARGS - --env ARCHIVER=${CMAKE_AR} --env OBJCOPY=${CMAKE_OBJCOPY}) +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(LLDB_IS_64_BITS 1) endif() -if (NOT "${LLDB_LIT_TOOLS_DIR}" STREQUAL "") - if (NOT EXISTS "${LLDB_LIT_TOOLS_DIR}") - message(WARNING "LLDB_LIT_TOOLS_DIR ${LLDB_LIT_TOOLS_DIR} does not exist.") +get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY) +set(dotest_args_replacement ${LLVM_BUILD_MODE}) + +set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.") +set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.") + +if(LLDB_BUILT_STANDALONE) + # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder. + string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR}) + string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") + + # Remaining ones must be paths to the provided LLVM build-tree. + if(LLVM_CONFIGURATION_TYPES) + # LLDB uses single-config; LLVM multi-config; pick one and prefer Release types. + # Otherwise, if both use multi-config the default is fine. + if(NOT CMAKE_CONFIGURATION_TYPES) + if(RelWithDebInfo IN_LIST LLVM_CONFIGURATION_TYPES) + set(dotest_args_replacement RelWithDebInfo) + elseif(Release IN_LIST LLVM_CONFIGURATION_TYPES) + set(dotest_args_replacement Release) + else() + list(GET LLVM_CONFIGURATION_TYPES 0 dotest_args_replacement) + endif() + endif() + else() + # Common case: LLVM used a single-configuration generator like Ninja. + set(dotest_args_replacement ".") endif() endif() -if(CMAKE_HOST_APPLE) - if(LLDB_BUILD_FRAMEWORK) - get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) - list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_build_dir}/LLDB.framework) - endif() - - # Use the same identity for testing - get_property(code_sign_identity_used GLOBAL PROPERTY LLDB_DEBUGSERVER_CODESIGN_IDENTITY) - if(code_sign_identity_used) - list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${code_sign_identity_used}") - endif() +string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") +string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) + +add_lldb_test_dependency( + lit-cpuid + llc + lli + llvm-config + llvm-dwarfdump + llvm-nm + llvm-mc + llvm-objcopy + llvm-readobj + llvm-strip + ) - if(LLDB_USE_SYSTEM_DEBUGSERVER) - lldb_find_system_debugserver(system_debugserver_path) - add_custom_target(debugserver - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${system_debugserver_path} ${LLVM_RUNTIME_OUTPUT_INTDIR} - COMMENT "Copying the system debugserver to LLDB's binaries directory for testing.") - # The custom target for the system debugserver has no install target, so we - # need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list. - if (LLVM_DISTRIBUTION_COMPONENTS) - list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS debugserver) - set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} PARENT_SCOPE) - endif() - message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}") - list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver) - add_lldb_test_dependency(debugserver) - elseif(TARGET debugserver) - set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver) - message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}") - list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path}) - add_lldb_test_dependency(debugserver) - elseif(TARGET lldb-server) - set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server) - message(STATUS "LLDB Tests use just-built lldb-server: ${lldb_server_path}") - list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path}) - add_lldb_test_dependency(lldb-server) - else() - message(WARNING "LLDB Tests enabled, but no server available") - endif() +if(TARGET lld) + add_lldb_test_dependency(lld) endif() -set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}) -set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS}) +# the value is not canonicalized within LLVM +llvm_canonicalize_cmake_booleans( + LLDB_DISABLE_PYTHON + LLVM_ENABLE_ZLIB + LLVM_ENABLE_SHARED_LIBS + LLDB_IS_64_BITS) + +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Shell/lit.site.cfg.py + MAIN_CONFIG + ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit.cfg.py) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py + MAIN_CONFIG + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/API/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/API/lit.site.cfg) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit-lldb-init.in + ${CMAKE_CURRENT_BINARY_DIR}/Shell/lit-lldb-init) + +if(NOT LLDB_BUILT_STANDALONE) + add_lldb_test_dependency( + FileCheck + count + not + ) +endif() -add_custom_target(check-lldb) -add_dependencies(check-lldb lldb-test-deps) -set_target_properties(check-lldb PROPERTIES FOLDER "lldb misc") +add_lit_testsuite(check-lldb-lit "Running lldb lit test suite" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS lldb-test-deps + ) -# LLD is required to link test executables on Windows. -if (CMAKE_SYSTEM_NAME MATCHES "Windows") - if (TARGET lld) - add_lldb_test_dependency(lld) - else () - message(WARNING "lld required to test LLDB on Windows") - endif () -endif () +set_target_properties(check-lldb-lit PROPERTIES FOLDER "lldb tests") -# Run the lit-style tests and the unittests as part of the check-lldb target. -add_dependencies(check-lldb check-lldb-lit) +# If we're building with an in-tree clang, then list clang as a dependency +# to run tests. +if (TARGET clang) + add_dependencies(check-lldb-lit clang) +endif() -# This will add LLDB's test dependencies to the dependencies for check-all and -# include them in the test-depends target. -set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS}) +add_lit_testsuites(LLDB + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS lldb-test-deps + ) diff --git a/lldb/lit/Breakpoint/Inputs/case-sensitive.c b/lldb/test/Shell/Breakpoint/Inputs/case-sensitive.c similarity index 100% rename from lldb/lit/Breakpoint/Inputs/case-sensitive.c rename to lldb/test/Shell/Breakpoint/Inputs/case-sensitive.c diff --git a/lldb/lit/Breakpoint/Inputs/debug_addrx.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_addrx.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_addrx.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_addrx.yaml diff --git a/lldb/lit/Breakpoint/Inputs/debug_rnglist_basic.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_basic.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_rnglist_basic.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_basic.yaml diff --git a/lldb/lit/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml diff --git a/lldb/lit/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml diff --git a/lldb/lit/Breakpoint/Inputs/debug_rnglistx_rlex.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_rnglistx_rlex.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_rnglistx_rlex.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_rnglistx_rlex.yaml diff --git a/lldb/lit/Breakpoint/Inputs/implicit_const_form_support.yaml b/lldb/test/Shell/Breakpoint/Inputs/implicit_const_form_support.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/implicit_const_form_support.yaml rename to lldb/test/Shell/Breakpoint/Inputs/implicit_const_form_support.yaml diff --git a/lldb/lit/Breakpoint/Inputs/jitbp.cpp b/lldb/test/Shell/Breakpoint/Inputs/jitbp.cpp similarity index 100% rename from lldb/lit/Breakpoint/Inputs/jitbp.cpp rename to lldb/test/Shell/Breakpoint/Inputs/jitbp.cpp diff --git a/lldb/lit/Breakpoint/Inputs/ppc64-localentry.s b/lldb/test/Shell/Breakpoint/Inputs/ppc64-localentry.s similarity index 100% rename from lldb/lit/Breakpoint/Inputs/ppc64-localentry.s rename to lldb/test/Shell/Breakpoint/Inputs/ppc64-localentry.s diff --git a/lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.o.yaml b/lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.o.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.o.yaml rename to lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.o.yaml diff --git a/lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.yaml b/lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.yaml rename to lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml diff --git a/lldb/lit/Breakpoint/case-insensitive.test b/lldb/test/Shell/Breakpoint/case-insensitive.test similarity index 100% rename from lldb/lit/Breakpoint/case-insensitive.test rename to lldb/test/Shell/Breakpoint/case-insensitive.test diff --git a/lldb/lit/Breakpoint/case-sensitive.test b/lldb/test/Shell/Breakpoint/case-sensitive.test similarity index 100% rename from lldb/lit/Breakpoint/case-sensitive.test rename to lldb/test/Shell/Breakpoint/case-sensitive.test diff --git a/lldb/lit/Breakpoint/debug_addrx.test b/lldb/test/Shell/Breakpoint/debug_addrx.test similarity index 100% rename from lldb/lit/Breakpoint/debug_addrx.test rename to lldb/test/Shell/Breakpoint/debug_addrx.test diff --git a/lldb/lit/Breakpoint/debug_rnglist_basic.test b/lldb/test/Shell/Breakpoint/debug_rnglist_basic.test similarity index 100% rename from lldb/lit/Breakpoint/debug_rnglist_basic.test rename to lldb/test/Shell/Breakpoint/debug_rnglist_basic.test diff --git a/lldb/lit/Breakpoint/debug_rnglist_offset_pair.test b/lldb/test/Shell/Breakpoint/debug_rnglist_offset_pair.test similarity index 100% rename from lldb/lit/Breakpoint/debug_rnglist_offset_pair.test rename to lldb/test/Shell/Breakpoint/debug_rnglist_offset_pair.test diff --git a/lldb/lit/Breakpoint/debug_rnglist_rlestartend.test b/lldb/test/Shell/Breakpoint/debug_rnglist_rlestartend.test similarity index 100% rename from lldb/lit/Breakpoint/debug_rnglist_rlestartend.test rename to lldb/test/Shell/Breakpoint/debug_rnglist_rlestartend.test diff --git a/lldb/lit/Breakpoint/debug_rnglistx_rlex.test b/lldb/test/Shell/Breakpoint/debug_rnglistx_rlex.test similarity index 100% rename from lldb/lit/Breakpoint/debug_rnglistx_rlex.test rename to lldb/test/Shell/Breakpoint/debug_rnglistx_rlex.test diff --git a/lldb/lit/Breakpoint/implicit_const_form_support.test b/lldb/test/Shell/Breakpoint/implicit_const_form_support.test similarity index 100% rename from lldb/lit/Breakpoint/implicit_const_form_support.test rename to lldb/test/Shell/Breakpoint/implicit_const_form_support.test diff --git a/lldb/lit/Breakpoint/jitbp_elf.test b/lldb/test/Shell/Breakpoint/jitbp_elf.test similarity index 100% rename from lldb/lit/Breakpoint/jitbp_elf.test rename to lldb/test/Shell/Breakpoint/jitbp_elf.test diff --git a/lldb/lit/Breakpoint/ppc64-localentry.test b/lldb/test/Shell/Breakpoint/ppc64-localentry.test similarity index 100% rename from lldb/lit/Breakpoint/ppc64-localentry.test rename to lldb/test/Shell/Breakpoint/ppc64-localentry.test diff --git a/lldb/lit/Breakpoint/single-file-split-dwarf.test b/lldb/test/Shell/Breakpoint/single-file-split-dwarf.test similarity index 100% rename from lldb/lit/Breakpoint/single-file-split-dwarf.test rename to lldb/test/Shell/Breakpoint/single-file-split-dwarf.test diff --git a/lldb/lit/Breakpoint/split-dwarf-5-addrbase.test b/lldb/test/Shell/Breakpoint/split-dwarf-5-addrbase.test similarity index 100% rename from lldb/lit/Breakpoint/split-dwarf-5-addrbase.test rename to lldb/test/Shell/Breakpoint/split-dwarf-5-addrbase.test diff --git a/lldb/lit/Breakpoint/split-dwarf5-debug-stroffsets.test b/lldb/test/Shell/Breakpoint/split-dwarf5-debug-stroffsets.test similarity index 100% rename from lldb/lit/Breakpoint/split-dwarf5-debug-stroffsets.test rename to lldb/test/Shell/Breakpoint/split-dwarf5-debug-stroffsets.test diff --git a/lldb/lit/BuildScript/compiler-full-path.test b/lldb/test/Shell/BuildScript/compiler-full-path.test similarity index 100% rename from lldb/lit/BuildScript/compiler-full-path.test rename to lldb/test/Shell/BuildScript/compiler-full-path.test diff --git a/lldb/lit/BuildScript/modes.test b/lldb/test/Shell/BuildScript/modes.test similarity index 100% rename from lldb/lit/BuildScript/modes.test rename to lldb/test/Shell/BuildScript/modes.test diff --git a/lldb/lit/BuildScript/script-args.test b/lldb/test/Shell/BuildScript/script-args.test similarity index 100% rename from lldb/lit/BuildScript/script-args.test rename to lldb/test/Shell/BuildScript/script-args.test diff --git a/lldb/lit/BuildScript/toolchain-clang-cl.test b/lldb/test/Shell/BuildScript/toolchain-clang-cl.test similarity index 100% rename from lldb/lit/BuildScript/toolchain-clang-cl.test rename to lldb/test/Shell/BuildScript/toolchain-clang-cl.test diff --git a/lldb/lit/BuildScript/toolchain-clang.test b/lldb/test/Shell/BuildScript/toolchain-clang.test similarity index 100% rename from lldb/lit/BuildScript/toolchain-clang.test rename to lldb/test/Shell/BuildScript/toolchain-clang.test diff --git a/lldb/lit/BuildScript/toolchain-msvc.test b/lldb/test/Shell/BuildScript/toolchain-msvc.test similarity index 100% rename from lldb/lit/BuildScript/toolchain-msvc.test rename to lldb/test/Shell/BuildScript/toolchain-msvc.test diff --git a/lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test b/lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test similarity index 100% rename from lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test rename to lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test diff --git a/lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test b/lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test similarity index 100% rename from lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test rename to lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test diff --git a/lldb/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py b/lldb/test/Shell/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py similarity index 100% rename from lldb/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py rename to lldb/test/Shell/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py diff --git a/lldb/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg b/lldb/test/Shell/Commands/CommandScriptImmediateOutput/lit.local.cfg similarity index 100% rename from lldb/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg rename to lldb/test/Shell/Commands/CommandScriptImmediateOutput/lit.local.cfg diff --git a/lldb/lit/Commands/Inputs/frame.py b/lldb/test/Shell/Commands/Inputs/frame.py similarity index 100% rename from lldb/lit/Commands/Inputs/frame.py rename to lldb/test/Shell/Commands/Inputs/frame.py diff --git a/lldb/lit/Commands/Inputs/main.c b/lldb/test/Shell/Commands/Inputs/main.c similarity index 100% rename from lldb/lit/Commands/Inputs/main.c rename to lldb/test/Shell/Commands/Inputs/main.c diff --git a/lldb/lit/Commands/command-backtrace.test b/lldb/test/Shell/Commands/command-backtrace.test similarity index 100% rename from lldb/lit/Commands/command-backtrace.test rename to lldb/test/Shell/Commands/command-backtrace.test diff --git a/lldb/lit/Commands/command-regex-delete.test b/lldb/test/Shell/Commands/command-regex-delete.test similarity index 100% rename from lldb/lit/Commands/command-regex-delete.test rename to lldb/test/Shell/Commands/command-regex-delete.test diff --git a/lldb/lit/Commands/command-regex-unalias.test b/lldb/test/Shell/Commands/command-regex-unalias.test similarity index 100% rename from lldb/lit/Commands/command-regex-unalias.test rename to lldb/test/Shell/Commands/command-regex-unalias.test diff --git a/lldb/lit/Commands/command-script-import.test b/lldb/test/Shell/Commands/command-script-import.test similarity index 100% rename from lldb/lit/Commands/command-script-import.test rename to lldb/test/Shell/Commands/command-script-import.test diff --git a/lldb/lit/Commands/command-source.test b/lldb/test/Shell/Commands/command-source.test similarity index 100% rename from lldb/lit/Commands/command-source.test rename to lldb/test/Shell/Commands/command-source.test diff --git a/lldb/lit/Driver/Inputs/.lldbinit b/lldb/test/Shell/Driver/Inputs/.lldbinit similarity index 100% rename from lldb/lit/Driver/Inputs/.lldbinit rename to lldb/test/Shell/Driver/Inputs/.lldbinit diff --git a/lldb/lit/Driver/Inputs/Print0.in b/lldb/test/Shell/Driver/Inputs/Print0.in similarity index 100% rename from lldb/lit/Driver/Inputs/Print0.in rename to lldb/test/Shell/Driver/Inputs/Print0.in diff --git a/lldb/lit/Driver/Inputs/Print2.in b/lldb/test/Shell/Driver/Inputs/Print2.in similarity index 100% rename from lldb/lit/Driver/Inputs/Print2.in rename to lldb/test/Shell/Driver/Inputs/Print2.in diff --git a/lldb/lit/Driver/Inputs/Print4.in b/lldb/test/Shell/Driver/Inputs/Print4.in similarity index 100% rename from lldb/lit/Driver/Inputs/Print4.in rename to lldb/test/Shell/Driver/Inputs/Print4.in diff --git a/lldb/lit/Driver/Inputs/Print6.in b/lldb/test/Shell/Driver/Inputs/Print6.in similarity index 100% rename from lldb/lit/Driver/Inputs/Print6.in rename to lldb/test/Shell/Driver/Inputs/Print6.in diff --git a/lldb/lit/Driver/Inputs/convenience.in b/lldb/test/Shell/Driver/Inputs/convenience.in similarity index 100% rename from lldb/lit/Driver/Inputs/convenience.in rename to lldb/test/Shell/Driver/Inputs/convenience.in diff --git a/lldb/lit/Driver/Inputs/hello.c b/lldb/test/Shell/Driver/Inputs/hello.c similarity index 100% rename from lldb/lit/Driver/Inputs/hello.c rename to lldb/test/Shell/Driver/Inputs/hello.c diff --git a/lldb/lit/Driver/Inputs/hello.cpp b/lldb/test/Shell/Driver/Inputs/hello.cpp similarity index 100% rename from lldb/lit/Driver/Inputs/hello.cpp rename to lldb/test/Shell/Driver/Inputs/hello.cpp diff --git a/lldb/lit/Driver/Inputs/process_attach_pid.in b/lldb/test/Shell/Driver/Inputs/process_attach_pid.in similarity index 100% rename from lldb/lit/Driver/Inputs/process_attach_pid.in rename to lldb/test/Shell/Driver/Inputs/process_attach_pid.in diff --git a/lldb/lit/Driver/Inputs/syntax_error.py b/lldb/test/Shell/Driver/Inputs/syntax_error.py similarity index 100% rename from lldb/lit/Driver/Inputs/syntax_error.py rename to lldb/test/Shell/Driver/Inputs/syntax_error.py diff --git a/lldb/lit/Driver/LocalLLDBInit.test b/lldb/test/Shell/Driver/LocalLLDBInit.test similarity index 100% rename from lldb/lit/Driver/LocalLLDBInit.test rename to lldb/test/Shell/Driver/LocalLLDBInit.test diff --git a/lldb/lit/Driver/TestCommands.test b/lldb/test/Shell/Driver/TestCommands.test similarity index 100% rename from lldb/lit/Driver/TestCommands.test rename to lldb/test/Shell/Driver/TestCommands.test diff --git a/lldb/lit/Driver/TestConvenienceVariables.test b/lldb/test/Shell/Driver/TestConvenienceVariables.test similarity index 100% rename from lldb/lit/Driver/TestConvenienceVariables.test rename to lldb/test/Shell/Driver/TestConvenienceVariables.test diff --git a/lldb/lit/Driver/TestCore.test b/lldb/test/Shell/Driver/TestCore.test similarity index 100% rename from lldb/lit/Driver/TestCore.test rename to lldb/test/Shell/Driver/TestCore.test diff --git a/lldb/lit/Driver/TestFile.test b/lldb/test/Shell/Driver/TestFile.test similarity index 100% rename from lldb/lit/Driver/TestFile.test rename to lldb/test/Shell/Driver/TestFile.test diff --git a/lldb/lit/Driver/TestNoUseColor.test b/lldb/test/Shell/Driver/TestNoUseColor.test similarity index 100% rename from lldb/lit/Driver/TestNoUseColor.test rename to lldb/test/Shell/Driver/TestNoUseColor.test diff --git a/lldb/lit/Driver/TestProcessAttach.test b/lldb/test/Shell/Driver/TestProcessAttach.test similarity index 100% rename from lldb/lit/Driver/TestProcessAttach.test rename to lldb/test/Shell/Driver/TestProcessAttach.test diff --git a/lldb/lit/Driver/TestRepl.test b/lldb/test/Shell/Driver/TestRepl.test similarity index 100% rename from lldb/lit/Driver/TestRepl.test rename to lldb/test/Shell/Driver/TestRepl.test diff --git a/lldb/lit/Driver/TestSingleQuote.test b/lldb/test/Shell/Driver/TestSingleQuote.test similarity index 100% rename from lldb/lit/Driver/TestSingleQuote.test rename to lldb/test/Shell/Driver/TestSingleQuote.test diff --git a/lldb/lit/Driver/TestTarget.test b/lldb/test/Shell/Driver/TestTarget.test similarity index 100% rename from lldb/lit/Driver/TestTarget.test rename to lldb/test/Shell/Driver/TestTarget.test diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads.cpp similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads.cpp diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook.c b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook.c similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook.c rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook.c diff --git a/lldb/lit/ExecControl/StopHook/stop-hook-threads.test b/lldb/test/Shell/ExecControl/StopHook/stop-hook-threads.test similarity index 100% rename from lldb/lit/ExecControl/StopHook/stop-hook-threads.test rename to lldb/test/Shell/ExecControl/StopHook/stop-hook-threads.test diff --git a/lldb/lit/ExecControl/StopHook/stop-hook.test b/lldb/test/Shell/ExecControl/StopHook/stop-hook.test similarity index 100% rename from lldb/lit/ExecControl/StopHook/stop-hook.test rename to lldb/test/Shell/ExecControl/StopHook/stop-hook.test diff --git a/lldb/lit/Expr/Inputs/call-function.cpp b/lldb/test/Shell/Expr/Inputs/call-function.cpp similarity index 100% rename from lldb/lit/Expr/Inputs/call-function.cpp rename to lldb/test/Shell/Expr/Inputs/call-function.cpp diff --git a/lldb/lit/Expr/Inputs/ir-memory-map-basic b/lldb/test/Shell/Expr/Inputs/ir-memory-map-basic similarity index 100% rename from lldb/lit/Expr/Inputs/ir-memory-map-basic rename to lldb/test/Shell/Expr/Inputs/ir-memory-map-basic diff --git a/lldb/lit/Expr/Inputs/ir-memory-map-mix-malloc-free b/lldb/test/Shell/Expr/Inputs/ir-memory-map-mix-malloc-free similarity index 100% rename from lldb/lit/Expr/Inputs/ir-memory-map-mix-malloc-free rename to lldb/test/Shell/Expr/Inputs/ir-memory-map-mix-malloc-free diff --git a/lldb/lit/Expr/Inputs/ir-memory-map-overlap1 b/lldb/test/Shell/Expr/Inputs/ir-memory-map-overlap1 similarity index 100% rename from lldb/lit/Expr/Inputs/ir-memory-map-overlap1 rename to lldb/test/Shell/Expr/Inputs/ir-memory-map-overlap1 diff --git a/lldb/lit/Expr/TestIRMemoryMap.test b/lldb/test/Shell/Expr/TestIRMemoryMap.test similarity index 100% rename from lldb/lit/Expr/TestIRMemoryMap.test rename to lldb/test/Shell/Expr/TestIRMemoryMap.test diff --git a/lldb/lit/Expr/TestIRMemoryMapWindows.test b/lldb/test/Shell/Expr/TestIRMemoryMapWindows.test similarity index 100% rename from lldb/lit/Expr/TestIRMemoryMapWindows.test rename to lldb/test/Shell/Expr/TestIRMemoryMapWindows.test diff --git a/lldb/lit/Expr/TestMultilineExpr.test b/lldb/test/Shell/Expr/TestMultilineExpr.test similarity index 100% rename from lldb/lit/Expr/TestMultilineExpr.test rename to lldb/test/Shell/Expr/TestMultilineExpr.test diff --git a/lldb/lit/Expr/TestTypeOfDeclTypeExpr.test b/lldb/test/Shell/Expr/TestTypeOfDeclTypeExpr.test similarity index 100% rename from lldb/lit/Expr/TestTypeOfDeclTypeExpr.test rename to lldb/test/Shell/Expr/TestTypeOfDeclTypeExpr.test diff --git a/lldb/lit/Heap/Inputs/cstr.c b/lldb/test/Shell/Heap/Inputs/cstr.c similarity index 100% rename from lldb/lit/Heap/Inputs/cstr.c rename to lldb/test/Shell/Heap/Inputs/cstr.c diff --git a/lldb/lit/Heap/heap-cstr.test b/lldb/test/Shell/Heap/heap-cstr.test similarity index 100% rename from lldb/lit/Heap/heap-cstr.test rename to lldb/test/Shell/Heap/heap-cstr.test diff --git a/lldb/lit/Host/Inputs/simple.c b/lldb/test/Shell/Host/Inputs/simple.c similarity index 100% rename from lldb/lit/Host/Inputs/simple.c rename to lldb/test/Shell/Host/Inputs/simple.c diff --git a/lldb/lit/Host/TestCustomShell.test b/lldb/test/Shell/Host/TestCustomShell.test similarity index 100% rename from lldb/lit/Host/TestCustomShell.test rename to lldb/test/Shell/Host/TestCustomShell.test diff --git a/lldb/lit/Minidump/Inputs/linux-x86_64.syms b/lldb/test/Shell/Minidump/Inputs/linux-x86_64.syms similarity index 100% rename from lldb/lit/Minidump/Inputs/linux-x86_64.syms rename to lldb/test/Shell/Minidump/Inputs/linux-x86_64.syms diff --git a/lldb/lit/Minidump/Inputs/linux-x86_64.yaml b/lldb/test/Shell/Minidump/Inputs/linux-x86_64.yaml similarity index 100% rename from lldb/lit/Minidump/Inputs/linux-x86_64.yaml rename to lldb/test/Shell/Minidump/Inputs/linux-x86_64.yaml diff --git a/lldb/lit/Minidump/Windows/Inputs/find-module.dmp.yaml b/lldb/test/Shell/Minidump/Windows/Inputs/find-module.dmp.yaml similarity index 100% rename from lldb/lit/Minidump/Windows/Inputs/find-module.dmp.yaml rename to lldb/test/Shell/Minidump/Windows/Inputs/find-module.dmp.yaml diff --git a/lldb/lit/Minidump/Windows/Inputs/find-module.exe.yaml b/lldb/test/Shell/Minidump/Windows/Inputs/find-module.exe.yaml similarity index 100% rename from lldb/lit/Minidump/Windows/Inputs/find-module.exe.yaml rename to lldb/test/Shell/Minidump/Windows/Inputs/find-module.exe.yaml diff --git a/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp b/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp rename to lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp diff --git a/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp b/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp rename to lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp diff --git a/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit b/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit rename to lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit diff --git a/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb b/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb rename to lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb diff --git a/lldb/lit/Minidump/Windows/Sigsegv/sigsegv.test b/lldb/test/Shell/Minidump/Windows/Sigsegv/sigsegv.test similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/sigsegv.test rename to lldb/test/Shell/Minidump/Windows/Sigsegv/sigsegv.test diff --git a/lldb/lit/Minidump/Windows/find-module.test b/lldb/test/Shell/Minidump/Windows/find-module.test similarity index 100% rename from lldb/lit/Minidump/Windows/find-module.test rename to lldb/test/Shell/Minidump/Windows/find-module.test diff --git a/lldb/lit/Minidump/breakpad-symbols.test b/lldb/test/Shell/Minidump/breakpad-symbols.test similarity index 100% rename from lldb/lit/Minidump/breakpad-symbols.test rename to lldb/test/Shell/Minidump/breakpad-symbols.test diff --git a/lldb/lit/Minidump/disassemble-no-module.yaml b/lldb/test/Shell/Minidump/disassemble-no-module.yaml similarity index 100% rename from lldb/lit/Minidump/disassemble-no-module.yaml rename to lldb/test/Shell/Minidump/disassemble-no-module.yaml diff --git a/lldb/lit/Minidump/dump-all.test b/lldb/test/Shell/Minidump/dump-all.test similarity index 100% rename from lldb/lit/Minidump/dump-all.test rename to lldb/test/Shell/Minidump/dump-all.test diff --git a/lldb/lit/Minidump/fb-dump.test b/lldb/test/Shell/Minidump/fb-dump.test similarity index 100% rename from lldb/lit/Minidump/fb-dump.test rename to lldb/test/Shell/Minidump/fb-dump.test diff --git a/lldb/lit/Minidump/lit.local.cfg b/lldb/test/Shell/Minidump/lit.local.cfg similarity index 100% rename from lldb/lit/Minidump/lit.local.cfg rename to lldb/test/Shell/Minidump/lit.local.cfg diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-linux.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-linux.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-windows.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-windows.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml diff --git a/lldb/lit/ObjectFile/Breakpad/breakpad-identification.test b/lldb/test/Shell/ObjectFile/Breakpad/breakpad-identification.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/breakpad-identification.test rename to lldb/test/Shell/ObjectFile/Breakpad/breakpad-identification.test diff --git a/lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test b/lldb/test/Shell/ObjectFile/Breakpad/discontiguous-sections.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test rename to lldb/test/Shell/ObjectFile/Breakpad/discontiguous-sections.test diff --git a/lldb/lit/ObjectFile/Breakpad/lit.local.cfg b/lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/lit.local.cfg rename to lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg diff --git a/lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test b/lldb/test/Shell/ObjectFile/Breakpad/sections-trailing-func.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test rename to lldb/test/Shell/ObjectFile/Breakpad/sections-trailing-func.test diff --git a/lldb/lit/ObjectFile/Breakpad/sections.test b/lldb/test/Shell/ObjectFile/Breakpad/sections.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/sections.test rename to lldb/test/Shell/ObjectFile/Breakpad/sections.test diff --git a/lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test b/lldb/test/Shell/ObjectFile/Breakpad/uuid-matching-mac.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test rename to lldb/test/Shell/ObjectFile/Breakpad/uuid-matching-mac.test diff --git a/lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf b/lldb/test/Shell/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf similarity index 100% rename from lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf rename to lldb/test/Shell/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf diff --git a/lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c b/lldb/test/Shell/ObjectFile/ELF/Inputs/minidebuginfo-main.c similarity index 100% rename from lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c rename to lldb/test/Shell/ObjectFile/ELF/Inputs/minidebuginfo-main.c diff --git a/lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core b/lldb/test/Shell/ObjectFile/ELF/Inputs/netbsd-amd64.core similarity index 100% rename from lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core rename to lldb/test/Shell/ObjectFile/ELF/Inputs/netbsd-amd64.core diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-empty.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-empty.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-section.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-section.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml diff --git a/lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml b/lldb/test/Shell/ObjectFile/ELF/aarch64-relocations.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml rename to lldb/test/Shell/ObjectFile/ELF/aarch64-relocations.yaml diff --git a/lldb/lit/ObjectFile/ELF/base-address.yaml b/lldb/test/Shell/ObjectFile/ELF/base-address.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/base-address.yaml rename to lldb/test/Shell/ObjectFile/ELF/base-address.yaml diff --git a/lldb/lit/ObjectFile/ELF/basic-info.yaml b/lldb/test/Shell/ObjectFile/ELF/basic-info.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/basic-info.yaml rename to lldb/test/Shell/ObjectFile/ELF/basic-info.yaml diff --git a/lldb/lit/ObjectFile/ELF/build-id-case.yaml b/lldb/test/Shell/ObjectFile/ELF/build-id-case.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/build-id-case.yaml rename to lldb/test/Shell/ObjectFile/ELF/build-id-case.yaml diff --git a/lldb/lit/ObjectFile/ELF/compressed-sections.yaml b/lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/compressed-sections.yaml rename to lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml diff --git a/lldb/lit/ObjectFile/ELF/duplicate-section.yaml b/lldb/test/Shell/ObjectFile/ELF/duplicate-section.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/duplicate-section.yaml rename to lldb/test/Shell/ObjectFile/ELF/duplicate-section.yaml diff --git a/lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml b/lldb/test/Shell/ObjectFile/ELF/gnu-debuglink.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml rename to lldb/test/Shell/ObjectFile/ELF/gnu-debuglink.yaml diff --git a/lldb/lit/ObjectFile/ELF/many-sections.s b/lldb/test/Shell/ObjectFile/ELF/many-sections.s similarity index 100% rename from lldb/lit/ObjectFile/ELF/many-sections.s rename to lldb/test/Shell/ObjectFile/ELF/many-sections.s diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml rename to lldb/test/Shell/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-find-symbols.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml rename to lldb/test/Shell/ObjectFile/ELF/minidebuginfo-find-symbols.yaml diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-no-lzma.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml rename to lldb/test/Shell/ObjectFile/ELF/minidebuginfo-no-lzma.yaml diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test similarity index 100% rename from lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test rename to lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test diff --git a/lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test b/lldb/test/Shell/ObjectFile/ELF/netbsd-core-amd64.test similarity index 100% rename from lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test rename to lldb/test/Shell/ObjectFile/ELF/netbsd-core-amd64.test diff --git a/lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml b/lldb/test/Shell/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml rename to lldb/test/Shell/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-addresses.yaml b/lldb/test/Shell/ObjectFile/ELF/section-addresses.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-addresses.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-addresses.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-overlap.yaml b/lldb/test/Shell/ObjectFile/ELF/section-overlap.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-overlap.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-overlap.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-permissions.yaml b/lldb/test/Shell/ObjectFile/ELF/section-permissions.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-permissions.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-permissions.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml b/lldb/test/Shell/ObjectFile/ELF/section-types-edgecases.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-types-edgecases.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-types.yaml b/lldb/test/Shell/ObjectFile/ELF/section-types.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-types.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-types.yaml diff --git a/lldb/lit/ObjectFile/ELF/short-build-id.yaml b/lldb/test/Shell/ObjectFile/ELF/short-build-id.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/short-build-id.yaml rename to lldb/test/Shell/ObjectFile/ELF/short-build-id.yaml diff --git a/lldb/lit/ObjectFile/MachO/lc_build_version.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/lc_build_version.yaml rename to lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml diff --git a/lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml rename to lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml diff --git a/lldb/lit/ObjectFile/MachO/lc_version_min.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/lc_version_min.yaml rename to lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml diff --git a/lldb/lit/ObjectFile/MachO/subsections.yaml b/lldb/test/Shell/ObjectFile/MachO/subsections.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/subsections.yaml rename to lldb/test/Shell/ObjectFile/MachO/subsections.yaml diff --git a/lldb/lit/ObjectFile/MachO/symtab.yaml b/lldb/test/Shell/ObjectFile/MachO/symtab.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/symtab.yaml rename to lldb/test/Shell/ObjectFile/MachO/symtab.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml b/lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml b/lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm64.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm64.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/basic-info.yaml b/lldb/test/Shell/ObjectFile/PECOFF/basic-info.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/basic-info.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/basic-info.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/dep-modules.yaml b/lldb/test/Shell/ObjectFile/PECOFF/dep-modules.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/dep-modules.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/dep-modules.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml b/lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/lit.local.cfg b/lldb/test/Shell/ObjectFile/PECOFF/lit.local.cfg similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/lit.local.cfg rename to lldb/test/Shell/ObjectFile/PECOFF/lit.local.cfg diff --git a/lldb/lit/ObjectFile/PECOFF/sections-names.yaml b/lldb/test/Shell/ObjectFile/PECOFF/sections-names.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/sections-names.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/sections-names.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/subsections.yaml b/lldb/test/Shell/ObjectFile/PECOFF/subsections.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/subsections.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/subsections.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/uuid.yaml b/lldb/test/Shell/ObjectFile/PECOFF/uuid.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/uuid.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/uuid.yaml diff --git a/lldb/lit/ObjectFile/lit.local.cfg b/lldb/test/Shell/ObjectFile/lit.local.cfg similarity index 100% rename from lldb/lit/ObjectFile/lit.local.cfg rename to lldb/test/Shell/ObjectFile/lit.local.cfg diff --git a/lldb/lit/Process/Inputs/env.cpp b/lldb/test/Shell/Process/Inputs/env.cpp similarity index 100% rename from lldb/lit/Process/Inputs/env.cpp rename to lldb/test/Shell/Process/Inputs/env.cpp diff --git a/lldb/lit/Process/TestEnvironment.test b/lldb/test/Shell/Process/TestEnvironment.test similarity index 100% rename from lldb/lit/Process/TestEnvironment.test rename to lldb/test/Shell/Process/TestEnvironment.test diff --git a/lldb/lit/Process/Windows/exception_access_violation.cpp b/lldb/test/Shell/Process/Windows/exception_access_violation.cpp similarity index 100% rename from lldb/lit/Process/Windows/exception_access_violation.cpp rename to lldb/test/Shell/Process/Windows/exception_access_violation.cpp diff --git a/lldb/lit/Python/crashlog.test b/lldb/test/Shell/Python/crashlog.test similarity index 97% rename from lldb/lit/Python/crashlog.test rename to lldb/test/Shell/Python/crashlog.test index 7ea7c0b5d74af..24d72eae41fa9 100644 --- a/lldb/lit/Python/crashlog.test +++ b/lldb/test/Shell/Python/crashlog.test @@ -1,6 +1,6 @@ # -*- python -*- # REQUIRES: system-darwin -# RUN: cd %S/../../examples/python && cat %s | %lldb | FileCheck %s +# RUN: cd %S/../../../examples/python && cat %s | %lldb | FileCheck %s # CHECK-LABEL: {{S}}KIP BEYOND CHECKS script import crashlog @@ -44,7 +44,7 @@ images = [ # CHECK: (0) # CHECK: 01234 # CHECK: /tmp/MyApp Pro.app/MyApp Pro - + "0x7fff63f20000 - 0x7fff63f77ff7 libc++.1.dylib (400.9.4) /usr/lib/libc++.1.dylib" # CHECK: 0x7fff63f20000 # CHECK: 0x7fff63f77ff7 diff --git a/lldb/lit/Quit/TestQuitExitCode-30.test b/lldb/test/Shell/Quit/TestQuitExitCode-30.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCode-30.test rename to lldb/test/Shell/Quit/TestQuitExitCode-30.test diff --git a/lldb/lit/Quit/TestQuitExitCode0.test b/lldb/test/Shell/Quit/TestQuitExitCode0.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCode0.test rename to lldb/test/Shell/Quit/TestQuitExitCode0.test diff --git a/lldb/lit/Quit/TestQuitExitCode30.test b/lldb/test/Shell/Quit/TestQuitExitCode30.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCode30.test rename to lldb/test/Shell/Quit/TestQuitExitCode30.test diff --git a/lldb/lit/Quit/TestQuitExitCodeHex0.test b/lldb/test/Shell/Quit/TestQuitExitCodeHex0.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeHex0.test rename to lldb/test/Shell/Quit/TestQuitExitCodeHex0.test diff --git a/lldb/lit/Quit/TestQuitExitCodeHexA.test b/lldb/test/Shell/Quit/TestQuitExitCodeHexA.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeHexA.test rename to lldb/test/Shell/Quit/TestQuitExitCodeHexA.test diff --git a/lldb/lit/Quit/TestQuitExitCodeImplicit0.test b/lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeImplicit0.test rename to lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test diff --git a/lldb/lit/Quit/TestQuitExitCodeNonInt.test b/lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeNonInt.test rename to lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test diff --git a/lldb/lit/Quit/TestQuitExitCodeTooManyArgs.test b/lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeTooManyArgs.test rename to lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test diff --git a/lldb/lit/Quit/expect_exit_code.py b/lldb/test/Shell/Quit/expect_exit_code.py similarity index 100% rename from lldb/lit/Quit/expect_exit_code.py rename to lldb/test/Shell/Quit/expect_exit_code.py diff --git a/lldb/lit/Register/Inputs/x86-64-gp-read.cpp b/lldb/test/Shell/Register/Inputs/x86-64-gp-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-64-gp-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-64-gp-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-64-gp-write.cpp b/lldb/test/Shell/Register/Inputs/x86-64-gp-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-64-gp-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-64-gp-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-64-read.cpp b/lldb/test/Shell/Register/Inputs/x86-64-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-64-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-64-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-64-write.cpp b/lldb/test/Shell/Register/Inputs/x86-64-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-64-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-64-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-gp-read.cpp b/lldb/test/Shell/Register/Inputs/x86-gp-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-gp-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-gp-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-gp-write.cpp b/lldb/test/Shell/Register/Inputs/x86-gp-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-gp-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-gp-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-mm-xmm-read.cpp b/lldb/test/Shell/Register/Inputs/x86-mm-xmm-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-mm-xmm-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-mm-xmm-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp b/lldb/test/Shell/Register/Inputs/x86-mm-xmm-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-mm-xmm-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-ymm-read.cpp b/lldb/test/Shell/Register/Inputs/x86-ymm-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-ymm-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-ymm-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-ymm-write.cpp b/lldb/test/Shell/Register/Inputs/x86-ymm-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-ymm-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-ymm-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-zmm-read.cpp b/lldb/test/Shell/Register/Inputs/x86-zmm-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-zmm-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-zmm-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-zmm-write.cpp b/lldb/test/Shell/Register/Inputs/x86-zmm-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-zmm-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-zmm-write.cpp diff --git a/lldb/lit/Register/x86-64-gp-read.test b/lldb/test/Shell/Register/x86-64-gp-read.test similarity index 100% rename from lldb/lit/Register/x86-64-gp-read.test rename to lldb/test/Shell/Register/x86-64-gp-read.test diff --git a/lldb/lit/Register/x86-64-gp-write.test b/lldb/test/Shell/Register/x86-64-gp-write.test similarity index 100% rename from lldb/lit/Register/x86-64-gp-write.test rename to lldb/test/Shell/Register/x86-64-gp-write.test diff --git a/lldb/lit/Register/x86-64-read.test b/lldb/test/Shell/Register/x86-64-read.test similarity index 100% rename from lldb/lit/Register/x86-64-read.test rename to lldb/test/Shell/Register/x86-64-read.test diff --git a/lldb/lit/Register/x86-64-write.test b/lldb/test/Shell/Register/x86-64-write.test similarity index 100% rename from lldb/lit/Register/x86-64-write.test rename to lldb/test/Shell/Register/x86-64-write.test diff --git a/lldb/lit/Register/x86-64-xmm16-read.test b/lldb/test/Shell/Register/x86-64-xmm16-read.test similarity index 100% rename from lldb/lit/Register/x86-64-xmm16-read.test rename to lldb/test/Shell/Register/x86-64-xmm16-read.test diff --git a/lldb/lit/Register/x86-64-xmm16-write.test b/lldb/test/Shell/Register/x86-64-xmm16-write.test similarity index 100% rename from lldb/lit/Register/x86-64-xmm16-write.test rename to lldb/test/Shell/Register/x86-64-xmm16-write.test diff --git a/lldb/lit/Register/x86-64-ymm-read.test b/lldb/test/Shell/Register/x86-64-ymm-read.test similarity index 100% rename from lldb/lit/Register/x86-64-ymm-read.test rename to lldb/test/Shell/Register/x86-64-ymm-read.test diff --git a/lldb/lit/Register/x86-64-ymm-write.test b/lldb/test/Shell/Register/x86-64-ymm-write.test similarity index 100% rename from lldb/lit/Register/x86-64-ymm-write.test rename to lldb/test/Shell/Register/x86-64-ymm-write.test diff --git a/lldb/lit/Register/x86-64-ymm16-read.test b/lldb/test/Shell/Register/x86-64-ymm16-read.test similarity index 100% rename from lldb/lit/Register/x86-64-ymm16-read.test rename to lldb/test/Shell/Register/x86-64-ymm16-read.test diff --git a/lldb/lit/Register/x86-64-ymm16-write.test b/lldb/test/Shell/Register/x86-64-ymm16-write.test similarity index 100% rename from lldb/lit/Register/x86-64-ymm16-write.test rename to lldb/test/Shell/Register/x86-64-ymm16-write.test diff --git a/lldb/lit/Register/x86-64-zmm-read.test b/lldb/test/Shell/Register/x86-64-zmm-read.test similarity index 100% rename from lldb/lit/Register/x86-64-zmm-read.test rename to lldb/test/Shell/Register/x86-64-zmm-read.test diff --git a/lldb/lit/Register/x86-64-zmm-write.test b/lldb/test/Shell/Register/x86-64-zmm-write.test similarity index 100% rename from lldb/lit/Register/x86-64-zmm-write.test rename to lldb/test/Shell/Register/x86-64-zmm-write.test diff --git a/lldb/lit/Register/x86-gp-read.test b/lldb/test/Shell/Register/x86-gp-read.test similarity index 100% rename from lldb/lit/Register/x86-gp-read.test rename to lldb/test/Shell/Register/x86-gp-read.test diff --git a/lldb/lit/Register/x86-gp-write.test b/lldb/test/Shell/Register/x86-gp-write.test similarity index 100% rename from lldb/lit/Register/x86-gp-write.test rename to lldb/test/Shell/Register/x86-gp-write.test diff --git a/lldb/lit/Register/x86-mm-xmm-read.test b/lldb/test/Shell/Register/x86-mm-xmm-read.test similarity index 100% rename from lldb/lit/Register/x86-mm-xmm-read.test rename to lldb/test/Shell/Register/x86-mm-xmm-read.test diff --git a/lldb/lit/Register/x86-mm-xmm-write.test b/lldb/test/Shell/Register/x86-mm-xmm-write.test similarity index 100% rename from lldb/lit/Register/x86-mm-xmm-write.test rename to lldb/test/Shell/Register/x86-mm-xmm-write.test diff --git a/lldb/lit/Register/x86-ymm-read.test b/lldb/test/Shell/Register/x86-ymm-read.test similarity index 100% rename from lldb/lit/Register/x86-ymm-read.test rename to lldb/test/Shell/Register/x86-ymm-read.test diff --git a/lldb/lit/Register/x86-ymm-write.test b/lldb/test/Shell/Register/x86-ymm-write.test similarity index 100% rename from lldb/lit/Register/x86-ymm-write.test rename to lldb/test/Shell/Register/x86-ymm-write.test diff --git a/lldb/lit/Register/x86-zmm-read.test b/lldb/test/Shell/Register/x86-zmm-read.test similarity index 100% rename from lldb/lit/Register/x86-zmm-read.test rename to lldb/test/Shell/Register/x86-zmm-read.test diff --git a/lldb/lit/Register/x86-zmm-write.test b/lldb/test/Shell/Register/x86-zmm-write.test similarity index 100% rename from lldb/lit/Register/x86-zmm-write.test rename to lldb/test/Shell/Register/x86-zmm-write.test diff --git a/lldb/lit/Reproducer/Functionalities/Inputs/DataFormatter.in b/lldb/test/Shell/Reproducer/Functionalities/Inputs/DataFormatter.in similarity index 100% rename from lldb/lit/Reproducer/Functionalities/Inputs/DataFormatter.in rename to lldb/test/Shell/Reproducer/Functionalities/Inputs/DataFormatter.in diff --git a/lldb/lit/Reproducer/Functionalities/Inputs/foo.cpp b/lldb/test/Shell/Reproducer/Functionalities/Inputs/foo.cpp similarity index 100% rename from lldb/lit/Reproducer/Functionalities/Inputs/foo.cpp rename to lldb/test/Shell/Reproducer/Functionalities/Inputs/foo.cpp diff --git a/lldb/lit/Reproducer/Functionalities/Inputs/stepping.c b/lldb/test/Shell/Reproducer/Functionalities/Inputs/stepping.c similarity index 100% rename from lldb/lit/Reproducer/Functionalities/Inputs/stepping.c rename to lldb/test/Shell/Reproducer/Functionalities/Inputs/stepping.c diff --git a/lldb/lit/Reproducer/Functionalities/TestDataFormatter.test b/lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test similarity index 100% rename from lldb/lit/Reproducer/Functionalities/TestDataFormatter.test rename to lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test diff --git a/lldb/lit/Reproducer/Functionalities/TestImageList.test b/lldb/test/Shell/Reproducer/Functionalities/TestImageList.test similarity index 100% rename from lldb/lit/Reproducer/Functionalities/TestImageList.test rename to lldb/test/Shell/Reproducer/Functionalities/TestImageList.test diff --git a/lldb/lit/Reproducer/Functionalities/TestStepping.test b/lldb/test/Shell/Reproducer/Functionalities/TestStepping.test similarity index 100% rename from lldb/lit/Reproducer/Functionalities/TestStepping.test rename to lldb/test/Shell/Reproducer/Functionalities/TestStepping.test diff --git a/lldb/lit/Reproducer/Inputs/FileCapture.in b/lldb/test/Shell/Reproducer/Inputs/FileCapture.in similarity index 100% rename from lldb/lit/Reproducer/Inputs/FileCapture.in rename to lldb/test/Shell/Reproducer/Inputs/FileCapture.in diff --git a/lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in b/lldb/test/Shell/Reproducer/Inputs/GDBRemoteCapture.in similarity index 100% rename from lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in rename to lldb/test/Shell/Reproducer/Inputs/GDBRemoteCapture.in diff --git a/lldb/lit/Reproducer/Inputs/simple.c b/lldb/test/Shell/Reproducer/Inputs/simple.c similarity index 100% rename from lldb/lit/Reproducer/Inputs/simple.c rename to lldb/test/Shell/Reproducer/Inputs/simple.c diff --git a/lldb/lit/Reproducer/Modules/Inputs/Bar.h b/lldb/test/Shell/Reproducer/Modules/Inputs/Bar.h similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/Bar.h rename to lldb/test/Shell/Reproducer/Modules/Inputs/Bar.h diff --git a/lldb/lit/Reproducer/Modules/Inputs/Foo.h b/lldb/test/Shell/Reproducer/Modules/Inputs/Foo.h similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/Foo.h rename to lldb/test/Shell/Reproducer/Modules/Inputs/Foo.h diff --git a/lldb/lit/Reproducer/Modules/Inputs/ModuleCXX.in b/lldb/test/Shell/Reproducer/Modules/Inputs/ModuleCXX.in similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/ModuleCXX.in rename to lldb/test/Shell/Reproducer/Modules/Inputs/ModuleCXX.in diff --git a/lldb/lit/Reproducer/Modules/Inputs/main.cpp b/lldb/test/Shell/Reproducer/Modules/Inputs/main.cpp similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/main.cpp rename to lldb/test/Shell/Reproducer/Modules/Inputs/main.cpp diff --git a/lldb/lit/Reproducer/Modules/Inputs/module.modulemap b/lldb/test/Shell/Reproducer/Modules/Inputs/module.modulemap similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/module.modulemap rename to lldb/test/Shell/Reproducer/Modules/Inputs/module.modulemap diff --git a/lldb/lit/Reproducer/Modules/TestModuleCXX.test b/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test similarity index 100% rename from lldb/lit/Reproducer/Modules/TestModuleCXX.test rename to lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test diff --git a/lldb/lit/Reproducer/TestDriverOptions.test b/lldb/test/Shell/Reproducer/TestDriverOptions.test similarity index 100% rename from lldb/lit/Reproducer/TestDriverOptions.test rename to lldb/test/Shell/Reproducer/TestDriverOptions.test diff --git a/lldb/lit/Reproducer/TestDump.test b/lldb/test/Shell/Reproducer/TestDump.test similarity index 100% rename from lldb/lit/Reproducer/TestDump.test rename to lldb/test/Shell/Reproducer/TestDump.test diff --git a/lldb/lit/Reproducer/TestFileRepro.test b/lldb/test/Shell/Reproducer/TestFileRepro.test similarity index 100% rename from lldb/lit/Reproducer/TestFileRepro.test rename to lldb/test/Shell/Reproducer/TestFileRepro.test diff --git a/lldb/lit/Reproducer/TestGDBRemoteRepro.test b/lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test similarity index 100% rename from lldb/lit/Reproducer/TestGDBRemoteRepro.test rename to lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test diff --git a/lldb/lit/Reproducer/TestRelativePath.test b/lldb/test/Shell/Reproducer/TestRelativePath.test similarity index 100% rename from lldb/lit/Reproducer/TestRelativePath.test rename to lldb/test/Shell/Reproducer/TestRelativePath.test diff --git a/lldb/lit/Reproducer/TestReuseDirectory.test b/lldb/test/Shell/Reproducer/TestReuseDirectory.test similarity index 100% rename from lldb/lit/Reproducer/TestReuseDirectory.test rename to lldb/test/Shell/Reproducer/TestReuseDirectory.test diff --git a/lldb/lit/Reproducer/TestSynchronous.test b/lldb/test/Shell/Reproducer/TestSynchronous.test similarity index 100% rename from lldb/lit/Reproducer/TestSynchronous.test rename to lldb/test/Shell/Reproducer/TestSynchronous.test diff --git a/lldb/lit/Settings/Inputs/DontStopCommandSource.in b/lldb/test/Shell/Settings/Inputs/DontStopCommandSource.in similarity index 100% rename from lldb/lit/Settings/Inputs/DontStopCommandSource.in rename to lldb/test/Shell/Settings/Inputs/DontStopCommandSource.in diff --git a/lldb/lit/Settings/Inputs/EchoCommandsAll.out b/lldb/test/Shell/Settings/Inputs/EchoCommandsAll.out similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsAll.out rename to lldb/test/Shell/Settings/Inputs/EchoCommandsAll.out diff --git a/lldb/lit/Settings/Inputs/EchoCommandsNoComments.out b/lldb/test/Shell/Settings/Inputs/EchoCommandsNoComments.out similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsNoComments.out rename to lldb/test/Shell/Settings/Inputs/EchoCommandsNoComments.out diff --git a/lldb/lit/Settings/Inputs/EchoCommandsNone.out b/lldb/test/Shell/Settings/Inputs/EchoCommandsNone.out similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsNone.out rename to lldb/test/Shell/Settings/Inputs/EchoCommandsNone.out diff --git a/lldb/lit/Settings/Inputs/EchoCommandsQuiet.out b/lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsQuiet.out rename to lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out diff --git a/lldb/lit/Settings/Inputs/EchoCommandsTest.in b/lldb/test/Shell/Settings/Inputs/EchoCommandsTest.in similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsTest.in rename to lldb/test/Shell/Settings/Inputs/EchoCommandsTest.in diff --git a/lldb/lit/Settings/Inputs/StopCommandSource.in b/lldb/test/Shell/Settings/Inputs/StopCommandSource.in similarity index 100% rename from lldb/lit/Settings/Inputs/StopCommandSource.in rename to lldb/test/Shell/Settings/Inputs/StopCommandSource.in diff --git a/lldb/lit/Settings/Inputs/main.c b/lldb/test/Shell/Settings/Inputs/main.c similarity index 100% rename from lldb/lit/Settings/Inputs/main.c rename to lldb/test/Shell/Settings/Inputs/main.c diff --git a/lldb/lit/Settings/TestDisableColor.test b/lldb/test/Shell/Settings/TestDisableColor.test similarity index 100% rename from lldb/lit/Settings/TestDisableColor.test rename to lldb/test/Shell/Settings/TestDisableColor.test diff --git a/lldb/lit/Settings/TestDisassemblyFormat.test b/lldb/test/Shell/Settings/TestDisassemblyFormat.test similarity index 100% rename from lldb/lit/Settings/TestDisassemblyFormat.test rename to lldb/test/Shell/Settings/TestDisassemblyFormat.test diff --git a/lldb/lit/Settings/TestEchoCommands.test b/lldb/test/Shell/Settings/TestEchoCommands.test similarity index 100% rename from lldb/lit/Settings/TestEchoCommands.test rename to lldb/test/Shell/Settings/TestEchoCommands.test diff --git a/lldb/lit/Settings/TestFrameFormatColor.test b/lldb/test/Shell/Settings/TestFrameFormatColor.test similarity index 100% rename from lldb/lit/Settings/TestFrameFormatColor.test rename to lldb/test/Shell/Settings/TestFrameFormatColor.test diff --git a/lldb/lit/Settings/TestFrameFormatNoColor.test b/lldb/test/Shell/Settings/TestFrameFormatNoColor.test similarity index 100% rename from lldb/lit/Settings/TestFrameFormatNoColor.test rename to lldb/test/Shell/Settings/TestFrameFormatNoColor.test diff --git a/lldb/lit/Settings/TestModuleCacheSanity.test b/lldb/test/Shell/Settings/TestModuleCacheSanity.test similarity index 100% rename from lldb/lit/Settings/TestModuleCacheSanity.test rename to lldb/test/Shell/Settings/TestModuleCacheSanity.test diff --git a/lldb/lit/Settings/TestSettingsSet.test b/lldb/test/Shell/Settings/TestSettingsSet.test similarity index 100% rename from lldb/lit/Settings/TestSettingsSet.test rename to lldb/test/Shell/Settings/TestSettingsSet.test diff --git a/lldb/lit/Settings/TestSettingsWrite.test b/lldb/test/Shell/Settings/TestSettingsWrite.test similarity index 100% rename from lldb/lit/Settings/TestSettingsWrite.test rename to lldb/test/Shell/Settings/TestSettingsWrite.test diff --git a/lldb/lit/Settings/TestStopCommandSourceOnError.test b/lldb/test/Shell/Settings/TestStopCommandSourceOnError.test similarity index 100% rename from lldb/lit/Settings/TestStopCommandSourceOnError.test rename to lldb/test/Shell/Settings/TestStopCommandSourceOnError.test diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/basic-elf.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-elf.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/basic-elf.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-elf.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/basic-macho.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-macho.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/basic-macho.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-macho.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab-macho.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab-macho.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/symtab.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/symtab.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test diff --git a/lldb/lit/SymbolFile/Breakpad/line-table-edgecases.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table-edgecases.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table-edgecases.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table-edgecases.test diff --git a/lldb/lit/SymbolFile/Breakpad/line-table-missing-file.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table-missing-file.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table-missing-file.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table-missing-file.test diff --git a/lldb/lit/SymbolFile/Breakpad/line-table-mixed-path-styles.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table-mixed-path-styles.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table-mixed-path-styles.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table-mixed-path-styles.test diff --git a/lldb/lit/SymbolFile/Breakpad/line-table.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table.test diff --git a/lldb/lit/SymbolFile/Breakpad/stack-cfi-parsing.test b/lldb/test/Shell/SymbolFile/Breakpad/stack-cfi-parsing.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/stack-cfi-parsing.test rename to lldb/test/Shell/SymbolFile/Breakpad/stack-cfi-parsing.test diff --git a/lldb/lit/SymbolFile/Breakpad/symtab-macho.test b/lldb/test/Shell/SymbolFile/Breakpad/symtab-macho.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/symtab-macho.test rename to lldb/test/Shell/SymbolFile/Breakpad/symtab-macho.test diff --git a/lldb/lit/SymbolFile/Breakpad/symtab.test b/lldb/test/Shell/SymbolFile/Breakpad/symtab.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/symtab.test rename to lldb/test/Shell/SymbolFile/Breakpad/symtab.test diff --git a/lldb/lit/SymbolFile/Breakpad/unwind-via-raSearch.test b/lldb/test/Shell/SymbolFile/Breakpad/unwind-via-raSearch.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/unwind-via-raSearch.test rename to lldb/test/Shell/SymbolFile/Breakpad/unwind-via-raSearch.test diff --git a/lldb/lit/SymbolFile/Breakpad/unwind-via-stack-cfi.test b/lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-cfi.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/unwind-via-stack-cfi.test rename to lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-cfi.test diff --git a/lldb/lit/SymbolFile/Breakpad/unwind-via-stack-win.test b/lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/unwind-via-stack-win.test rename to lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win.test diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script b/lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-line-basic.script similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-line-basic.script diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/debug-types-basic.cpp b/lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-basic.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/debug-types-basic.cpp rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-basic.cpp diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp b/lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit b/lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit b/lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit b/lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp b/lldb/test/Shell/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp diff --git a/lldb/lit/SymbolFile/DWARF/apple-index-is-used.cpp b/lldb/test/Shell/SymbolFile/DWARF/apple-index-is-used.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/apple-index-is-used.cpp rename to lldb/test/Shell/SymbolFile/DWARF/apple-index-is-used.cpp diff --git a/lldb/lit/SymbolFile/DWARF/array-sizes.s b/lldb/test/Shell/SymbolFile/DWARF/array-sizes.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/array-sizes.s rename to lldb/test/Shell/SymbolFile/DWARF/array-sizes.s diff --git a/lldb/lit/SymbolFile/DWARF/childless-compile-unit.s b/lldb/test/Shell/SymbolFile/DWARF/childless-compile-unit.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/childless-compile-unit.s rename to lldb/test/Shell/SymbolFile/DWARF/childless-compile-unit.s diff --git a/lldb/lit/SymbolFile/DWARF/compilercontext.ll b/lldb/test/Shell/SymbolFile/DWARF/compilercontext.ll similarity index 100% rename from lldb/lit/SymbolFile/DWARF/compilercontext.ll rename to lldb/test/Shell/SymbolFile/DWARF/compilercontext.ll diff --git a/lldb/lit/SymbolFile/DWARF/debug-line-basic.s b/lldb/test/Shell/SymbolFile/DWARF/debug-line-basic.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-line-basic.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-line-basic.s diff --git a/lldb/lit/SymbolFile/DWARF/debug-names-compressed.cpp b/lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-names-compressed.cpp rename to lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-address-ranges.s b/lldb/test/Shell/SymbolFile/DWARF/debug-types-address-ranges.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-address-ranges.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-address-ranges.s diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-basic.test b/lldb/test/Shell/SymbolFile/DWARF/debug-types-basic.test similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-basic.test rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-basic.test diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-dwarf5.s b/lldb/test/Shell/SymbolFile/DWARF/debug-types-dwarf5.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-dwarf5.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-dwarf5.s diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp b/lldb/test/Shell/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-expressions.test b/lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-expressions.test rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-line-tables.s b/lldb/test/Shell/SymbolFile/DWARF/debug-types-line-tables.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-line-tables.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-line-tables.s diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-missing-signature.test b/lldb/test/Shell/SymbolFile/DWARF/debug-types-missing-signature.test similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-missing-signature.test rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-missing-signature.test diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-signature-loop.s b/lldb/test/Shell/SymbolFile/DWARF/debug-types-signature-loop.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-signature-loop.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-signature-loop.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_aranges-empty-section.s b/lldb/test/Shell/SymbolFile/DWARF/debug_aranges-empty-section.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_aranges-empty-section.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_aranges-empty-section.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_loc.s b/lldb/test/Shell/SymbolFile/DWARF/debug_loc.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_loc.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_loc.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_ranges-missing-section.s b/lldb/test/Shell/SymbolFile/DWARF/debug_ranges-missing-section.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_ranges-missing-section.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_ranges-missing-section.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_ranges.s b/lldb/test/Shell/SymbolFile/DWARF/debug_ranges.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_ranges.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_ranges.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_ranges_and_rnglists.test b/lldb/test/Shell/SymbolFile/DWARF/debug_ranges_and_rnglists.test similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_ranges_and_rnglists.test rename to lldb/test/Shell/SymbolFile/DWARF/debug_ranges_and_rnglists.test diff --git a/lldb/lit/SymbolFile/DWARF/debug_rnglists.s b/lldb/test/Shell/SymbolFile/DWARF/debug_rnglists.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_rnglists.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_rnglists.s diff --git a/lldb/lit/SymbolFile/DWARF/deterministic-build.cpp b/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/deterministic-build.cpp rename to lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp diff --git a/lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s b/lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s rename to lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s diff --git a/lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s b/lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s rename to lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir.s diff --git a/lldb/lit/SymbolFile/DWARF/dir-separator-posix.s b/lldb/test/Shell/SymbolFile/DWARF/dir-separator-posix.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dir-separator-posix.s rename to lldb/test/Shell/SymbolFile/DWARF/dir-separator-posix.s diff --git a/lldb/lit/SymbolFile/DWARF/dir-separator-windows.s b/lldb/test/Shell/SymbolFile/DWARF/dir-separator-windows.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dir-separator-windows.s rename to lldb/test/Shell/SymbolFile/DWARF/dir-separator-windows.s diff --git a/lldb/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp b/lldb/test/Shell/SymbolFile/DWARF/dwarf5-index-is-used.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp rename to lldb/test/Shell/SymbolFile/DWARF/dwarf5-index-is-used.cpp diff --git a/lldb/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp b/lldb/test/Shell/SymbolFile/DWARF/dwarf5-partial-index.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp rename to lldb/test/Shell/SymbolFile/DWARF/dwarf5-partial-index.cpp diff --git a/lldb/lit/SymbolFile/DWARF/dwarf5_locations.s b/lldb/test/Shell/SymbolFile/DWARF/dwarf5_locations.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dwarf5_locations.s rename to lldb/test/Shell/SymbolFile/DWARF/dwarf5_locations.s diff --git a/lldb/lit/SymbolFile/DWARF/find-basic-function.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-basic-function.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-basic-namespace.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-basic-namespace.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-basic-namespace.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-basic-namespace.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-basic-type.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-basic-type.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-basic-type.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-basic-type.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-basic-variable.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-basic-variable.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-basic-variable.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-basic-variable.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-function-regex.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-function-regex.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-function-regex.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-function-regex.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-inline-method.s b/lldb/test/Shell/SymbolFile/DWARF/find-inline-method.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-inline-method.s rename to lldb/test/Shell/SymbolFile/DWARF/find-inline-method.s diff --git a/lldb/lit/SymbolFile/DWARF/find-method-local-struct.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-method-local-struct.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-method-local-struct.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-method-local-struct.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-method.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-method.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-method.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-method.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-qualified-variable.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-qualified-variable.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-qualified-variable.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-qualified-variable.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-type-in-function.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-type-in-function.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-type-in-function.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-type-in-function.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-variable-dwo.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-variable-dwo.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-variable-dwo.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-variable-dwo.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-variable-file.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-variable-file.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-variable-file.cpp diff --git a/lldb/lit/SymbolFile/DWARF/forward-declarations.s b/lldb/test/Shell/SymbolFile/DWARF/forward-declarations.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/forward-declarations.s rename to lldb/test/Shell/SymbolFile/DWARF/forward-declarations.s diff --git a/lldb/lit/SymbolFile/DWARF/gnu-style-compression.cpp b/lldb/test/Shell/SymbolFile/DWARF/gnu-style-compression.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/gnu-style-compression.cpp rename to lldb/test/Shell/SymbolFile/DWARF/gnu-style-compression.cpp diff --git a/lldb/lit/SymbolFile/DWARF/lit.local.cfg b/lldb/test/Shell/SymbolFile/DWARF/lit.local.cfg similarity index 100% rename from lldb/lit/SymbolFile/DWARF/lit.local.cfg rename to lldb/test/Shell/SymbolFile/DWARF/lit.local.cfg diff --git a/lldb/lit/SymbolFile/DWARF/parallel-indexing-stress.s b/lldb/test/Shell/SymbolFile/DWARF/parallel-indexing-stress.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/parallel-indexing-stress.s rename to lldb/test/Shell/SymbolFile/DWARF/parallel-indexing-stress.s diff --git a/lldb/lit/SymbolFile/DWARF/split-dwarf-inlining.cpp b/lldb/test/Shell/SymbolFile/DWARF/split-dwarf-inlining.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/split-dwarf-inlining.cpp rename to lldb/test/Shell/SymbolFile/DWARF/split-dwarf-inlining.cpp diff --git a/lldb/lit/SymbolFile/DWARF/split-dwarf-multiple-cu.ll b/lldb/test/Shell/SymbolFile/DWARF/split-dwarf-multiple-cu.ll similarity index 100% rename from lldb/lit/SymbolFile/DWARF/split-dwarf-multiple-cu.ll rename to lldb/test/Shell/SymbolFile/DWARF/split-dwarf-multiple-cu.ll diff --git a/lldb/lit/SymbolFile/Inputs/sizeless-symbol.s b/lldb/test/Shell/SymbolFile/Inputs/sizeless-symbol.s similarity index 100% rename from lldb/lit/SymbolFile/Inputs/sizeless-symbol.s rename to lldb/test/Shell/SymbolFile/Inputs/sizeless-symbol.s diff --git a/lldb/lit/SymbolFile/Inputs/target-symbols-add-unwind.c b/lldb/test/Shell/SymbolFile/Inputs/target-symbols-add-unwind.c similarity index 100% rename from lldb/lit/SymbolFile/Inputs/target-symbols-add-unwind.c rename to lldb/test/Shell/SymbolFile/Inputs/target-symbols-add-unwind.c diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/ast-types.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-types.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/ast-types.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-types.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/bitfields.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/bitfields.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/bitfields.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/bitfields.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/disassembly.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/disassembly.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/disassembly.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/disassembly.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/local-variables.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/local-variables.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/nested-types.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/nested-types.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.s b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.s similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.s rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.s diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/source-list.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/source-list.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/source-list.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/source-list.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/tag-types.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/tag-types.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/tag-types.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/tag-types.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/ast-functions-msvc.cpp b/lldb/test/Shell/SymbolFile/NativePDB/ast-functions-msvc.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/ast-functions-msvc.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/ast-functions-msvc.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/ast-functions.cpp b/lldb/test/Shell/SymbolFile/NativePDB/ast-functions.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/ast-functions.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/ast-functions.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/ast-methods.cpp b/lldb/test/Shell/SymbolFile/NativePDB/ast-methods.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/ast-methods.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/ast-methods.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/ast-types.cpp b/lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/ast-types.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/bitfields.cpp b/lldb/test/Shell/SymbolFile/NativePDB/bitfields.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/bitfields.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/bitfields.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/break-by-function.cpp b/lldb/test/Shell/SymbolFile/NativePDB/break-by-function.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/break-by-function.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/break-by-function.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/break-by-line.cpp b/lldb/test/Shell/SymbolFile/NativePDB/break-by-line.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/break-by-line.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/break-by-line.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/disassembly.cpp b/lldb/test/Shell/SymbolFile/NativePDB/disassembly.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/disassembly.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/disassembly.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/function-types-builtins.cpp b/lldb/test/Shell/SymbolFile/NativePDB/function-types-builtins.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/function-types-builtins.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/function-types-builtins.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/function-types-calling-conv.cpp b/lldb/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/function-types-calling-conv.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/function-types-classes.cpp b/lldb/test/Shell/SymbolFile/NativePDB/function-types-classes.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/function-types-classes.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/function-types-classes.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/global-classes.cpp b/lldb/test/Shell/SymbolFile/NativePDB/global-classes.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/global-classes.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/global-classes.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/globals-bss.cpp b/lldb/test/Shell/SymbolFile/NativePDB/globals-bss.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/globals-bss.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/globals-bss.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/globals-fundamental.cpp b/lldb/test/Shell/SymbolFile/NativePDB/globals-fundamental.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/globals-fundamental.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/globals-fundamental.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/local-variables.cpp b/lldb/test/Shell/SymbolFile/NativePDB/local-variables.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/local-variables.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/local-variables.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/nested-types.cpp b/lldb/test/Shell/SymbolFile/NativePDB/nested-types.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/nested-types.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/nested-types.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/s_constant.cpp b/lldb/test/Shell/SymbolFile/NativePDB/s_constant.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/s_constant.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/s_constant.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/source-list.cpp b/lldb/test/Shell/SymbolFile/NativePDB/source-list.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/source-list.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/source-list.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/stack_unwinding01.cpp b/lldb/test/Shell/SymbolFile/NativePDB/stack_unwinding01.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/stack_unwinding01.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/stack_unwinding01.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/tag-types.cpp b/lldb/test/Shell/SymbolFile/NativePDB/tag-types.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/tag-types.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/tag-types.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/typedefs.cpp b/lldb/test/Shell/SymbolFile/NativePDB/typedefs.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/typedefs.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/typedefs.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/AstRestoreTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/AstRestoreTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/CompilandsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/CompilandsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest0.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest0.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest0.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest0.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest1.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest1.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest1.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest1.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest2.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest2.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest2.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest2.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbols.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbols.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h b/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord b/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/PointerTypeTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/PointerTypeTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/PointerTypeTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/PointerTypeTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/TypeQualsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/TypeQualsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VBases.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VBases.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VBases.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VBases.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/ast-restore.test b/lldb/test/Shell/SymbolFile/PDB/ast-restore.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/ast-restore.test rename to lldb/test/Shell/SymbolFile/PDB/ast-restore.test diff --git a/lldb/lit/SymbolFile/PDB/calling-conventions.test b/lldb/test/Shell/SymbolFile/PDB/calling-conventions.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/calling-conventions.test rename to lldb/test/Shell/SymbolFile/PDB/calling-conventions.test diff --git a/lldb/lit/SymbolFile/PDB/class-layout.test b/lldb/test/Shell/SymbolFile/PDB/class-layout.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/class-layout.test rename to lldb/test/Shell/SymbolFile/PDB/class-layout.test diff --git a/lldb/lit/SymbolFile/PDB/compilands.test b/lldb/test/Shell/SymbolFile/PDB/compilands.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/compilands.test rename to lldb/test/Shell/SymbolFile/PDB/compilands.test diff --git a/lldb/lit/SymbolFile/PDB/enums-layout.test b/lldb/test/Shell/SymbolFile/PDB/enums-layout.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/enums-layout.test rename to lldb/test/Shell/SymbolFile/PDB/enums-layout.test diff --git a/lldb/lit/SymbolFile/PDB/expressions.test b/lldb/test/Shell/SymbolFile/PDB/expressions.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/expressions.test rename to lldb/test/Shell/SymbolFile/PDB/expressions.test diff --git a/lldb/lit/SymbolFile/PDB/func-symbols.test b/lldb/test/Shell/SymbolFile/PDB/func-symbols.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/func-symbols.test rename to lldb/test/Shell/SymbolFile/PDB/func-symbols.test diff --git a/lldb/lit/SymbolFile/PDB/function-level-linking.test b/lldb/test/Shell/SymbolFile/PDB/function-level-linking.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/function-level-linking.test rename to lldb/test/Shell/SymbolFile/PDB/function-level-linking.test diff --git a/lldb/lit/SymbolFile/PDB/function-nested-block.test b/lldb/test/Shell/SymbolFile/PDB/function-nested-block.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/function-nested-block.test rename to lldb/test/Shell/SymbolFile/PDB/function-nested-block.test diff --git a/lldb/lit/SymbolFile/PDB/pointers.test b/lldb/test/Shell/SymbolFile/PDB/pointers.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/pointers.test rename to lldb/test/Shell/SymbolFile/PDB/pointers.test diff --git a/lldb/lit/SymbolFile/PDB/type-quals.test b/lldb/test/Shell/SymbolFile/PDB/type-quals.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/type-quals.test rename to lldb/test/Shell/SymbolFile/PDB/type-quals.test diff --git a/lldb/lit/SymbolFile/PDB/typedefs.test b/lldb/test/Shell/SymbolFile/PDB/typedefs.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/typedefs.test rename to lldb/test/Shell/SymbolFile/PDB/typedefs.test diff --git a/lldb/lit/SymbolFile/PDB/udt-layout.test b/lldb/test/Shell/SymbolFile/PDB/udt-layout.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/udt-layout.test rename to lldb/test/Shell/SymbolFile/PDB/udt-layout.test diff --git a/lldb/lit/SymbolFile/PDB/variables-locations.test b/lldb/test/Shell/SymbolFile/PDB/variables-locations.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/variables-locations.test rename to lldb/test/Shell/SymbolFile/PDB/variables-locations.test diff --git a/lldb/lit/SymbolFile/PDB/variables.test b/lldb/test/Shell/SymbolFile/PDB/variables.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/variables.test rename to lldb/test/Shell/SymbolFile/PDB/variables.test diff --git a/lldb/lit/SymbolFile/PDB/vbases.test b/lldb/test/Shell/SymbolFile/PDB/vbases.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/vbases.test rename to lldb/test/Shell/SymbolFile/PDB/vbases.test diff --git a/lldb/lit/SymbolFile/dissassemble-entry-point.s b/lldb/test/Shell/SymbolFile/dissassemble-entry-point.s similarity index 100% rename from lldb/lit/SymbolFile/dissassemble-entry-point.s rename to lldb/test/Shell/SymbolFile/dissassemble-entry-point.s diff --git a/lldb/lit/SymbolFile/sizeless-symbol.test b/lldb/test/Shell/SymbolFile/sizeless-symbol.test similarity index 100% rename from lldb/lit/SymbolFile/sizeless-symbol.test rename to lldb/test/Shell/SymbolFile/sizeless-symbol.test diff --git a/lldb/lit/SymbolFile/target-symbols-add-unwind.test b/lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test similarity index 100% rename from lldb/lit/SymbolFile/target-symbols-add-unwind.test rename to lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test diff --git a/lldb/lit/Unwind/Inputs/call-asm.c b/lldb/test/Shell/Unwind/Inputs/call-asm.c similarity index 100% rename from lldb/lit/Unwind/Inputs/call-asm.c rename to lldb/test/Shell/Unwind/Inputs/call-asm.c diff --git a/lldb/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s b/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s similarity index 100% rename from lldb/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s rename to lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s diff --git a/lldb/lit/Unwind/Inputs/eh-frame-small-fde.s b/lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s similarity index 100% rename from lldb/lit/Unwind/Inputs/eh-frame-small-fde.s rename to lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s diff --git a/lldb/lit/Unwind/Inputs/prefer-debug-over-eh-frame.s b/lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s similarity index 100% rename from lldb/lit/Unwind/Inputs/prefer-debug-over-eh-frame.s rename to lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s diff --git a/lldb/lit/Unwind/Inputs/trap_frame_sym_ctx.s b/lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s similarity index 100% rename from lldb/lit/Unwind/Inputs/trap_frame_sym_ctx.s rename to lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s diff --git a/lldb/lit/Unwind/Inputs/unwind-plan-dwarf-dump.s b/lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s similarity index 100% rename from lldb/lit/Unwind/Inputs/unwind-plan-dwarf-dump.s rename to lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s diff --git a/lldb/lit/Unwind/eh-frame-dwarf-unwind.test b/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test similarity index 100% rename from lldb/lit/Unwind/eh-frame-dwarf-unwind.test rename to lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test diff --git a/lldb/lit/Unwind/eh-frame-small-fde.test b/lldb/test/Shell/Unwind/eh-frame-small-fde.test similarity index 100% rename from lldb/lit/Unwind/eh-frame-small-fde.test rename to lldb/test/Shell/Unwind/eh-frame-small-fde.test diff --git a/lldb/lit/Unwind/prefer-debug-over-eh-frame.test b/lldb/test/Shell/Unwind/prefer-debug-over-eh-frame.test similarity index 100% rename from lldb/lit/Unwind/prefer-debug-over-eh-frame.test rename to lldb/test/Shell/Unwind/prefer-debug-over-eh-frame.test diff --git a/lldb/lit/Unwind/trap_frame_sym_ctx.test b/lldb/test/Shell/Unwind/trap_frame_sym_ctx.test similarity index 100% rename from lldb/lit/Unwind/trap_frame_sym_ctx.test rename to lldb/test/Shell/Unwind/trap_frame_sym_ctx.test diff --git a/lldb/lit/Unwind/unwind-plan-dwarf-dump.test b/lldb/test/Shell/Unwind/unwind-plan-dwarf-dump.test similarity index 100% rename from lldb/lit/Unwind/unwind-plan-dwarf-dump.test rename to lldb/test/Shell/Unwind/unwind-plan-dwarf-dump.test diff --git a/lldb/lit/Watchpoint/Inputs/main.cpp b/lldb/test/Shell/Watchpoint/Inputs/main.cpp similarity index 100% rename from lldb/lit/Watchpoint/Inputs/main.cpp rename to lldb/test/Shell/Watchpoint/Inputs/main.cpp diff --git a/lldb/lit/Watchpoint/SetErrorCases.test b/lldb/test/Shell/Watchpoint/SetErrorCases.test similarity index 100% rename from lldb/lit/Watchpoint/SetErrorCases.test rename to lldb/test/Shell/Watchpoint/SetErrorCases.test diff --git a/lldb/lit/helper/__init__.py b/lldb/test/Shell/helper/__init__.py similarity index 100% rename from lldb/lit/helper/__init__.py rename to lldb/test/Shell/helper/__init__.py diff --git a/lldb/lit/helper/build.py b/lldb/test/Shell/helper/build.py similarity index 100% rename from lldb/lit/helper/build.py rename to lldb/test/Shell/helper/build.py diff --git a/lldb/lit/helper/toolchain.py b/lldb/test/Shell/helper/toolchain.py similarity index 98% rename from lldb/lit/helper/toolchain.py rename to lldb/test/Shell/helper/toolchain.py index 0290e12c8f550..d9e5c0593ec1c 100644 --- a/lldb/lit/helper/toolchain.py +++ b/lldb/test/Shell/helper/toolchain.py @@ -29,7 +29,7 @@ def use_lldb_substitutions(config): if config.llvm_libs_dir: build_script_args.append('--libs-dir={0}'.format(config.llvm_libs_dir)) - lldb_init = os.path.join(config.test_exec_root, 'lit-lldb-init') + lldb_init = os.path.join(config.test_exec_root, 'Shell', 'lit-lldb-init') primary_tools = [ ToolSubst('%lldb', diff --git a/lldb/lit/lit-lldb-init.in b/lldb/test/Shell/lit-lldb-init.in similarity index 100% rename from lldb/lit/lit-lldb-init.in rename to lldb/test/Shell/lit-lldb-init.in diff --git a/lldb/lit/lit.cfg.py b/lldb/test/Shell/lit.cfg.py similarity index 97% rename from lldb/lit/lit.cfg.py rename to lldb/test/Shell/lit.cfg.py index 208338ce95c18..3503e95692295 100644 --- a/lldb/lit/lit.cfg.py +++ b/lldb/test/Shell/lit.cfg.py @@ -17,7 +17,7 @@ from helper import toolchain # name: The name of this test suite. -config.name = 'LLDB' +config.name = 'lldb-shell' # testFormat: The test format to use to interpret tests. config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) @@ -35,7 +35,7 @@ config.test_source_root = os.path.dirname(__file__) # test_exec_root: The root path where tests should be run. -config.test_exec_root = os.path.join(config.lldb_obj_root, 'lit') +config.test_exec_root = os.path.join(config.lldb_obj_root, 'test') llvm_config.use_default_substitutions() diff --git a/lldb/lit/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in similarity index 96% rename from lldb/lit/lit.site.cfg.py.in rename to lldb/test/Shell/lit.site.cfg.py.in index c9b6e09cc0e75..459d560454121 100644 --- a/lldb/lit/lit.site.cfg.py.in +++ b/lldb/test/Shell/lit.site.cfg.py.in @@ -41,4 +41,4 @@ import lit.llvm lit.llvm.initialize(lit_config, config) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/lit.cfg.py") +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Shell/lit.cfg.py") diff --git a/lldb/test/Unit/README.md b/lldb/test/Unit/README.md new file mode 100644 index 0000000000000..0302747acd9fa --- /dev/null +++ b/lldb/test/Unit/README.md @@ -0,0 +1,4 @@ +# LLDB Unit Tests + +This directory only exists for the lit test driver. The actual tests live in +the `unittest` directory in top level LLDB directory. diff --git a/lldb/lit/Unit/lit.cfg.py b/lldb/test/Unit/lit.cfg.py similarity index 97% rename from lldb/lit/Unit/lit.cfg.py rename to lldb/test/Unit/lit.cfg.py index 3633c73a1d404..e53bcd394ca1e 100644 --- a/lldb/lit/Unit/lit.cfg.py +++ b/lldb/test/Unit/lit.cfg.py @@ -9,7 +9,7 @@ from lit.llvm import llvm_config # name: The name of this test suite. -config.name = 'lldb-Unit' +config.name = 'lldb-unit' # suffixes: A list of file extensions to treat as test files. config.suffixes = [] diff --git a/lldb/lit/Unit/lit.site.cfg.py.in b/lldb/test/Unit/lit.site.cfg.py.in similarity index 93% rename from lldb/lit/Unit/lit.site.cfg.py.in rename to lldb/test/Unit/lit.site.cfg.py.in index 0c629fdfaa565..9d9bcd4ba628d 100644 --- a/lldb/lit/Unit/lit.site.cfg.py.in +++ b/lldb/test/Unit/lit.site.cfg.py.in @@ -26,4 +26,4 @@ import lit.llvm lit.llvm.initialize(lit_config, config) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Unit/lit.cfg.py") +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Unit/lit.cfg.py") diff --git a/lldb/test/lit.cfg.py b/lldb/test/lit.cfg.py new file mode 100644 index 0000000000000..797750bac2126 --- /dev/null +++ b/lldb/test/lit.cfg.py @@ -0,0 +1,41 @@ +# -*- Python -*- + +import os +import platform +import re +import shutil +import site +import sys + +import lit.formats +from lit.llvm import llvm_config +from lit.llvm.subst import FindTool +from lit.llvm.subst import ToolSubst +from distutils.spawn import find_executable + +# This is the top level configuration. Most of these configuration options will +# be overriden by individual lit configuration files in the test +# subdirectories. + +# name: The name of this test suite. +config.name = 'lldb' + +# testFormat: The test format to use to interpret tests. +config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) + +# suffixes: A list of file extensions to treat as test files. This is overriden +# by individual lit.local.cfg files in the test subdirectories. +config.suffixes = ['.test', '.cpp', '.s'] + +# excludes: A list of directories to exclude from the testsuite. The 'Inputs' +# subdirectories contain auxiliary inputs for various tests in their parent +# directories. +config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt'] + +# test_source_root: The root path where tests are located. +config.test_source_root = os.path.dirname(__file__) + +# test_exec_root: The root path where tests should be run. +config.test_exec_root = os.path.join(config.lldb_obj_root, 'test') + +llvm_config.use_default_substitutions() From f98606f17735daa7a1cf3b774846445f3a178879 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 9 Oct 2019 16:55:27 +0000 Subject: [PATCH 17/44] Remove obsolete parameter. llvm-svn: 374185 --- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index d773832a97571..3f8502548fc25 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -2789,7 +2789,6 @@ Symtab *ObjectFileELF::GetSymtab() { uint64_t symbol_id = m_symtab_up->GetNumSymbols(); Symbol symbol(symbol_id, GetNextSyntheticSymbolName().GetCString(), // Symbol name. - false, // Is the symbol name mangled? eSymbolTypeCode, // Type of this symbol. true, // Is this globally visible? false, // Is this symbol debug info? From 44e988ab14cb387eddfeacd1493792a6aa6aee81 Mon Sep 17 00:00:00 2001 From: "Kevin P. Neal" Date: Wed, 9 Oct 2019 17:24:56 +0000 Subject: [PATCH 18/44] [FPEnv][NFC] Change test to conform to strictfp attribute rules. In particular, the function definition is not marked strictfp despite containing a function marked strictfp. Also, if any function call is marked strictfp then all function calls in that function must be marked. This change to move the one strictfp call to a new properly marked function meets all the new rules. Tested with a stricter version of D68233. Reviewed by: spatel Approved by: spatel Differential Revision: https://reviews.llvm.org/D68713 llvm-svn: 374186 --- llvm/test/Bitcode/compatibility.ll | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/llvm/test/Bitcode/compatibility.ll b/llvm/test/Bitcode/compatibility.ll index 9e7f6ac991754..3bc806229d0a7 100644 --- a/llvm/test/Bitcode/compatibility.ll +++ b/llvm/test/Bitcode/compatibility.ll @@ -1374,9 +1374,6 @@ exit: call void @f.nobuiltin() builtin ; CHECK: call void @f.nobuiltin() #43 - call void @f.strictfp() strictfp - ; CHECK: call void @f.strictfp() #44 - call fastcc noalias i32* @f.noalias() noinline ; CHECK: call fastcc noalias i32* @f.noalias() #12 tail call ghccc nonnull i32* @f.nonnull() minsize @@ -1392,6 +1389,13 @@ define void @instructions.call_musttail(i8* inalloca %val) { ret void } +define void @instructions.strictfp() #44 { + call void @f.strictfp() strictfp + ; CHECK: call void @f.strictfp() #44 + + ret void +} + define void @instructions.call_notail() { notail call void @f1() ; CHECK: notail call void @f1() From 0115c10328281567391855766fef8fbe57a1d4cc Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 9 Oct 2019 17:35:43 +0000 Subject: [PATCH 19/44] Revert [test] Split LLDB tests into API, Shell & Unit as it appears to have broken check-lldb. This reverts r374184 (git commit 22314179f0660c172514b397060fd8f34b586e82) llvm-svn: 374187 --- lldb/CMakeLists.txt | 1 + .../Breakpoint/Inputs/case-sensitive.c | 0 .../Breakpoint/Inputs/debug_addrx.yaml | 0 .../Inputs/debug_rnglist_basic.yaml | 0 .../Inputs/debug_rnglist_offset_pair.yaml | 0 .../Inputs/debug_rnglist_rlestartend.yaml | 0 .../Inputs/debug_rnglistx_rlex.yaml | 0 .../Inputs/implicit_const_form_support.yaml | 0 .../Shell => lit}/Breakpoint/Inputs/jitbp.cpp | 0 .../Breakpoint/Inputs/ppc64-localentry.s | 0 .../Inputs/single-file-split-dwarf.o.yaml | 0 .../Inputs/single-file-split-dwarf.yaml | 0 .../Inputs/split-dwarf-5-addrbase.dwo.yaml | 0 .../Inputs/split-dwarf-5-addrbase.yaml | 0 ...lit-dwarf5-debug-stroffsets-file1.dwo.yaml | 0 ...lit-dwarf5-debug-stroffsets-file2.dwo.yaml | 0 .../split-dwarf5-debug-stroffsets-main.yaml | 0 .../Breakpoint/case-insensitive.test | 0 .../Breakpoint/case-sensitive.test | 0 .../Shell => lit}/Breakpoint/debug_addrx.test | 0 .../Breakpoint/debug_rnglist_basic.test | 0 .../Breakpoint/debug_rnglist_offset_pair.test | 0 .../Breakpoint/debug_rnglist_rlestartend.test | 0 .../Breakpoint/debug_rnglistx_rlex.test | 0 .../implicit_const_form_support.test | 0 .../Shell => lit}/Breakpoint/jitbp_elf.test | 0 .../Breakpoint/ppc64-localentry.test | 0 .../Breakpoint/single-file-split-dwarf.test | 0 .../Breakpoint/split-dwarf-5-addrbase.test | 0 .../split-dwarf5-debug-stroffsets.test | 0 .../BuildScript/compiler-full-path.test | 0 .../Shell => lit}/BuildScript/modes.test | 0 .../BuildScript/script-args.test | 0 .../BuildScript/toolchain-clang-cl.test | 0 .../BuildScript/toolchain-clang.test | 0 .../BuildScript/toolchain-msvc.test | 0 lldb/lit/CMakeLists.txt | 115 +++++++++ .../CommandScriptImmediateOutputConsole.test | 0 .../CommandScriptImmediateOutputFile.test | 0 .../Inputs/custom_command.py | 0 .../lit.local.cfg | 0 .../Shell => lit}/Commands/Inputs/frame.py | 0 .../Shell => lit}/Commands/Inputs/main.c | 0 .../Commands/command-backtrace.test | 0 .../Commands/command-regex-delete.test | 0 .../Commands/command-regex-unalias.test | 0 .../Commands/command-script-import.test | 0 .../Commands/command-source.test | 0 .../Shell => lit}/Driver/Inputs/.lldbinit | 0 .../Shell => lit}/Driver/Inputs/Print0.in | 0 .../Shell => lit}/Driver/Inputs/Print2.in | 0 .../Shell => lit}/Driver/Inputs/Print4.in | 0 .../Shell => lit}/Driver/Inputs/Print6.in | 0 .../Driver/Inputs/convenience.in | 0 .../{test/Shell => lit}/Driver/Inputs/hello.c | 0 .../Shell => lit}/Driver/Inputs/hello.cpp | 0 .../Driver/Inputs/process_attach_pid.in | 0 .../Driver/Inputs/syntax_error.py | 0 .../Shell => lit}/Driver/LocalLLDBInit.test | 0 .../Shell => lit}/Driver/TestCommands.test | 0 .../Driver/TestConvenienceVariables.test | 0 lldb/{test/Shell => lit}/Driver/TestCore.test | 0 lldb/{test/Shell => lit}/Driver/TestFile.test | 0 .../Shell => lit}/Driver/TestNoUseColor.test | 0 .../Driver/TestProcessAttach.test | 0 lldb/{test/Shell => lit}/Driver/TestRepl.test | 0 .../Shell => lit}/Driver/TestSingleQuote.test | 0 .../Shell => lit}/Driver/TestTarget.test | 0 .../StopHook/Inputs/stop-hook-1.lldbinit | 0 .../StopHook/Inputs/stop-hook-2.lldbinit | 0 .../StopHook/Inputs/stop-hook-3.lldbinit | 0 .../Inputs/stop-hook-threads-1.lldbinit | 0 .../Inputs/stop-hook-threads-2.lldbinit | 0 .../StopHook/Inputs/stop-hook-threads.cpp | 0 .../ExecControl/StopHook/Inputs/stop-hook.c | 0 .../StopHook/stop-hook-threads.test | 0 .../ExecControl/StopHook/stop-hook.test | 0 .../Expr/Inputs/call-function.cpp | 0 .../Expr/Inputs/ir-memory-map-basic | 0 .../Expr/Inputs/ir-memory-map-mix-malloc-free | 0 .../Expr/Inputs/ir-memory-map-overlap1 | 0 .../Shell => lit}/Expr/TestIRMemoryMap.test | 0 .../Expr/TestIRMemoryMapWindows.test | 0 .../Shell => lit}/Expr/TestMultilineExpr.test | 0 .../Expr/TestTypeOfDeclTypeExpr.test | 0 lldb/{test/Shell => lit}/Heap/Inputs/cstr.c | 0 lldb/{test/Shell => lit}/Heap/heap-cstr.test | 0 lldb/{test/Shell => lit}/Host/Inputs/simple.c | 0 .../Shell => lit}/Host/TestCustomShell.test | 0 .../Minidump/Inputs/linux-x86_64.syms | 0 .../Minidump/Inputs/linux-x86_64.yaml | 0 .../Windows/Inputs/find-module.dmp.yaml | 0 .../Windows/Inputs/find-module.exe.yaml | 0 .../Windows/Sigsegv/Inputs/sigsegv.cpp | 0 .../Windows/Sigsegv/Inputs/sigsegv.dmp | Bin .../Windows/Sigsegv/Inputs/sigsegv.lldbinit | 0 .../Windows/Sigsegv/Inputs/sigsegv.pdb | Bin .../Minidump/Windows/Sigsegv/sigsegv.test | 0 .../Minidump/Windows/find-module.test | 0 .../Minidump/breakpad-symbols.test | 0 .../Minidump/disassemble-no-module.yaml | 0 .../Shell => lit}/Minidump/dump-all.test | 0 .../{test/Shell => lit}/Minidump/fb-dump.test | 0 .../Shell => lit}/Minidump/lit.local.cfg | 0 .../Breakpad/Inputs/bad-module-id-1.syms | 0 .../Breakpad/Inputs/bad-module-id-2.syms | 0 .../Breakpad/Inputs/bad-module-id-3.syms | 0 .../Inputs/discontiguous-sections.syms | 0 .../Breakpad/Inputs/identification-linux.syms | 0 .../Inputs/identification-macosx-arm64e.syms | 0 .../Inputs/identification-macosx.syms | 0 .../Inputs/identification-windows.syms | 0 .../Inputs/sections-trailing-func.syms | 0 .../ObjectFile/Breakpad/Inputs/sections.syms | 0 .../Breakpad/Inputs/uuid-matching-mac.syms | 0 .../Breakpad/Inputs/uuid-matching-mac.yaml | 0 .../Breakpad/breakpad-identification.test | 0 .../Breakpad/discontiguous-sections.test | 0 .../ObjectFile/Breakpad/lit.local.cfg | 0 .../Breakpad/sections-trailing-func.test | 0 .../ObjectFile/Breakpad/sections.test | 0 .../Breakpad/uuid-matching-mac.test | 0 .../ELF/Inputs/PT_LOAD-overlap-section.elf | Bin .../ELF/Inputs/minidebuginfo-main.c | 0 .../ObjectFile/ELF/Inputs/netbsd-amd64.core | Bin .../ObjectFile/ELF/PT_LOAD-empty.yaml | 0 .../ELF/PT_LOAD-overlap-PT_INTERP.yaml | 0 .../ELF/PT_LOAD-overlap-PT_TLS.yaml | 0 .../ELF/PT_LOAD-overlap-section.yaml | 0 .../ObjectFile/ELF/PT_LOAD-overlap.yaml | 0 .../Shell => lit}/ObjectFile/ELF/PT_LOAD.yaml | 0 .../ELF/PT_TLS-overlap-PT_LOAD.yaml | 0 .../ObjectFile/ELF/aarch64-relocations.yaml | 0 .../ObjectFile/ELF/base-address.yaml | 0 .../ObjectFile/ELF/basic-info.yaml | 0 .../ObjectFile/ELF/build-id-case.yaml | 0 .../ObjectFile/ELF/compressed-sections.yaml | 0 .../ObjectFile/ELF/duplicate-section.yaml | 0 .../ObjectFile/ELF/gnu-debuglink.yaml | 0 .../ObjectFile/ELF/many-sections.s | 0 .../ELF/minidebuginfo-corrupt-xz.yaml | 0 .../ELF/minidebuginfo-find-symbols.yaml | 0 .../ObjectFile/ELF/minidebuginfo-no-lzma.yaml | 0 .../minidebuginfo-set-and-hit-breakpoint.test | 0 .../ObjectFile/ELF/netbsd-core-amd64.test | 0 .../ELF/netbsd-exec-8.99.30-amd64.yaml | 0 .../ObjectFile/ELF/section-addresses.yaml | 0 .../ObjectFile/ELF/section-overlap.yaml | 0 .../ObjectFile/ELF/section-permissions.yaml | 0 .../ELF/section-types-edgecases.yaml | 0 .../ObjectFile/ELF/section-types.yaml | 0 .../ObjectFile/ELF/short-build-id.yaml | 0 .../ObjectFile/MachO/lc_build_version.yaml | 0 .../MachO/lc_build_version_notools.yaml | 0 .../ObjectFile/MachO/lc_version_min.yaml | 0 .../ObjectFile/MachO/subsections.yaml | 0 .../ObjectFile/MachO/symtab.yaml | 0 .../ObjectFile/PECOFF/basic-info-arm.yaml | 0 .../ObjectFile/PECOFF/basic-info-arm64.yaml | 0 .../ObjectFile/PECOFF/basic-info.yaml | 0 .../ObjectFile/PECOFF/dep-modules.yaml | 0 .../ObjectFile/PECOFF/export-dllfunc.yaml | 0 .../ObjectFile/PECOFF/lit.local.cfg | 0 .../ObjectFile/PECOFF/sections-names.yaml | 0 .../ObjectFile/PECOFF/subsections.yaml | 0 .../Shell => lit}/ObjectFile/PECOFF/uuid.yaml | 0 .../Shell => lit}/ObjectFile/lit.local.cfg | 0 .../Shell => lit}/Process/Inputs/env.cpp | 0 .../Process/TestEnvironment.test | 0 .../Windows/exception_access_violation.cpp | 0 lldb/{test/Shell => lit}/Python/crashlog.test | 4 +- .../Quit/TestQuitExitCode-30.test | 0 .../Shell => lit}/Quit/TestQuitExitCode0.test | 0 .../Quit/TestQuitExitCode30.test | 0 .../Quit/TestQuitExitCodeHex0.test | 0 .../Quit/TestQuitExitCodeHexA.test | 0 .../Quit/TestQuitExitCodeImplicit0.test | 0 .../Quit/TestQuitExitCodeNonInt.test | 0 .../Quit/TestQuitExitCodeTooManyArgs.test | 0 .../Shell => lit}/Quit/expect_exit_code.py | 0 .../Register/Inputs/x86-64-gp-read.cpp | 0 .../Register/Inputs/x86-64-gp-write.cpp | 0 .../Register/Inputs/x86-64-read.cpp | 0 .../Register/Inputs/x86-64-write.cpp | 0 .../Register/Inputs/x86-gp-read.cpp | 0 .../Register/Inputs/x86-gp-write.cpp | 0 .../Register/Inputs/x86-mm-xmm-read.cpp | 0 .../Register/Inputs/x86-mm-xmm-write.cpp | 0 .../Register/Inputs/x86-ymm-read.cpp | 0 .../Register/Inputs/x86-ymm-write.cpp | 0 .../Register/Inputs/x86-zmm-read.cpp | 0 .../Register/Inputs/x86-zmm-write.cpp | 0 .../Register/x86-64-gp-read.test | 0 .../Register/x86-64-gp-write.test | 0 .../Shell => lit}/Register/x86-64-read.test | 0 .../Shell => lit}/Register/x86-64-write.test | 0 .../Register/x86-64-xmm16-read.test | 0 .../Register/x86-64-xmm16-write.test | 0 .../Register/x86-64-ymm-read.test | 0 .../Register/x86-64-ymm-write.test | 0 .../Register/x86-64-ymm16-read.test | 0 .../Register/x86-64-ymm16-write.test | 0 .../Register/x86-64-zmm-read.test | 0 .../Register/x86-64-zmm-write.test | 0 .../Shell => lit}/Register/x86-gp-read.test | 0 .../Shell => lit}/Register/x86-gp-write.test | 0 .../Register/x86-mm-xmm-read.test | 0 .../Register/x86-mm-xmm-write.test | 0 .../Shell => lit}/Register/x86-ymm-read.test | 0 .../Shell => lit}/Register/x86-ymm-write.test | 0 .../Shell => lit}/Register/x86-zmm-read.test | 0 .../Shell => lit}/Register/x86-zmm-write.test | 0 .../Functionalities/Inputs/DataFormatter.in | 0 .../Reproducer/Functionalities/Inputs/foo.cpp | 0 .../Functionalities/Inputs/stepping.c | 0 .../Functionalities/TestDataFormatter.test | 0 .../Functionalities/TestImageList.test | 0 .../Functionalities/TestStepping.test | 0 .../Reproducer/Inputs/FileCapture.in | 0 .../Reproducer/Inputs/GDBRemoteCapture.in | 0 .../Shell => lit}/Reproducer/Inputs/simple.c | 0 .../Reproducer/Modules/Inputs/Bar.h | 0 .../Reproducer/Modules/Inputs/Foo.h | 0 .../Reproducer/Modules/Inputs/ModuleCXX.in | 0 .../Reproducer/Modules/Inputs/main.cpp | 0 .../Modules/Inputs/module.modulemap | 0 .../Reproducer/Modules/TestModuleCXX.test | 0 .../Reproducer/TestDriverOptions.test | 0 .../Shell => lit}/Reproducer/TestDump.test | 0 .../Reproducer/TestFileRepro.test | 0 .../Reproducer/TestGDBRemoteRepro.test | 0 .../Reproducer/TestRelativePath.test | 0 .../Reproducer/TestReuseDirectory.test | 0 .../Reproducer/TestSynchronous.test | 0 .../Settings/Inputs/DontStopCommandSource.in | 0 .../Settings/Inputs/EchoCommandsAll.out | 0 .../Inputs/EchoCommandsNoComments.out | 0 .../Settings/Inputs/EchoCommandsNone.out | 0 .../Settings/Inputs/EchoCommandsQuiet.out | 0 .../Settings/Inputs/EchoCommandsTest.in | 0 .../Settings/Inputs/StopCommandSource.in | 0 .../Shell => lit}/Settings/Inputs/main.c | 0 .../Settings/TestDisableColor.test | 0 .../Settings/TestDisassemblyFormat.test | 0 .../Settings/TestEchoCommands.test | 0 .../Settings/TestFrameFormatColor.test | 0 .../Settings/TestFrameFormatNoColor.test | 0 .../Settings/TestModuleCacheSanity.test | 0 .../Settings/TestSettingsSet.test | 0 .../Settings/TestSettingsWrite.test | 0 .../TestStopCommandSourceOnError.test | 0 lldb/{test/API => lit/Suite}/lit.cfg | 4 +- lldb/{test/API => lit/Suite}/lit.site.cfg.in | 4 +- lldb/{test/API => lit/Suite}/lldbtest.py | 0 .../SymbolFile/Breakpad/Inputs/basic-elf.yaml | 0 .../Breakpad/Inputs/basic-macho.yaml | 0 .../line-table-discontinuous-file-ids.syms | 0 .../Breakpad/Inputs/line-table-edgecases.syms | 0 .../Inputs/line-table-missing-file.syms | 0 .../Inputs/line-table-mixed-path-styles.syms | 0 .../Breakpad/Inputs/line-table.syms | 0 .../Breakpad/Inputs/stack-cfi-parsing.syms | 0 .../Breakpad/Inputs/stack-cfi-parsing.yaml | 0 .../Breakpad/Inputs/symtab-macho.syms | 0 .../SymbolFile/Breakpad/Inputs/symtab.syms | 0 .../Breakpad/Inputs/unwind-via-raSearch.syms | 0 .../Breakpad/Inputs/unwind-via-stack-cfi.syms | 0 .../Breakpad/Inputs/unwind-via-stack-cfi.yaml | 0 .../Breakpad/Inputs/unwind-via-stack-win.syms | 0 .../Breakpad/Inputs/unwind-via-stack-win.yaml | 0 .../line-table-discontinuous-file-ids.test | 0 .../Breakpad/line-table-edgecases.test | 0 .../Breakpad/line-table-missing-file.test | 0 .../line-table-mixed-path-styles.test | 0 .../SymbolFile/Breakpad/line-table.test | 0 .../Breakpad/stack-cfi-parsing.test | 0 .../SymbolFile/Breakpad/symtab-macho.test | 0 .../SymbolFile/Breakpad/symtab.test | 0 .../Breakpad/unwind-via-raSearch.test | 0 .../Breakpad/unwind-via-stack-cfi.test | 0 .../Breakpad/unwind-via-stack-win.test | 0 .../DWARF/Inputs/debug-line-basic.script | 0 .../DWARF/Inputs/debug-types-basic.cpp | 0 .../DWARF/Inputs/debug-types-expressions.cpp | 0 ...parator-no-comp-dir-relative-name.lldbinit | 0 .../DWARF/Inputs/dir-separator-posix.lldbinit | 0 .../Inputs/dir-separator-windows.lldbinit | 0 .../DWARF/Inputs/find-variable-file-2.cpp | 0 .../SymbolFile/DWARF/apple-index-is-used.cpp | 0 .../SymbolFile/DWARF/array-sizes.s | 0 .../SymbolFile/DWARF/childless-compile-unit.s | 0 .../SymbolFile/DWARF/compilercontext.ll | 0 .../SymbolFile/DWARF/debug-line-basic.s | 0 .../DWARF/debug-names-compressed.cpp | 0 .../DWARF/debug-types-address-ranges.s | 0 .../SymbolFile/DWARF/debug-types-basic.test | 0 .../SymbolFile/DWARF/debug-types-dwarf5.s | 0 .../DWARF/debug-types-dwo-cross-reference.cpp | 0 .../DWARF/debug-types-expressions.test | 0 .../DWARF/debug-types-line-tables.s | 0 .../DWARF/debug-types-missing-signature.test | 0 .../DWARF/debug-types-signature-loop.s | 0 .../DWARF/debug_aranges-empty-section.s | 0 .../SymbolFile/DWARF/debug_loc.s | 0 .../DWARF/debug_ranges-missing-section.s | 0 .../SymbolFile/DWARF/debug_ranges.s | 0 .../DWARF/debug_ranges_and_rnglists.test | 0 .../SymbolFile/DWARF/debug_rnglists.s | 0 .../SymbolFile/DWARF/deterministic-build.cpp | 0 .../dir-separator-no-comp-dir-relative-name.s | 0 .../DWARF/dir-separator-no-comp-dir.s | 0 .../SymbolFile/DWARF/dir-separator-posix.s | 0 .../SymbolFile/DWARF/dir-separator-windows.s | 0 .../SymbolFile/DWARF/dwarf5-index-is-used.cpp | 0 .../SymbolFile/DWARF/dwarf5-partial-index.cpp | 0 .../SymbolFile/DWARF/dwarf5_locations.s | 0 .../SymbolFile/DWARF/find-basic-function.cpp | 0 .../SymbolFile/DWARF/find-basic-namespace.cpp | 0 .../SymbolFile/DWARF/find-basic-type.cpp | 0 .../SymbolFile/DWARF/find-basic-variable.cpp | 0 .../SymbolFile/DWARF/find-function-regex.cpp | 0 .../SymbolFile/DWARF/find-inline-method.s | 0 .../DWARF/find-method-local-struct.cpp | 0 .../SymbolFile/DWARF/find-method.cpp | 0 .../DWARF/find-qualified-variable.cpp | 0 .../DWARF/find-type-in-function.cpp | 0 .../SymbolFile/DWARF/find-variable-dwo.cpp | 0 .../SymbolFile/DWARF/find-variable-file.cpp | 0 .../SymbolFile/DWARF/forward-declarations.s | 0 .../DWARF/gnu-style-compression.cpp | 0 .../SymbolFile/DWARF/lit.local.cfg | 0 .../DWARF/parallel-indexing-stress.s | 0 .../SymbolFile/DWARF/split-dwarf-inlining.cpp | 0 .../DWARF/split-dwarf-multiple-cu.ll | 0 .../SymbolFile/Inputs/sizeless-symbol.s | 0 .../Inputs/target-symbols-add-unwind.c | 0 .../NativePDB/Inputs/ast-functions.lldbinit | 0 .../NativePDB/Inputs/ast-methods.lldbinit | 0 .../NativePDB/Inputs/ast-types.lldbinit | 0 .../NativePDB/Inputs/bitfields.lldbinit | 0 .../Inputs/break-by-function.lldbinit | 0 .../NativePDB/Inputs/break-by-line.lldbinit | 0 .../NativePDB/Inputs/disassembly.lldbinit | 0 .../Inputs/function-types-builtins.lldbinit | 0 .../function-types-calling-conv.lldbinit | 0 .../Inputs/function-types-classes.lldbinit | 0 .../NativePDB/Inputs/globals-bss.lldbinit | 0 .../NativePDB/Inputs/globals-classes.lldbinit | 0 .../Inputs/globals-fundamental.lldbinit | 0 .../NativePDB/Inputs/local-variables.lldbinit | 0 .../NativePDB/Inputs/nested-types.lldbinit | 0 .../NativePDB/Inputs/s_constant.lldbinit | 0 .../SymbolFile/NativePDB/Inputs/s_constant.s | 0 .../NativePDB/Inputs/source-list.lldbinit | 0 .../Inputs/stack_unwinding01.lldbinit | 0 .../NativePDB/Inputs/tag-types.lldbinit | 0 .../NativePDB/ast-functions-msvc.cpp | 0 .../SymbolFile/NativePDB/ast-functions.cpp | 0 .../SymbolFile/NativePDB/ast-methods.cpp | 0 .../SymbolFile/NativePDB/ast-types.cpp | 0 .../SymbolFile/NativePDB/bitfields.cpp | 0 .../NativePDB/break-by-function.cpp | 0 .../SymbolFile/NativePDB/break-by-line.cpp | 0 .../SymbolFile/NativePDB/disassembly.cpp | 0 .../NativePDB/function-types-builtins.cpp | 0 .../NativePDB/function-types-calling-conv.cpp | 0 .../NativePDB/function-types-classes.cpp | 0 .../SymbolFile/NativePDB/global-classes.cpp | 0 .../SymbolFile/NativePDB/globals-bss.cpp | 0 .../NativePDB/globals-fundamental.cpp | 0 .../SymbolFile/NativePDB/local-variables.cpp | 0 .../SymbolFile/NativePDB/nested-types.cpp | 0 .../SymbolFile/NativePDB/s_constant.cpp | 0 .../SymbolFile/NativePDB/source-list.cpp | 0 .../NativePDB/stack_unwinding01.cpp | 0 .../SymbolFile/NativePDB/tag-types.cpp | 0 .../SymbolFile/NativePDB/typedefs.cpp | 0 .../SymbolFile/PDB/Inputs/AstRestoreTest.cpp | 0 .../PDB/Inputs/CallingConventionsTest.cpp | 0 .../SymbolFile/PDB/Inputs/ClassLayoutTest.cpp | 0 .../SymbolFile/PDB/Inputs/CompilandsTest.cpp | 0 .../SymbolFile/PDB/Inputs/ExpressionsTest.cpp | 0 .../PDB/Inputs/ExpressionsTest0.script | 0 .../PDB/Inputs/ExpressionsTest1.script | 0 .../PDB/Inputs/ExpressionsTest2.script | 0 .../SymbolFile/PDB/Inputs/FuncSymbols.cpp | 0 .../PDB/Inputs/FuncSymbolsTestMain.cpp | 0 .../PDB/Inputs/FunctionLevelLinkingTest.cpp | 0 .../PDB/Inputs/FunctionLevelLinkingTest.h | 0 .../PDB/Inputs/FunctionLevelLinkingTest.ord | 0 .../PDB/Inputs/FunctionNestedBlockTest.cpp | 0 .../SymbolFile/PDB/Inputs/PointerTypeTest.cpp | 0 .../SymbolFile/PDB/Inputs/SimpleTypesTest.cpp | 0 .../SymbolFile/PDB/Inputs/TypeQualsTest.cpp | 0 .../SymbolFile/PDB/Inputs/UdtLayoutTest.cpp | 0 .../PDB/Inputs/UdtLayoutTest.script | 0 .../SymbolFile/PDB/Inputs/VBases.cpp | 0 .../SymbolFile/PDB/Inputs/VBases.script | 0 .../PDB/Inputs/VariablesLocationsTest.cpp | 0 .../PDB/Inputs/VariablesLocationsTest.script | 0 .../SymbolFile/PDB/Inputs/VariablesTest.cpp | 0 .../SymbolFile/PDB/ast-restore.test | 0 .../SymbolFile/PDB/calling-conventions.test | 0 .../SymbolFile/PDB/class-layout.test | 0 .../SymbolFile/PDB/compilands.test | 0 .../SymbolFile/PDB/enums-layout.test | 0 .../SymbolFile/PDB/expressions.test | 0 .../SymbolFile/PDB/func-symbols.test | 0 .../PDB/function-level-linking.test | 0 .../SymbolFile/PDB/function-nested-block.test | 0 .../SymbolFile/PDB/pointers.test | 0 .../SymbolFile/PDB/type-quals.test | 0 .../SymbolFile/PDB/typedefs.test | 0 .../SymbolFile/PDB/udt-layout.test | 0 .../SymbolFile/PDB/variables-locations.test | 0 .../SymbolFile/PDB/variables.test | 0 .../Shell => lit}/SymbolFile/PDB/vbases.test | 0 .../SymbolFile/dissassemble-entry-point.s | 0 .../SymbolFile/sizeless-symbol.test | 0 .../SymbolFile/target-symbols-add-unwind.test | 0 lldb/{test => lit}/Unit/lit.cfg.py | 2 +- lldb/{test => lit}/Unit/lit.site.cfg.py.in | 2 +- .../Shell => lit}/Unwind/Inputs/call-asm.c | 0 .../Unwind/Inputs/eh-frame-dwarf-unwind.s | 0 .../Unwind/Inputs/eh-frame-small-fde.s | 0 .../Inputs/prefer-debug-over-eh-frame.s | 0 .../Unwind/Inputs/trap_frame_sym_ctx.s | 0 .../Unwind/Inputs/unwind-plan-dwarf-dump.s | 0 .../Unwind/eh-frame-dwarf-unwind.test | 0 .../Unwind/eh-frame-small-fde.test | 0 .../Unwind/prefer-debug-over-eh-frame.test | 0 .../Unwind/trap_frame_sym_ctx.test | 0 .../Unwind/unwind-plan-dwarf-dump.test | 0 .../Shell => lit}/Watchpoint/Inputs/main.cpp | 0 .../Watchpoint/SetErrorCases.test | 0 lldb/{test/Shell => lit}/helper/__init__.py | 0 lldb/{test/Shell => lit}/helper/build.py | 0 lldb/{test/Shell => lit}/helper/toolchain.py | 2 +- lldb/{test/Shell => lit}/lit-lldb-init.in | 0 lldb/{test/Shell => lit}/lit.cfg.py | 4 +- lldb/{test/Shell => lit}/lit.site.cfg.py.in | 2 +- lldb/test/API/CMakeLists.txt | 149 ----------- lldb/test/API/README.md | 4 - lldb/test/CMakeLists.txt | 236 ++++++++++-------- lldb/test/Unit/README.md | 4 - lldb/test/{API => }/dotest.py | 0 lldb/test/lit.cfg.py | 41 --- lldb/test/{API => }/testcases | 0 lldb/test/{API => }/use_lldb_suite.py | 0 449 files changed, 262 insertions(+), 312 deletions(-) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/case-sensitive.c (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/debug_addrx.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/debug_rnglist_basic.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/debug_rnglistx_rlex.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/implicit_const_form_support.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/jitbp.cpp (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/ppc64-localentry.s (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/single-file-split-dwarf.o.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/single-file-split-dwarf.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml (100%) rename lldb/{test/Shell => lit}/Breakpoint/case-insensitive.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/case-sensitive.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/debug_addrx.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/debug_rnglist_basic.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/debug_rnglist_offset_pair.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/debug_rnglist_rlestartend.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/debug_rnglistx_rlex.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/implicit_const_form_support.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/jitbp_elf.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/ppc64-localentry.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/single-file-split-dwarf.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/split-dwarf-5-addrbase.test (100%) rename lldb/{test/Shell => lit}/Breakpoint/split-dwarf5-debug-stroffsets.test (100%) rename lldb/{test/Shell => lit}/BuildScript/compiler-full-path.test (100%) rename lldb/{test/Shell => lit}/BuildScript/modes.test (100%) rename lldb/{test/Shell => lit}/BuildScript/script-args.test (100%) rename lldb/{test/Shell => lit}/BuildScript/toolchain-clang-cl.test (100%) rename lldb/{test/Shell => lit}/BuildScript/toolchain-clang.test (100%) rename lldb/{test/Shell => lit}/BuildScript/toolchain-msvc.test (100%) create mode 100644 lldb/lit/CMakeLists.txt rename lldb/{test/Shell => lit}/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test (100%) rename lldb/{test/Shell => lit}/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test (100%) rename lldb/{test/Shell => lit}/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py (100%) rename lldb/{test/Shell => lit}/Commands/CommandScriptImmediateOutput/lit.local.cfg (100%) rename lldb/{test/Shell => lit}/Commands/Inputs/frame.py (100%) rename lldb/{test/Shell => lit}/Commands/Inputs/main.c (100%) rename lldb/{test/Shell => lit}/Commands/command-backtrace.test (100%) rename lldb/{test/Shell => lit}/Commands/command-regex-delete.test (100%) rename lldb/{test/Shell => lit}/Commands/command-regex-unalias.test (100%) rename lldb/{test/Shell => lit}/Commands/command-script-import.test (100%) rename lldb/{test/Shell => lit}/Commands/command-source.test (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/.lldbinit (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/Print0.in (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/Print2.in (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/Print4.in (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/Print6.in (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/convenience.in (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/hello.c (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/hello.cpp (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/process_attach_pid.in (100%) rename lldb/{test/Shell => lit}/Driver/Inputs/syntax_error.py (100%) rename lldb/{test/Shell => lit}/Driver/LocalLLDBInit.test (100%) rename lldb/{test/Shell => lit}/Driver/TestCommands.test (100%) rename lldb/{test/Shell => lit}/Driver/TestConvenienceVariables.test (100%) rename lldb/{test/Shell => lit}/Driver/TestCore.test (100%) rename lldb/{test/Shell => lit}/Driver/TestFile.test (100%) rename lldb/{test/Shell => lit}/Driver/TestNoUseColor.test (100%) rename lldb/{test/Shell => lit}/Driver/TestProcessAttach.test (100%) rename lldb/{test/Shell => lit}/Driver/TestRepl.test (100%) rename lldb/{test/Shell => lit}/Driver/TestSingleQuote.test (100%) rename lldb/{test/Shell => lit}/Driver/TestTarget.test (100%) rename lldb/{test/Shell => lit}/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit (100%) rename lldb/{test/Shell => lit}/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit (100%) rename lldb/{test/Shell => lit}/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit (100%) rename lldb/{test/Shell => lit}/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit (100%) rename lldb/{test/Shell => lit}/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit (100%) rename lldb/{test/Shell => lit}/ExecControl/StopHook/Inputs/stop-hook-threads.cpp (100%) rename lldb/{test/Shell => lit}/ExecControl/StopHook/Inputs/stop-hook.c (100%) rename lldb/{test/Shell => lit}/ExecControl/StopHook/stop-hook-threads.test (100%) rename lldb/{test/Shell => lit}/ExecControl/StopHook/stop-hook.test (100%) rename lldb/{test/Shell => lit}/Expr/Inputs/call-function.cpp (100%) rename lldb/{test/Shell => lit}/Expr/Inputs/ir-memory-map-basic (100%) rename lldb/{test/Shell => lit}/Expr/Inputs/ir-memory-map-mix-malloc-free (100%) rename lldb/{test/Shell => lit}/Expr/Inputs/ir-memory-map-overlap1 (100%) rename lldb/{test/Shell => lit}/Expr/TestIRMemoryMap.test (100%) rename lldb/{test/Shell => lit}/Expr/TestIRMemoryMapWindows.test (100%) rename lldb/{test/Shell => lit}/Expr/TestMultilineExpr.test (100%) rename lldb/{test/Shell => lit}/Expr/TestTypeOfDeclTypeExpr.test (100%) rename lldb/{test/Shell => lit}/Heap/Inputs/cstr.c (100%) rename lldb/{test/Shell => lit}/Heap/heap-cstr.test (100%) rename lldb/{test/Shell => lit}/Host/Inputs/simple.c (100%) rename lldb/{test/Shell => lit}/Host/TestCustomShell.test (100%) rename lldb/{test/Shell => lit}/Minidump/Inputs/linux-x86_64.syms (100%) rename lldb/{test/Shell => lit}/Minidump/Inputs/linux-x86_64.yaml (100%) rename lldb/{test/Shell => lit}/Minidump/Windows/Inputs/find-module.dmp.yaml (100%) rename lldb/{test/Shell => lit}/Minidump/Windows/Inputs/find-module.exe.yaml (100%) rename lldb/{test/Shell => lit}/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp (100%) rename lldb/{test/Shell => lit}/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp (100%) rename lldb/{test/Shell => lit}/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit (100%) rename lldb/{test/Shell => lit}/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb (100%) rename lldb/{test/Shell => lit}/Minidump/Windows/Sigsegv/sigsegv.test (100%) rename lldb/{test/Shell => lit}/Minidump/Windows/find-module.test (100%) rename lldb/{test/Shell => lit}/Minidump/breakpad-symbols.test (100%) rename lldb/{test/Shell => lit}/Minidump/disassemble-no-module.yaml (100%) rename lldb/{test/Shell => lit}/Minidump/dump-all.test (100%) rename lldb/{test/Shell => lit}/Minidump/fb-dump.test (100%) rename lldb/{test/Shell => lit}/Minidump/lit.local.cfg (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/identification-linux.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/identification-macosx.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/identification-windows.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/sections.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/breakpad-identification.test (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/discontiguous-sections.test (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/lit.local.cfg (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/sections-trailing-func.test (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/sections.test (100%) rename lldb/{test/Shell => lit}/ObjectFile/Breakpad/uuid-matching-mac.test (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/Inputs/minidebuginfo-main.c (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/Inputs/netbsd-amd64.core (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/PT_LOAD-empty.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/PT_LOAD-overlap-section.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/PT_LOAD-overlap.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/PT_LOAD.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/aarch64-relocations.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/base-address.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/basic-info.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/build-id-case.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/compressed-sections.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/duplicate-section.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/gnu-debuglink.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/many-sections.s (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/minidebuginfo-find-symbols.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/minidebuginfo-no-lzma.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/netbsd-core-amd64.test (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/section-addresses.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/section-overlap.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/section-permissions.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/section-types-edgecases.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/section-types.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/ELF/short-build-id.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/MachO/lc_build_version.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/MachO/lc_build_version_notools.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/MachO/lc_version_min.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/MachO/subsections.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/MachO/symtab.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/PECOFF/basic-info-arm.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/PECOFF/basic-info-arm64.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/PECOFF/basic-info.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/PECOFF/dep-modules.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/PECOFF/export-dllfunc.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/PECOFF/lit.local.cfg (100%) rename lldb/{test/Shell => lit}/ObjectFile/PECOFF/sections-names.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/PECOFF/subsections.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/PECOFF/uuid.yaml (100%) rename lldb/{test/Shell => lit}/ObjectFile/lit.local.cfg (100%) rename lldb/{test/Shell => lit}/Process/Inputs/env.cpp (100%) rename lldb/{test/Shell => lit}/Process/TestEnvironment.test (100%) rename lldb/{test/Shell => lit}/Process/Windows/exception_access_violation.cpp (100%) rename lldb/{test/Shell => lit}/Python/crashlog.test (97%) rename lldb/{test/Shell => lit}/Quit/TestQuitExitCode-30.test (100%) rename lldb/{test/Shell => lit}/Quit/TestQuitExitCode0.test (100%) rename lldb/{test/Shell => lit}/Quit/TestQuitExitCode30.test (100%) rename lldb/{test/Shell => lit}/Quit/TestQuitExitCodeHex0.test (100%) rename lldb/{test/Shell => lit}/Quit/TestQuitExitCodeHexA.test (100%) rename lldb/{test/Shell => lit}/Quit/TestQuitExitCodeImplicit0.test (100%) rename lldb/{test/Shell => lit}/Quit/TestQuitExitCodeNonInt.test (100%) rename lldb/{test/Shell => lit}/Quit/TestQuitExitCodeTooManyArgs.test (100%) rename lldb/{test/Shell => lit}/Quit/expect_exit_code.py (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-64-gp-read.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-64-gp-write.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-64-read.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-64-write.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-gp-read.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-gp-write.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-mm-xmm-read.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-mm-xmm-write.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-ymm-read.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-ymm-write.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-zmm-read.cpp (100%) rename lldb/{test/Shell => lit}/Register/Inputs/x86-zmm-write.cpp (100%) rename lldb/{test/Shell => lit}/Register/x86-64-gp-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-gp-write.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-write.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-xmm16-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-xmm16-write.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-ymm-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-ymm-write.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-ymm16-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-ymm16-write.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-zmm-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-64-zmm-write.test (100%) rename lldb/{test/Shell => lit}/Register/x86-gp-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-gp-write.test (100%) rename lldb/{test/Shell => lit}/Register/x86-mm-xmm-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-mm-xmm-write.test (100%) rename lldb/{test/Shell => lit}/Register/x86-ymm-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-ymm-write.test (100%) rename lldb/{test/Shell => lit}/Register/x86-zmm-read.test (100%) rename lldb/{test/Shell => lit}/Register/x86-zmm-write.test (100%) rename lldb/{test/Shell => lit}/Reproducer/Functionalities/Inputs/DataFormatter.in (100%) rename lldb/{test/Shell => lit}/Reproducer/Functionalities/Inputs/foo.cpp (100%) rename lldb/{test/Shell => lit}/Reproducer/Functionalities/Inputs/stepping.c (100%) rename lldb/{test/Shell => lit}/Reproducer/Functionalities/TestDataFormatter.test (100%) rename lldb/{test/Shell => lit}/Reproducer/Functionalities/TestImageList.test (100%) rename lldb/{test/Shell => lit}/Reproducer/Functionalities/TestStepping.test (100%) rename lldb/{test/Shell => lit}/Reproducer/Inputs/FileCapture.in (100%) rename lldb/{test/Shell => lit}/Reproducer/Inputs/GDBRemoteCapture.in (100%) rename lldb/{test/Shell => lit}/Reproducer/Inputs/simple.c (100%) rename lldb/{test/Shell => lit}/Reproducer/Modules/Inputs/Bar.h (100%) rename lldb/{test/Shell => lit}/Reproducer/Modules/Inputs/Foo.h (100%) rename lldb/{test/Shell => lit}/Reproducer/Modules/Inputs/ModuleCXX.in (100%) rename lldb/{test/Shell => lit}/Reproducer/Modules/Inputs/main.cpp (100%) rename lldb/{test/Shell => lit}/Reproducer/Modules/Inputs/module.modulemap (100%) rename lldb/{test/Shell => lit}/Reproducer/Modules/TestModuleCXX.test (100%) rename lldb/{test/Shell => lit}/Reproducer/TestDriverOptions.test (100%) rename lldb/{test/Shell => lit}/Reproducer/TestDump.test (100%) rename lldb/{test/Shell => lit}/Reproducer/TestFileRepro.test (100%) rename lldb/{test/Shell => lit}/Reproducer/TestGDBRemoteRepro.test (100%) rename lldb/{test/Shell => lit}/Reproducer/TestRelativePath.test (100%) rename lldb/{test/Shell => lit}/Reproducer/TestReuseDirectory.test (100%) rename lldb/{test/Shell => lit}/Reproducer/TestSynchronous.test (100%) rename lldb/{test/Shell => lit}/Settings/Inputs/DontStopCommandSource.in (100%) rename lldb/{test/Shell => lit}/Settings/Inputs/EchoCommandsAll.out (100%) rename lldb/{test/Shell => lit}/Settings/Inputs/EchoCommandsNoComments.out (100%) rename lldb/{test/Shell => lit}/Settings/Inputs/EchoCommandsNone.out (100%) rename lldb/{test/Shell => lit}/Settings/Inputs/EchoCommandsQuiet.out (100%) rename lldb/{test/Shell => lit}/Settings/Inputs/EchoCommandsTest.in (100%) rename lldb/{test/Shell => lit}/Settings/Inputs/StopCommandSource.in (100%) rename lldb/{test/Shell => lit}/Settings/Inputs/main.c (100%) rename lldb/{test/Shell => lit}/Settings/TestDisableColor.test (100%) rename lldb/{test/Shell => lit}/Settings/TestDisassemblyFormat.test (100%) rename lldb/{test/Shell => lit}/Settings/TestEchoCommands.test (100%) rename lldb/{test/Shell => lit}/Settings/TestFrameFormatColor.test (100%) rename lldb/{test/Shell => lit}/Settings/TestFrameFormatNoColor.test (100%) rename lldb/{test/Shell => lit}/Settings/TestModuleCacheSanity.test (100%) rename lldb/{test/Shell => lit}/Settings/TestSettingsSet.test (100%) rename lldb/{test/Shell => lit}/Settings/TestSettingsWrite.test (100%) rename lldb/{test/Shell => lit}/Settings/TestStopCommandSourceOnError.test (100%) rename lldb/{test/API => lit/Suite}/lit.cfg (96%) rename lldb/{test/API => lit/Suite}/lit.site.cfg.in (93%) rename lldb/{test/API => lit/Suite}/lldbtest.py (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/basic-elf.yaml (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/basic-macho.yaml (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/line-table.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/symtab-macho.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/symtab.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/line-table-edgecases.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/line-table-missing-file.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/line-table-mixed-path-styles.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/line-table.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/stack-cfi-parsing.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/symtab-macho.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/symtab.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/unwind-via-raSearch.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/unwind-via-stack-cfi.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/Breakpad/unwind-via-stack-win.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/Inputs/debug-line-basic.script (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/Inputs/debug-types-basic.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/apple-index-is-used.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/array-sizes.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/childless-compile-unit.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/compilercontext.ll (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-line-basic.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-names-compressed.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-types-address-ranges.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-types-basic.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-types-dwarf5.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-types-expressions.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-types-line-tables.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-types-missing-signature.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug-types-signature-loop.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug_aranges-empty-section.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug_loc.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug_ranges-missing-section.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug_ranges.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug_ranges_and_rnglists.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/debug_rnglists.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/deterministic-build.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/dir-separator-no-comp-dir.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/dir-separator-posix.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/dir-separator-windows.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/dwarf5-index-is-used.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/dwarf5-partial-index.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/dwarf5_locations.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-basic-function.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-basic-namespace.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-basic-type.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-basic-variable.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-function-regex.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-inline-method.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-method-local-struct.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-method.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-qualified-variable.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-type-in-function.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-variable-dwo.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/find-variable-file.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/forward-declarations.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/gnu-style-compression.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/lit.local.cfg (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/parallel-indexing-stress.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/split-dwarf-inlining.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/DWARF/split-dwarf-multiple-cu.ll (100%) rename lldb/{test/Shell => lit}/SymbolFile/Inputs/sizeless-symbol.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/Inputs/target-symbols-add-unwind.c (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/ast-types.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/bitfields.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/disassembly.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/local-variables.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/nested-types.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/s_constant.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/s_constant.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/source-list.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/Inputs/tag-types.lldbinit (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/ast-functions-msvc.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/ast-functions.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/ast-methods.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/ast-types.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/bitfields.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/break-by-function.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/break-by-line.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/disassembly.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/function-types-builtins.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/function-types-calling-conv.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/function-types-classes.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/global-classes.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/globals-bss.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/globals-fundamental.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/local-variables.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/nested-types.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/s_constant.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/source-list.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/stack_unwinding01.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/tag-types.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/NativePDB/typedefs.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/AstRestoreTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/CompilandsTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/ExpressionsTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/ExpressionsTest0.script (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/ExpressionsTest1.script (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/ExpressionsTest2.script (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/FuncSymbols.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/PointerTypeTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/TypeQualsTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/UdtLayoutTest.script (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/VBases.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/VBases.script (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/VariablesLocationsTest.script (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/Inputs/VariablesTest.cpp (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/ast-restore.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/calling-conventions.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/class-layout.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/compilands.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/enums-layout.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/expressions.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/func-symbols.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/function-level-linking.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/function-nested-block.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/pointers.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/type-quals.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/typedefs.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/udt-layout.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/variables-locations.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/variables.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/PDB/vbases.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/dissassemble-entry-point.s (100%) rename lldb/{test/Shell => lit}/SymbolFile/sizeless-symbol.test (100%) rename lldb/{test/Shell => lit}/SymbolFile/target-symbols-add-unwind.test (100%) rename lldb/{test => lit}/Unit/lit.cfg.py (97%) rename lldb/{test => lit}/Unit/lit.site.cfg.py.in (93%) rename lldb/{test/Shell => lit}/Unwind/Inputs/call-asm.c (100%) rename lldb/{test/Shell => lit}/Unwind/Inputs/eh-frame-dwarf-unwind.s (100%) rename lldb/{test/Shell => lit}/Unwind/Inputs/eh-frame-small-fde.s (100%) rename lldb/{test/Shell => lit}/Unwind/Inputs/prefer-debug-over-eh-frame.s (100%) rename lldb/{test/Shell => lit}/Unwind/Inputs/trap_frame_sym_ctx.s (100%) rename lldb/{test/Shell => lit}/Unwind/Inputs/unwind-plan-dwarf-dump.s (100%) rename lldb/{test/Shell => lit}/Unwind/eh-frame-dwarf-unwind.test (100%) rename lldb/{test/Shell => lit}/Unwind/eh-frame-small-fde.test (100%) rename lldb/{test/Shell => lit}/Unwind/prefer-debug-over-eh-frame.test (100%) rename lldb/{test/Shell => lit}/Unwind/trap_frame_sym_ctx.test (100%) rename lldb/{test/Shell => lit}/Unwind/unwind-plan-dwarf-dump.test (100%) rename lldb/{test/Shell => lit}/Watchpoint/Inputs/main.cpp (100%) rename lldb/{test/Shell => lit}/Watchpoint/SetErrorCases.test (100%) rename lldb/{test/Shell => lit}/helper/__init__.py (100%) rename lldb/{test/Shell => lit}/helper/build.py (100%) rename lldb/{test/Shell => lit}/helper/toolchain.py (98%) rename lldb/{test/Shell => lit}/lit-lldb-init.in (100%) rename lldb/{test/Shell => lit}/lit.cfg.py (97%) rename lldb/{test/Shell => lit}/lit.site.cfg.py.in (96%) delete mode 100644 lldb/test/API/CMakeLists.txt delete mode 100644 lldb/test/API/README.md delete mode 100644 lldb/test/Unit/README.md rename lldb/test/{API => }/dotest.py (100%) delete mode 100644 lldb/test/lit.cfg.py rename lldb/test/{API => }/testcases (100%) rename lldb/test/{API => }/use_lldb_suite.py (100%) diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 58a7ef1a9a785..317643a44225f 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -185,6 +185,7 @@ if(LLDB_INCLUDE_TESTS) add_subdirectory(test) add_subdirectory(unittests) + add_subdirectory(lit) add_subdirectory(utils/lit-cpuid) add_subdirectory(utils/lldb-dotest) endif() diff --git a/lldb/test/Shell/Breakpoint/Inputs/case-sensitive.c b/lldb/lit/Breakpoint/Inputs/case-sensitive.c similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/case-sensitive.c rename to lldb/lit/Breakpoint/Inputs/case-sensitive.c diff --git a/lldb/test/Shell/Breakpoint/Inputs/debug_addrx.yaml b/lldb/lit/Breakpoint/Inputs/debug_addrx.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/debug_addrx.yaml rename to lldb/lit/Breakpoint/Inputs/debug_addrx.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_basic.yaml b/lldb/lit/Breakpoint/Inputs/debug_rnglist_basic.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_basic.yaml rename to lldb/lit/Breakpoint/Inputs/debug_rnglist_basic.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml b/lldb/lit/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml rename to lldb/lit/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml b/lldb/lit/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml rename to lldb/lit/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/debug_rnglistx_rlex.yaml b/lldb/lit/Breakpoint/Inputs/debug_rnglistx_rlex.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/debug_rnglistx_rlex.yaml rename to lldb/lit/Breakpoint/Inputs/debug_rnglistx_rlex.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/implicit_const_form_support.yaml b/lldb/lit/Breakpoint/Inputs/implicit_const_form_support.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/implicit_const_form_support.yaml rename to lldb/lit/Breakpoint/Inputs/implicit_const_form_support.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/jitbp.cpp b/lldb/lit/Breakpoint/Inputs/jitbp.cpp similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/jitbp.cpp rename to lldb/lit/Breakpoint/Inputs/jitbp.cpp diff --git a/lldb/test/Shell/Breakpoint/Inputs/ppc64-localentry.s b/lldb/lit/Breakpoint/Inputs/ppc64-localentry.s similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/ppc64-localentry.s rename to lldb/lit/Breakpoint/Inputs/ppc64-localentry.s diff --git a/lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.o.yaml b/lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.o.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.o.yaml rename to lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.o.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.yaml b/lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.yaml rename to lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml b/lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml rename to lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml b/lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml rename to lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml b/lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml rename to lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml b/lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml rename to lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml diff --git a/lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml b/lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml similarity index 100% rename from lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml rename to lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml diff --git a/lldb/test/Shell/Breakpoint/case-insensitive.test b/lldb/lit/Breakpoint/case-insensitive.test similarity index 100% rename from lldb/test/Shell/Breakpoint/case-insensitive.test rename to lldb/lit/Breakpoint/case-insensitive.test diff --git a/lldb/test/Shell/Breakpoint/case-sensitive.test b/lldb/lit/Breakpoint/case-sensitive.test similarity index 100% rename from lldb/test/Shell/Breakpoint/case-sensitive.test rename to lldb/lit/Breakpoint/case-sensitive.test diff --git a/lldb/test/Shell/Breakpoint/debug_addrx.test b/lldb/lit/Breakpoint/debug_addrx.test similarity index 100% rename from lldb/test/Shell/Breakpoint/debug_addrx.test rename to lldb/lit/Breakpoint/debug_addrx.test diff --git a/lldb/test/Shell/Breakpoint/debug_rnglist_basic.test b/lldb/lit/Breakpoint/debug_rnglist_basic.test similarity index 100% rename from lldb/test/Shell/Breakpoint/debug_rnglist_basic.test rename to lldb/lit/Breakpoint/debug_rnglist_basic.test diff --git a/lldb/test/Shell/Breakpoint/debug_rnglist_offset_pair.test b/lldb/lit/Breakpoint/debug_rnglist_offset_pair.test similarity index 100% rename from lldb/test/Shell/Breakpoint/debug_rnglist_offset_pair.test rename to lldb/lit/Breakpoint/debug_rnglist_offset_pair.test diff --git a/lldb/test/Shell/Breakpoint/debug_rnglist_rlestartend.test b/lldb/lit/Breakpoint/debug_rnglist_rlestartend.test similarity index 100% rename from lldb/test/Shell/Breakpoint/debug_rnglist_rlestartend.test rename to lldb/lit/Breakpoint/debug_rnglist_rlestartend.test diff --git a/lldb/test/Shell/Breakpoint/debug_rnglistx_rlex.test b/lldb/lit/Breakpoint/debug_rnglistx_rlex.test similarity index 100% rename from lldb/test/Shell/Breakpoint/debug_rnglistx_rlex.test rename to lldb/lit/Breakpoint/debug_rnglistx_rlex.test diff --git a/lldb/test/Shell/Breakpoint/implicit_const_form_support.test b/lldb/lit/Breakpoint/implicit_const_form_support.test similarity index 100% rename from lldb/test/Shell/Breakpoint/implicit_const_form_support.test rename to lldb/lit/Breakpoint/implicit_const_form_support.test diff --git a/lldb/test/Shell/Breakpoint/jitbp_elf.test b/lldb/lit/Breakpoint/jitbp_elf.test similarity index 100% rename from lldb/test/Shell/Breakpoint/jitbp_elf.test rename to lldb/lit/Breakpoint/jitbp_elf.test diff --git a/lldb/test/Shell/Breakpoint/ppc64-localentry.test b/lldb/lit/Breakpoint/ppc64-localentry.test similarity index 100% rename from lldb/test/Shell/Breakpoint/ppc64-localentry.test rename to lldb/lit/Breakpoint/ppc64-localentry.test diff --git a/lldb/test/Shell/Breakpoint/single-file-split-dwarf.test b/lldb/lit/Breakpoint/single-file-split-dwarf.test similarity index 100% rename from lldb/test/Shell/Breakpoint/single-file-split-dwarf.test rename to lldb/lit/Breakpoint/single-file-split-dwarf.test diff --git a/lldb/test/Shell/Breakpoint/split-dwarf-5-addrbase.test b/lldb/lit/Breakpoint/split-dwarf-5-addrbase.test similarity index 100% rename from lldb/test/Shell/Breakpoint/split-dwarf-5-addrbase.test rename to lldb/lit/Breakpoint/split-dwarf-5-addrbase.test diff --git a/lldb/test/Shell/Breakpoint/split-dwarf5-debug-stroffsets.test b/lldb/lit/Breakpoint/split-dwarf5-debug-stroffsets.test similarity index 100% rename from lldb/test/Shell/Breakpoint/split-dwarf5-debug-stroffsets.test rename to lldb/lit/Breakpoint/split-dwarf5-debug-stroffsets.test diff --git a/lldb/test/Shell/BuildScript/compiler-full-path.test b/lldb/lit/BuildScript/compiler-full-path.test similarity index 100% rename from lldb/test/Shell/BuildScript/compiler-full-path.test rename to lldb/lit/BuildScript/compiler-full-path.test diff --git a/lldb/test/Shell/BuildScript/modes.test b/lldb/lit/BuildScript/modes.test similarity index 100% rename from lldb/test/Shell/BuildScript/modes.test rename to lldb/lit/BuildScript/modes.test diff --git a/lldb/test/Shell/BuildScript/script-args.test b/lldb/lit/BuildScript/script-args.test similarity index 100% rename from lldb/test/Shell/BuildScript/script-args.test rename to lldb/lit/BuildScript/script-args.test diff --git a/lldb/test/Shell/BuildScript/toolchain-clang-cl.test b/lldb/lit/BuildScript/toolchain-clang-cl.test similarity index 100% rename from lldb/test/Shell/BuildScript/toolchain-clang-cl.test rename to lldb/lit/BuildScript/toolchain-clang-cl.test diff --git a/lldb/test/Shell/BuildScript/toolchain-clang.test b/lldb/lit/BuildScript/toolchain-clang.test similarity index 100% rename from lldb/test/Shell/BuildScript/toolchain-clang.test rename to lldb/lit/BuildScript/toolchain-clang.test diff --git a/lldb/test/Shell/BuildScript/toolchain-msvc.test b/lldb/lit/BuildScript/toolchain-msvc.test similarity index 100% rename from lldb/test/Shell/BuildScript/toolchain-msvc.test rename to lldb/lit/BuildScript/toolchain-msvc.test diff --git a/lldb/lit/CMakeLists.txt b/lldb/lit/CMakeLists.txt new file mode 100644 index 0000000000000..3e759b0e187a3 --- /dev/null +++ b/lldb/lit/CMakeLists.txt @@ -0,0 +1,115 @@ +# Test runner infrastructure for LLDB. This configures the LLDB test trees +# for use by Lit, and delegates to LLVM's lit test handlers. + +# LLVM_BUILD_MODE is used in lit.site.cfg +if (CMAKE_CFG_INTDIR STREQUAL ".") + set(LLVM_BUILD_MODE ".") +else () + set(LLVM_BUILD_MODE "%(build_mode)s") +endif () + +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(LLDB_IS_64_BITS 1) +endif() + +get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY) +set(dotest_args_replacement ${LLVM_BUILD_MODE}) + +set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.") +set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.") + +if(LLDB_BUILT_STANDALONE) + # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder. + string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR}) + string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") + + # Remaining ones must be paths to the provided LLVM build-tree. + if(LLVM_CONFIGURATION_TYPES) + # LLDB uses single-config; LLVM multi-config; pick one and prefer Release types. + # Otherwise, if both use multi-config the default is fine. + if(NOT CMAKE_CONFIGURATION_TYPES) + if(RelWithDebInfo IN_LIST LLVM_CONFIGURATION_TYPES) + set(dotest_args_replacement RelWithDebInfo) + elseif(Release IN_LIST LLVM_CONFIGURATION_TYPES) + set(dotest_args_replacement Release) + else() + list(GET LLVM_CONFIGURATION_TYPES 0 dotest_args_replacement) + endif() + endif() + else() + # Common case: LLVM used a single-configuration generator like Ninja. + set(dotest_args_replacement ".") + endif() +endif() + +string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") +string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) + +add_lldb_test_dependency( + lit-cpuid + llc + lli + llvm-config + llvm-dwarfdump + llvm-nm + llvm-mc + llvm-objcopy + llvm-readobj + llvm-strip + ) + +if(TARGET lld) + add_lldb_test_dependency(lld) +endif() + +# the value is not canonicalized within LLVM +llvm_canonicalize_cmake_booleans( + LLDB_DISABLE_PYTHON + LLVM_ENABLE_ZLIB + LLVM_ENABLE_SHARED_LIBS + LLDB_IS_64_BITS) + +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py + MAIN_CONFIG + ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py + MAIN_CONFIG + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/lit-lldb-init.in + ${CMAKE_CURRENT_BINARY_DIR}/lit-lldb-init) + +if(NOT LLDB_BUILT_STANDALONE) + add_lldb_test_dependency( + FileCheck + count + not + ) +endif() + +add_lit_testsuite(check-lldb-lit "Running lldb lit test suite" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS lldb-test-deps + ) + +set_target_properties(check-lldb-lit PROPERTIES FOLDER "lldb tests") + +# If we're building with an in-tree clang, then list clang as a dependency +# to run tests. +if (TARGET clang) + add_dependencies(check-lldb-lit clang) +endif() + +add_lit_testsuites(LLDB + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS lldb-test-deps + ) diff --git a/lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test b/lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test similarity index 100% rename from lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test rename to lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test diff --git a/lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test b/lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test similarity index 100% rename from lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test rename to lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test diff --git a/lldb/test/Shell/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py b/lldb/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py similarity index 100% rename from lldb/test/Shell/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py rename to lldb/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py diff --git a/lldb/test/Shell/Commands/CommandScriptImmediateOutput/lit.local.cfg b/lldb/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg similarity index 100% rename from lldb/test/Shell/Commands/CommandScriptImmediateOutput/lit.local.cfg rename to lldb/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg diff --git a/lldb/test/Shell/Commands/Inputs/frame.py b/lldb/lit/Commands/Inputs/frame.py similarity index 100% rename from lldb/test/Shell/Commands/Inputs/frame.py rename to lldb/lit/Commands/Inputs/frame.py diff --git a/lldb/test/Shell/Commands/Inputs/main.c b/lldb/lit/Commands/Inputs/main.c similarity index 100% rename from lldb/test/Shell/Commands/Inputs/main.c rename to lldb/lit/Commands/Inputs/main.c diff --git a/lldb/test/Shell/Commands/command-backtrace.test b/lldb/lit/Commands/command-backtrace.test similarity index 100% rename from lldb/test/Shell/Commands/command-backtrace.test rename to lldb/lit/Commands/command-backtrace.test diff --git a/lldb/test/Shell/Commands/command-regex-delete.test b/lldb/lit/Commands/command-regex-delete.test similarity index 100% rename from lldb/test/Shell/Commands/command-regex-delete.test rename to lldb/lit/Commands/command-regex-delete.test diff --git a/lldb/test/Shell/Commands/command-regex-unalias.test b/lldb/lit/Commands/command-regex-unalias.test similarity index 100% rename from lldb/test/Shell/Commands/command-regex-unalias.test rename to lldb/lit/Commands/command-regex-unalias.test diff --git a/lldb/test/Shell/Commands/command-script-import.test b/lldb/lit/Commands/command-script-import.test similarity index 100% rename from lldb/test/Shell/Commands/command-script-import.test rename to lldb/lit/Commands/command-script-import.test diff --git a/lldb/test/Shell/Commands/command-source.test b/lldb/lit/Commands/command-source.test similarity index 100% rename from lldb/test/Shell/Commands/command-source.test rename to lldb/lit/Commands/command-source.test diff --git a/lldb/test/Shell/Driver/Inputs/.lldbinit b/lldb/lit/Driver/Inputs/.lldbinit similarity index 100% rename from lldb/test/Shell/Driver/Inputs/.lldbinit rename to lldb/lit/Driver/Inputs/.lldbinit diff --git a/lldb/test/Shell/Driver/Inputs/Print0.in b/lldb/lit/Driver/Inputs/Print0.in similarity index 100% rename from lldb/test/Shell/Driver/Inputs/Print0.in rename to lldb/lit/Driver/Inputs/Print0.in diff --git a/lldb/test/Shell/Driver/Inputs/Print2.in b/lldb/lit/Driver/Inputs/Print2.in similarity index 100% rename from lldb/test/Shell/Driver/Inputs/Print2.in rename to lldb/lit/Driver/Inputs/Print2.in diff --git a/lldb/test/Shell/Driver/Inputs/Print4.in b/lldb/lit/Driver/Inputs/Print4.in similarity index 100% rename from lldb/test/Shell/Driver/Inputs/Print4.in rename to lldb/lit/Driver/Inputs/Print4.in diff --git a/lldb/test/Shell/Driver/Inputs/Print6.in b/lldb/lit/Driver/Inputs/Print6.in similarity index 100% rename from lldb/test/Shell/Driver/Inputs/Print6.in rename to lldb/lit/Driver/Inputs/Print6.in diff --git a/lldb/test/Shell/Driver/Inputs/convenience.in b/lldb/lit/Driver/Inputs/convenience.in similarity index 100% rename from lldb/test/Shell/Driver/Inputs/convenience.in rename to lldb/lit/Driver/Inputs/convenience.in diff --git a/lldb/test/Shell/Driver/Inputs/hello.c b/lldb/lit/Driver/Inputs/hello.c similarity index 100% rename from lldb/test/Shell/Driver/Inputs/hello.c rename to lldb/lit/Driver/Inputs/hello.c diff --git a/lldb/test/Shell/Driver/Inputs/hello.cpp b/lldb/lit/Driver/Inputs/hello.cpp similarity index 100% rename from lldb/test/Shell/Driver/Inputs/hello.cpp rename to lldb/lit/Driver/Inputs/hello.cpp diff --git a/lldb/test/Shell/Driver/Inputs/process_attach_pid.in b/lldb/lit/Driver/Inputs/process_attach_pid.in similarity index 100% rename from lldb/test/Shell/Driver/Inputs/process_attach_pid.in rename to lldb/lit/Driver/Inputs/process_attach_pid.in diff --git a/lldb/test/Shell/Driver/Inputs/syntax_error.py b/lldb/lit/Driver/Inputs/syntax_error.py similarity index 100% rename from lldb/test/Shell/Driver/Inputs/syntax_error.py rename to lldb/lit/Driver/Inputs/syntax_error.py diff --git a/lldb/test/Shell/Driver/LocalLLDBInit.test b/lldb/lit/Driver/LocalLLDBInit.test similarity index 100% rename from lldb/test/Shell/Driver/LocalLLDBInit.test rename to lldb/lit/Driver/LocalLLDBInit.test diff --git a/lldb/test/Shell/Driver/TestCommands.test b/lldb/lit/Driver/TestCommands.test similarity index 100% rename from lldb/test/Shell/Driver/TestCommands.test rename to lldb/lit/Driver/TestCommands.test diff --git a/lldb/test/Shell/Driver/TestConvenienceVariables.test b/lldb/lit/Driver/TestConvenienceVariables.test similarity index 100% rename from lldb/test/Shell/Driver/TestConvenienceVariables.test rename to lldb/lit/Driver/TestConvenienceVariables.test diff --git a/lldb/test/Shell/Driver/TestCore.test b/lldb/lit/Driver/TestCore.test similarity index 100% rename from lldb/test/Shell/Driver/TestCore.test rename to lldb/lit/Driver/TestCore.test diff --git a/lldb/test/Shell/Driver/TestFile.test b/lldb/lit/Driver/TestFile.test similarity index 100% rename from lldb/test/Shell/Driver/TestFile.test rename to lldb/lit/Driver/TestFile.test diff --git a/lldb/test/Shell/Driver/TestNoUseColor.test b/lldb/lit/Driver/TestNoUseColor.test similarity index 100% rename from lldb/test/Shell/Driver/TestNoUseColor.test rename to lldb/lit/Driver/TestNoUseColor.test diff --git a/lldb/test/Shell/Driver/TestProcessAttach.test b/lldb/lit/Driver/TestProcessAttach.test similarity index 100% rename from lldb/test/Shell/Driver/TestProcessAttach.test rename to lldb/lit/Driver/TestProcessAttach.test diff --git a/lldb/test/Shell/Driver/TestRepl.test b/lldb/lit/Driver/TestRepl.test similarity index 100% rename from lldb/test/Shell/Driver/TestRepl.test rename to lldb/lit/Driver/TestRepl.test diff --git a/lldb/test/Shell/Driver/TestSingleQuote.test b/lldb/lit/Driver/TestSingleQuote.test similarity index 100% rename from lldb/test/Shell/Driver/TestSingleQuote.test rename to lldb/lit/Driver/TestSingleQuote.test diff --git a/lldb/test/Shell/Driver/TestTarget.test b/lldb/lit/Driver/TestTarget.test similarity index 100% rename from lldb/test/Shell/Driver/TestTarget.test rename to lldb/lit/Driver/TestTarget.test diff --git a/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit similarity index 100% rename from lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit rename to lldb/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit diff --git a/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit similarity index 100% rename from lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit rename to lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit diff --git a/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit similarity index 100% rename from lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit rename to lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit diff --git a/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit similarity index 100% rename from lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit rename to lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit diff --git a/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit similarity index 100% rename from lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit rename to lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit diff --git a/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads.cpp b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp similarity index 100% rename from lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads.cpp rename to lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp diff --git a/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook.c b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook.c similarity index 100% rename from lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook.c rename to lldb/lit/ExecControl/StopHook/Inputs/stop-hook.c diff --git a/lldb/test/Shell/ExecControl/StopHook/stop-hook-threads.test b/lldb/lit/ExecControl/StopHook/stop-hook-threads.test similarity index 100% rename from lldb/test/Shell/ExecControl/StopHook/stop-hook-threads.test rename to lldb/lit/ExecControl/StopHook/stop-hook-threads.test diff --git a/lldb/test/Shell/ExecControl/StopHook/stop-hook.test b/lldb/lit/ExecControl/StopHook/stop-hook.test similarity index 100% rename from lldb/test/Shell/ExecControl/StopHook/stop-hook.test rename to lldb/lit/ExecControl/StopHook/stop-hook.test diff --git a/lldb/test/Shell/Expr/Inputs/call-function.cpp b/lldb/lit/Expr/Inputs/call-function.cpp similarity index 100% rename from lldb/test/Shell/Expr/Inputs/call-function.cpp rename to lldb/lit/Expr/Inputs/call-function.cpp diff --git a/lldb/test/Shell/Expr/Inputs/ir-memory-map-basic b/lldb/lit/Expr/Inputs/ir-memory-map-basic similarity index 100% rename from lldb/test/Shell/Expr/Inputs/ir-memory-map-basic rename to lldb/lit/Expr/Inputs/ir-memory-map-basic diff --git a/lldb/test/Shell/Expr/Inputs/ir-memory-map-mix-malloc-free b/lldb/lit/Expr/Inputs/ir-memory-map-mix-malloc-free similarity index 100% rename from lldb/test/Shell/Expr/Inputs/ir-memory-map-mix-malloc-free rename to lldb/lit/Expr/Inputs/ir-memory-map-mix-malloc-free diff --git a/lldb/test/Shell/Expr/Inputs/ir-memory-map-overlap1 b/lldb/lit/Expr/Inputs/ir-memory-map-overlap1 similarity index 100% rename from lldb/test/Shell/Expr/Inputs/ir-memory-map-overlap1 rename to lldb/lit/Expr/Inputs/ir-memory-map-overlap1 diff --git a/lldb/test/Shell/Expr/TestIRMemoryMap.test b/lldb/lit/Expr/TestIRMemoryMap.test similarity index 100% rename from lldb/test/Shell/Expr/TestIRMemoryMap.test rename to lldb/lit/Expr/TestIRMemoryMap.test diff --git a/lldb/test/Shell/Expr/TestIRMemoryMapWindows.test b/lldb/lit/Expr/TestIRMemoryMapWindows.test similarity index 100% rename from lldb/test/Shell/Expr/TestIRMemoryMapWindows.test rename to lldb/lit/Expr/TestIRMemoryMapWindows.test diff --git a/lldb/test/Shell/Expr/TestMultilineExpr.test b/lldb/lit/Expr/TestMultilineExpr.test similarity index 100% rename from lldb/test/Shell/Expr/TestMultilineExpr.test rename to lldb/lit/Expr/TestMultilineExpr.test diff --git a/lldb/test/Shell/Expr/TestTypeOfDeclTypeExpr.test b/lldb/lit/Expr/TestTypeOfDeclTypeExpr.test similarity index 100% rename from lldb/test/Shell/Expr/TestTypeOfDeclTypeExpr.test rename to lldb/lit/Expr/TestTypeOfDeclTypeExpr.test diff --git a/lldb/test/Shell/Heap/Inputs/cstr.c b/lldb/lit/Heap/Inputs/cstr.c similarity index 100% rename from lldb/test/Shell/Heap/Inputs/cstr.c rename to lldb/lit/Heap/Inputs/cstr.c diff --git a/lldb/test/Shell/Heap/heap-cstr.test b/lldb/lit/Heap/heap-cstr.test similarity index 100% rename from lldb/test/Shell/Heap/heap-cstr.test rename to lldb/lit/Heap/heap-cstr.test diff --git a/lldb/test/Shell/Host/Inputs/simple.c b/lldb/lit/Host/Inputs/simple.c similarity index 100% rename from lldb/test/Shell/Host/Inputs/simple.c rename to lldb/lit/Host/Inputs/simple.c diff --git a/lldb/test/Shell/Host/TestCustomShell.test b/lldb/lit/Host/TestCustomShell.test similarity index 100% rename from lldb/test/Shell/Host/TestCustomShell.test rename to lldb/lit/Host/TestCustomShell.test diff --git a/lldb/test/Shell/Minidump/Inputs/linux-x86_64.syms b/lldb/lit/Minidump/Inputs/linux-x86_64.syms similarity index 100% rename from lldb/test/Shell/Minidump/Inputs/linux-x86_64.syms rename to lldb/lit/Minidump/Inputs/linux-x86_64.syms diff --git a/lldb/test/Shell/Minidump/Inputs/linux-x86_64.yaml b/lldb/lit/Minidump/Inputs/linux-x86_64.yaml similarity index 100% rename from lldb/test/Shell/Minidump/Inputs/linux-x86_64.yaml rename to lldb/lit/Minidump/Inputs/linux-x86_64.yaml diff --git a/lldb/test/Shell/Minidump/Windows/Inputs/find-module.dmp.yaml b/lldb/lit/Minidump/Windows/Inputs/find-module.dmp.yaml similarity index 100% rename from lldb/test/Shell/Minidump/Windows/Inputs/find-module.dmp.yaml rename to lldb/lit/Minidump/Windows/Inputs/find-module.dmp.yaml diff --git a/lldb/test/Shell/Minidump/Windows/Inputs/find-module.exe.yaml b/lldb/lit/Minidump/Windows/Inputs/find-module.exe.yaml similarity index 100% rename from lldb/test/Shell/Minidump/Windows/Inputs/find-module.exe.yaml rename to lldb/lit/Minidump/Windows/Inputs/find-module.exe.yaml diff --git a/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp b/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp similarity index 100% rename from lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp rename to lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp diff --git a/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp b/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp similarity index 100% rename from lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp rename to lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp diff --git a/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit b/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit similarity index 100% rename from lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit rename to lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit diff --git a/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb b/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb similarity index 100% rename from lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb rename to lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb diff --git a/lldb/test/Shell/Minidump/Windows/Sigsegv/sigsegv.test b/lldb/lit/Minidump/Windows/Sigsegv/sigsegv.test similarity index 100% rename from lldb/test/Shell/Minidump/Windows/Sigsegv/sigsegv.test rename to lldb/lit/Minidump/Windows/Sigsegv/sigsegv.test diff --git a/lldb/test/Shell/Minidump/Windows/find-module.test b/lldb/lit/Minidump/Windows/find-module.test similarity index 100% rename from lldb/test/Shell/Minidump/Windows/find-module.test rename to lldb/lit/Minidump/Windows/find-module.test diff --git a/lldb/test/Shell/Minidump/breakpad-symbols.test b/lldb/lit/Minidump/breakpad-symbols.test similarity index 100% rename from lldb/test/Shell/Minidump/breakpad-symbols.test rename to lldb/lit/Minidump/breakpad-symbols.test diff --git a/lldb/test/Shell/Minidump/disassemble-no-module.yaml b/lldb/lit/Minidump/disassemble-no-module.yaml similarity index 100% rename from lldb/test/Shell/Minidump/disassemble-no-module.yaml rename to lldb/lit/Minidump/disassemble-no-module.yaml diff --git a/lldb/test/Shell/Minidump/dump-all.test b/lldb/lit/Minidump/dump-all.test similarity index 100% rename from lldb/test/Shell/Minidump/dump-all.test rename to lldb/lit/Minidump/dump-all.test diff --git a/lldb/test/Shell/Minidump/fb-dump.test b/lldb/lit/Minidump/fb-dump.test similarity index 100% rename from lldb/test/Shell/Minidump/fb-dump.test rename to lldb/lit/Minidump/fb-dump.test diff --git a/lldb/test/Shell/Minidump/lit.local.cfg b/lldb/lit/Minidump/lit.local.cfg similarity index 100% rename from lldb/test/Shell/Minidump/lit.local.cfg rename to lldb/lit/Minidump/lit.local.cfg diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-linux.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-linux.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-windows.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-windows.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms rename to lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms diff --git a/lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml b/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml rename to lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml diff --git a/lldb/test/Shell/ObjectFile/Breakpad/breakpad-identification.test b/lldb/lit/ObjectFile/Breakpad/breakpad-identification.test similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/breakpad-identification.test rename to lldb/lit/ObjectFile/Breakpad/breakpad-identification.test diff --git a/lldb/test/Shell/ObjectFile/Breakpad/discontiguous-sections.test b/lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/discontiguous-sections.test rename to lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test diff --git a/lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg b/lldb/lit/ObjectFile/Breakpad/lit.local.cfg similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg rename to lldb/lit/ObjectFile/Breakpad/lit.local.cfg diff --git a/lldb/test/Shell/ObjectFile/Breakpad/sections-trailing-func.test b/lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/sections-trailing-func.test rename to lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test diff --git a/lldb/test/Shell/ObjectFile/Breakpad/sections.test b/lldb/lit/ObjectFile/Breakpad/sections.test similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/sections.test rename to lldb/lit/ObjectFile/Breakpad/sections.test diff --git a/lldb/test/Shell/ObjectFile/Breakpad/uuid-matching-mac.test b/lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test similarity index 100% rename from lldb/test/Shell/ObjectFile/Breakpad/uuid-matching-mac.test rename to lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test diff --git a/lldb/test/Shell/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf b/lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf rename to lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf diff --git a/lldb/test/Shell/ObjectFile/ELF/Inputs/minidebuginfo-main.c b/lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/Inputs/minidebuginfo-main.c rename to lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c diff --git a/lldb/test/Shell/ObjectFile/ELF/Inputs/netbsd-amd64.core b/lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/Inputs/netbsd-amd64.core rename to lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core diff --git a/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-empty.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/PT_LOAD-empty.yaml rename to lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml rename to lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml rename to lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-section.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-section.yaml rename to lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap.yaml rename to lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/PT_LOAD.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/PT_LOAD.yaml rename to lldb/lit/ObjectFile/ELF/PT_LOAD.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml b/lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml rename to lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/aarch64-relocations.yaml b/lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/aarch64-relocations.yaml rename to lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/base-address.yaml b/lldb/lit/ObjectFile/ELF/base-address.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/base-address.yaml rename to lldb/lit/ObjectFile/ELF/base-address.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/basic-info.yaml b/lldb/lit/ObjectFile/ELF/basic-info.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/basic-info.yaml rename to lldb/lit/ObjectFile/ELF/basic-info.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/build-id-case.yaml b/lldb/lit/ObjectFile/ELF/build-id-case.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/build-id-case.yaml rename to lldb/lit/ObjectFile/ELF/build-id-case.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml b/lldb/lit/ObjectFile/ELF/compressed-sections.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml rename to lldb/lit/ObjectFile/ELF/compressed-sections.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/duplicate-section.yaml b/lldb/lit/ObjectFile/ELF/duplicate-section.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/duplicate-section.yaml rename to lldb/lit/ObjectFile/ELF/duplicate-section.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/gnu-debuglink.yaml b/lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/gnu-debuglink.yaml rename to lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/many-sections.s b/lldb/lit/ObjectFile/ELF/many-sections.s similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/many-sections.s rename to lldb/lit/ObjectFile/ELF/many-sections.s diff --git a/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml b/lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml rename to lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-find-symbols.yaml b/lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/minidebuginfo-find-symbols.yaml rename to lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-no-lzma.yaml b/lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/minidebuginfo-no-lzma.yaml rename to lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test b/lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test rename to lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test diff --git a/lldb/test/Shell/ObjectFile/ELF/netbsd-core-amd64.test b/lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/netbsd-core-amd64.test rename to lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test diff --git a/lldb/test/Shell/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml b/lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml rename to lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/section-addresses.yaml b/lldb/lit/ObjectFile/ELF/section-addresses.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/section-addresses.yaml rename to lldb/lit/ObjectFile/ELF/section-addresses.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/section-overlap.yaml b/lldb/lit/ObjectFile/ELF/section-overlap.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/section-overlap.yaml rename to lldb/lit/ObjectFile/ELF/section-overlap.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/section-permissions.yaml b/lldb/lit/ObjectFile/ELF/section-permissions.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/section-permissions.yaml rename to lldb/lit/ObjectFile/ELF/section-permissions.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/section-types-edgecases.yaml b/lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/section-types-edgecases.yaml rename to lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/section-types.yaml b/lldb/lit/ObjectFile/ELF/section-types.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/section-types.yaml rename to lldb/lit/ObjectFile/ELF/section-types.yaml diff --git a/lldb/test/Shell/ObjectFile/ELF/short-build-id.yaml b/lldb/lit/ObjectFile/ELF/short-build-id.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/ELF/short-build-id.yaml rename to lldb/lit/ObjectFile/ELF/short-build-id.yaml diff --git a/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml b/lldb/lit/ObjectFile/MachO/lc_build_version.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml rename to lldb/lit/ObjectFile/MachO/lc_build_version.yaml diff --git a/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml b/lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml rename to lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml diff --git a/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml b/lldb/lit/ObjectFile/MachO/lc_version_min.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml rename to lldb/lit/ObjectFile/MachO/lc_version_min.yaml diff --git a/lldb/test/Shell/ObjectFile/MachO/subsections.yaml b/lldb/lit/ObjectFile/MachO/subsections.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/MachO/subsections.yaml rename to lldb/lit/ObjectFile/MachO/subsections.yaml diff --git a/lldb/test/Shell/ObjectFile/MachO/symtab.yaml b/lldb/lit/ObjectFile/MachO/symtab.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/MachO/symtab.yaml rename to lldb/lit/ObjectFile/MachO/symtab.yaml diff --git a/lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm.yaml b/lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm.yaml rename to lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml diff --git a/lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm64.yaml b/lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm64.yaml rename to lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml diff --git a/lldb/test/Shell/ObjectFile/PECOFF/basic-info.yaml b/lldb/lit/ObjectFile/PECOFF/basic-info.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/PECOFF/basic-info.yaml rename to lldb/lit/ObjectFile/PECOFF/basic-info.yaml diff --git a/lldb/test/Shell/ObjectFile/PECOFF/dep-modules.yaml b/lldb/lit/ObjectFile/PECOFF/dep-modules.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/PECOFF/dep-modules.yaml rename to lldb/lit/ObjectFile/PECOFF/dep-modules.yaml diff --git a/lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml b/lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml rename to lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml diff --git a/lldb/test/Shell/ObjectFile/PECOFF/lit.local.cfg b/lldb/lit/ObjectFile/PECOFF/lit.local.cfg similarity index 100% rename from lldb/test/Shell/ObjectFile/PECOFF/lit.local.cfg rename to lldb/lit/ObjectFile/PECOFF/lit.local.cfg diff --git a/lldb/test/Shell/ObjectFile/PECOFF/sections-names.yaml b/lldb/lit/ObjectFile/PECOFF/sections-names.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/PECOFF/sections-names.yaml rename to lldb/lit/ObjectFile/PECOFF/sections-names.yaml diff --git a/lldb/test/Shell/ObjectFile/PECOFF/subsections.yaml b/lldb/lit/ObjectFile/PECOFF/subsections.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/PECOFF/subsections.yaml rename to lldb/lit/ObjectFile/PECOFF/subsections.yaml diff --git a/lldb/test/Shell/ObjectFile/PECOFF/uuid.yaml b/lldb/lit/ObjectFile/PECOFF/uuid.yaml similarity index 100% rename from lldb/test/Shell/ObjectFile/PECOFF/uuid.yaml rename to lldb/lit/ObjectFile/PECOFF/uuid.yaml diff --git a/lldb/test/Shell/ObjectFile/lit.local.cfg b/lldb/lit/ObjectFile/lit.local.cfg similarity index 100% rename from lldb/test/Shell/ObjectFile/lit.local.cfg rename to lldb/lit/ObjectFile/lit.local.cfg diff --git a/lldb/test/Shell/Process/Inputs/env.cpp b/lldb/lit/Process/Inputs/env.cpp similarity index 100% rename from lldb/test/Shell/Process/Inputs/env.cpp rename to lldb/lit/Process/Inputs/env.cpp diff --git a/lldb/test/Shell/Process/TestEnvironment.test b/lldb/lit/Process/TestEnvironment.test similarity index 100% rename from lldb/test/Shell/Process/TestEnvironment.test rename to lldb/lit/Process/TestEnvironment.test diff --git a/lldb/test/Shell/Process/Windows/exception_access_violation.cpp b/lldb/lit/Process/Windows/exception_access_violation.cpp similarity index 100% rename from lldb/test/Shell/Process/Windows/exception_access_violation.cpp rename to lldb/lit/Process/Windows/exception_access_violation.cpp diff --git a/lldb/test/Shell/Python/crashlog.test b/lldb/lit/Python/crashlog.test similarity index 97% rename from lldb/test/Shell/Python/crashlog.test rename to lldb/lit/Python/crashlog.test index 24d72eae41fa9..7ea7c0b5d74af 100644 --- a/lldb/test/Shell/Python/crashlog.test +++ b/lldb/lit/Python/crashlog.test @@ -1,6 +1,6 @@ # -*- python -*- # REQUIRES: system-darwin -# RUN: cd %S/../../../examples/python && cat %s | %lldb | FileCheck %s +# RUN: cd %S/../../examples/python && cat %s | %lldb | FileCheck %s # CHECK-LABEL: {{S}}KIP BEYOND CHECKS script import crashlog @@ -44,7 +44,7 @@ images = [ # CHECK: (0) # CHECK: 01234 # CHECK: /tmp/MyApp Pro.app/MyApp Pro - + "0x7fff63f20000 - 0x7fff63f77ff7 libc++.1.dylib (400.9.4) /usr/lib/libc++.1.dylib" # CHECK: 0x7fff63f20000 # CHECK: 0x7fff63f77ff7 diff --git a/lldb/test/Shell/Quit/TestQuitExitCode-30.test b/lldb/lit/Quit/TestQuitExitCode-30.test similarity index 100% rename from lldb/test/Shell/Quit/TestQuitExitCode-30.test rename to lldb/lit/Quit/TestQuitExitCode-30.test diff --git a/lldb/test/Shell/Quit/TestQuitExitCode0.test b/lldb/lit/Quit/TestQuitExitCode0.test similarity index 100% rename from lldb/test/Shell/Quit/TestQuitExitCode0.test rename to lldb/lit/Quit/TestQuitExitCode0.test diff --git a/lldb/test/Shell/Quit/TestQuitExitCode30.test b/lldb/lit/Quit/TestQuitExitCode30.test similarity index 100% rename from lldb/test/Shell/Quit/TestQuitExitCode30.test rename to lldb/lit/Quit/TestQuitExitCode30.test diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeHex0.test b/lldb/lit/Quit/TestQuitExitCodeHex0.test similarity index 100% rename from lldb/test/Shell/Quit/TestQuitExitCodeHex0.test rename to lldb/lit/Quit/TestQuitExitCodeHex0.test diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeHexA.test b/lldb/lit/Quit/TestQuitExitCodeHexA.test similarity index 100% rename from lldb/test/Shell/Quit/TestQuitExitCodeHexA.test rename to lldb/lit/Quit/TestQuitExitCodeHexA.test diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test b/lldb/lit/Quit/TestQuitExitCodeImplicit0.test similarity index 100% rename from lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test rename to lldb/lit/Quit/TestQuitExitCodeImplicit0.test diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test b/lldb/lit/Quit/TestQuitExitCodeNonInt.test similarity index 100% rename from lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test rename to lldb/lit/Quit/TestQuitExitCodeNonInt.test diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test b/lldb/lit/Quit/TestQuitExitCodeTooManyArgs.test similarity index 100% rename from lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test rename to lldb/lit/Quit/TestQuitExitCodeTooManyArgs.test diff --git a/lldb/test/Shell/Quit/expect_exit_code.py b/lldb/lit/Quit/expect_exit_code.py similarity index 100% rename from lldb/test/Shell/Quit/expect_exit_code.py rename to lldb/lit/Quit/expect_exit_code.py diff --git a/lldb/test/Shell/Register/Inputs/x86-64-gp-read.cpp b/lldb/lit/Register/Inputs/x86-64-gp-read.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-64-gp-read.cpp rename to lldb/lit/Register/Inputs/x86-64-gp-read.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-64-gp-write.cpp b/lldb/lit/Register/Inputs/x86-64-gp-write.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-64-gp-write.cpp rename to lldb/lit/Register/Inputs/x86-64-gp-write.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-64-read.cpp b/lldb/lit/Register/Inputs/x86-64-read.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-64-read.cpp rename to lldb/lit/Register/Inputs/x86-64-read.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-64-write.cpp b/lldb/lit/Register/Inputs/x86-64-write.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-64-write.cpp rename to lldb/lit/Register/Inputs/x86-64-write.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-gp-read.cpp b/lldb/lit/Register/Inputs/x86-gp-read.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-gp-read.cpp rename to lldb/lit/Register/Inputs/x86-gp-read.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-gp-write.cpp b/lldb/lit/Register/Inputs/x86-gp-write.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-gp-write.cpp rename to lldb/lit/Register/Inputs/x86-gp-write.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-mm-xmm-read.cpp b/lldb/lit/Register/Inputs/x86-mm-xmm-read.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-mm-xmm-read.cpp rename to lldb/lit/Register/Inputs/x86-mm-xmm-read.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-mm-xmm-write.cpp b/lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-mm-xmm-write.cpp rename to lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-ymm-read.cpp b/lldb/lit/Register/Inputs/x86-ymm-read.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-ymm-read.cpp rename to lldb/lit/Register/Inputs/x86-ymm-read.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-ymm-write.cpp b/lldb/lit/Register/Inputs/x86-ymm-write.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-ymm-write.cpp rename to lldb/lit/Register/Inputs/x86-ymm-write.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-zmm-read.cpp b/lldb/lit/Register/Inputs/x86-zmm-read.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-zmm-read.cpp rename to lldb/lit/Register/Inputs/x86-zmm-read.cpp diff --git a/lldb/test/Shell/Register/Inputs/x86-zmm-write.cpp b/lldb/lit/Register/Inputs/x86-zmm-write.cpp similarity index 100% rename from lldb/test/Shell/Register/Inputs/x86-zmm-write.cpp rename to lldb/lit/Register/Inputs/x86-zmm-write.cpp diff --git a/lldb/test/Shell/Register/x86-64-gp-read.test b/lldb/lit/Register/x86-64-gp-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-gp-read.test rename to lldb/lit/Register/x86-64-gp-read.test diff --git a/lldb/test/Shell/Register/x86-64-gp-write.test b/lldb/lit/Register/x86-64-gp-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-gp-write.test rename to lldb/lit/Register/x86-64-gp-write.test diff --git a/lldb/test/Shell/Register/x86-64-read.test b/lldb/lit/Register/x86-64-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-read.test rename to lldb/lit/Register/x86-64-read.test diff --git a/lldb/test/Shell/Register/x86-64-write.test b/lldb/lit/Register/x86-64-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-write.test rename to lldb/lit/Register/x86-64-write.test diff --git a/lldb/test/Shell/Register/x86-64-xmm16-read.test b/lldb/lit/Register/x86-64-xmm16-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-xmm16-read.test rename to lldb/lit/Register/x86-64-xmm16-read.test diff --git a/lldb/test/Shell/Register/x86-64-xmm16-write.test b/lldb/lit/Register/x86-64-xmm16-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-xmm16-write.test rename to lldb/lit/Register/x86-64-xmm16-write.test diff --git a/lldb/test/Shell/Register/x86-64-ymm-read.test b/lldb/lit/Register/x86-64-ymm-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-ymm-read.test rename to lldb/lit/Register/x86-64-ymm-read.test diff --git a/lldb/test/Shell/Register/x86-64-ymm-write.test b/lldb/lit/Register/x86-64-ymm-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-ymm-write.test rename to lldb/lit/Register/x86-64-ymm-write.test diff --git a/lldb/test/Shell/Register/x86-64-ymm16-read.test b/lldb/lit/Register/x86-64-ymm16-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-ymm16-read.test rename to lldb/lit/Register/x86-64-ymm16-read.test diff --git a/lldb/test/Shell/Register/x86-64-ymm16-write.test b/lldb/lit/Register/x86-64-ymm16-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-ymm16-write.test rename to lldb/lit/Register/x86-64-ymm16-write.test diff --git a/lldb/test/Shell/Register/x86-64-zmm-read.test b/lldb/lit/Register/x86-64-zmm-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-zmm-read.test rename to lldb/lit/Register/x86-64-zmm-read.test diff --git a/lldb/test/Shell/Register/x86-64-zmm-write.test b/lldb/lit/Register/x86-64-zmm-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-64-zmm-write.test rename to lldb/lit/Register/x86-64-zmm-write.test diff --git a/lldb/test/Shell/Register/x86-gp-read.test b/lldb/lit/Register/x86-gp-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-gp-read.test rename to lldb/lit/Register/x86-gp-read.test diff --git a/lldb/test/Shell/Register/x86-gp-write.test b/lldb/lit/Register/x86-gp-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-gp-write.test rename to lldb/lit/Register/x86-gp-write.test diff --git a/lldb/test/Shell/Register/x86-mm-xmm-read.test b/lldb/lit/Register/x86-mm-xmm-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-mm-xmm-read.test rename to lldb/lit/Register/x86-mm-xmm-read.test diff --git a/lldb/test/Shell/Register/x86-mm-xmm-write.test b/lldb/lit/Register/x86-mm-xmm-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-mm-xmm-write.test rename to lldb/lit/Register/x86-mm-xmm-write.test diff --git a/lldb/test/Shell/Register/x86-ymm-read.test b/lldb/lit/Register/x86-ymm-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-ymm-read.test rename to lldb/lit/Register/x86-ymm-read.test diff --git a/lldb/test/Shell/Register/x86-ymm-write.test b/lldb/lit/Register/x86-ymm-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-ymm-write.test rename to lldb/lit/Register/x86-ymm-write.test diff --git a/lldb/test/Shell/Register/x86-zmm-read.test b/lldb/lit/Register/x86-zmm-read.test similarity index 100% rename from lldb/test/Shell/Register/x86-zmm-read.test rename to lldb/lit/Register/x86-zmm-read.test diff --git a/lldb/test/Shell/Register/x86-zmm-write.test b/lldb/lit/Register/x86-zmm-write.test similarity index 100% rename from lldb/test/Shell/Register/x86-zmm-write.test rename to lldb/lit/Register/x86-zmm-write.test diff --git a/lldb/test/Shell/Reproducer/Functionalities/Inputs/DataFormatter.in b/lldb/lit/Reproducer/Functionalities/Inputs/DataFormatter.in similarity index 100% rename from lldb/test/Shell/Reproducer/Functionalities/Inputs/DataFormatter.in rename to lldb/lit/Reproducer/Functionalities/Inputs/DataFormatter.in diff --git a/lldb/test/Shell/Reproducer/Functionalities/Inputs/foo.cpp b/lldb/lit/Reproducer/Functionalities/Inputs/foo.cpp similarity index 100% rename from lldb/test/Shell/Reproducer/Functionalities/Inputs/foo.cpp rename to lldb/lit/Reproducer/Functionalities/Inputs/foo.cpp diff --git a/lldb/test/Shell/Reproducer/Functionalities/Inputs/stepping.c b/lldb/lit/Reproducer/Functionalities/Inputs/stepping.c similarity index 100% rename from lldb/test/Shell/Reproducer/Functionalities/Inputs/stepping.c rename to lldb/lit/Reproducer/Functionalities/Inputs/stepping.c diff --git a/lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test b/lldb/lit/Reproducer/Functionalities/TestDataFormatter.test similarity index 100% rename from lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test rename to lldb/lit/Reproducer/Functionalities/TestDataFormatter.test diff --git a/lldb/test/Shell/Reproducer/Functionalities/TestImageList.test b/lldb/lit/Reproducer/Functionalities/TestImageList.test similarity index 100% rename from lldb/test/Shell/Reproducer/Functionalities/TestImageList.test rename to lldb/lit/Reproducer/Functionalities/TestImageList.test diff --git a/lldb/test/Shell/Reproducer/Functionalities/TestStepping.test b/lldb/lit/Reproducer/Functionalities/TestStepping.test similarity index 100% rename from lldb/test/Shell/Reproducer/Functionalities/TestStepping.test rename to lldb/lit/Reproducer/Functionalities/TestStepping.test diff --git a/lldb/test/Shell/Reproducer/Inputs/FileCapture.in b/lldb/lit/Reproducer/Inputs/FileCapture.in similarity index 100% rename from lldb/test/Shell/Reproducer/Inputs/FileCapture.in rename to lldb/lit/Reproducer/Inputs/FileCapture.in diff --git a/lldb/test/Shell/Reproducer/Inputs/GDBRemoteCapture.in b/lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in similarity index 100% rename from lldb/test/Shell/Reproducer/Inputs/GDBRemoteCapture.in rename to lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in diff --git a/lldb/test/Shell/Reproducer/Inputs/simple.c b/lldb/lit/Reproducer/Inputs/simple.c similarity index 100% rename from lldb/test/Shell/Reproducer/Inputs/simple.c rename to lldb/lit/Reproducer/Inputs/simple.c diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/Bar.h b/lldb/lit/Reproducer/Modules/Inputs/Bar.h similarity index 100% rename from lldb/test/Shell/Reproducer/Modules/Inputs/Bar.h rename to lldb/lit/Reproducer/Modules/Inputs/Bar.h diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/Foo.h b/lldb/lit/Reproducer/Modules/Inputs/Foo.h similarity index 100% rename from lldb/test/Shell/Reproducer/Modules/Inputs/Foo.h rename to lldb/lit/Reproducer/Modules/Inputs/Foo.h diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/ModuleCXX.in b/lldb/lit/Reproducer/Modules/Inputs/ModuleCXX.in similarity index 100% rename from lldb/test/Shell/Reproducer/Modules/Inputs/ModuleCXX.in rename to lldb/lit/Reproducer/Modules/Inputs/ModuleCXX.in diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/main.cpp b/lldb/lit/Reproducer/Modules/Inputs/main.cpp similarity index 100% rename from lldb/test/Shell/Reproducer/Modules/Inputs/main.cpp rename to lldb/lit/Reproducer/Modules/Inputs/main.cpp diff --git a/lldb/test/Shell/Reproducer/Modules/Inputs/module.modulemap b/lldb/lit/Reproducer/Modules/Inputs/module.modulemap similarity index 100% rename from lldb/test/Shell/Reproducer/Modules/Inputs/module.modulemap rename to lldb/lit/Reproducer/Modules/Inputs/module.modulemap diff --git a/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test b/lldb/lit/Reproducer/Modules/TestModuleCXX.test similarity index 100% rename from lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test rename to lldb/lit/Reproducer/Modules/TestModuleCXX.test diff --git a/lldb/test/Shell/Reproducer/TestDriverOptions.test b/lldb/lit/Reproducer/TestDriverOptions.test similarity index 100% rename from lldb/test/Shell/Reproducer/TestDriverOptions.test rename to lldb/lit/Reproducer/TestDriverOptions.test diff --git a/lldb/test/Shell/Reproducer/TestDump.test b/lldb/lit/Reproducer/TestDump.test similarity index 100% rename from lldb/test/Shell/Reproducer/TestDump.test rename to lldb/lit/Reproducer/TestDump.test diff --git a/lldb/test/Shell/Reproducer/TestFileRepro.test b/lldb/lit/Reproducer/TestFileRepro.test similarity index 100% rename from lldb/test/Shell/Reproducer/TestFileRepro.test rename to lldb/lit/Reproducer/TestFileRepro.test diff --git a/lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test b/lldb/lit/Reproducer/TestGDBRemoteRepro.test similarity index 100% rename from lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test rename to lldb/lit/Reproducer/TestGDBRemoteRepro.test diff --git a/lldb/test/Shell/Reproducer/TestRelativePath.test b/lldb/lit/Reproducer/TestRelativePath.test similarity index 100% rename from lldb/test/Shell/Reproducer/TestRelativePath.test rename to lldb/lit/Reproducer/TestRelativePath.test diff --git a/lldb/test/Shell/Reproducer/TestReuseDirectory.test b/lldb/lit/Reproducer/TestReuseDirectory.test similarity index 100% rename from lldb/test/Shell/Reproducer/TestReuseDirectory.test rename to lldb/lit/Reproducer/TestReuseDirectory.test diff --git a/lldb/test/Shell/Reproducer/TestSynchronous.test b/lldb/lit/Reproducer/TestSynchronous.test similarity index 100% rename from lldb/test/Shell/Reproducer/TestSynchronous.test rename to lldb/lit/Reproducer/TestSynchronous.test diff --git a/lldb/test/Shell/Settings/Inputs/DontStopCommandSource.in b/lldb/lit/Settings/Inputs/DontStopCommandSource.in similarity index 100% rename from lldb/test/Shell/Settings/Inputs/DontStopCommandSource.in rename to lldb/lit/Settings/Inputs/DontStopCommandSource.in diff --git a/lldb/test/Shell/Settings/Inputs/EchoCommandsAll.out b/lldb/lit/Settings/Inputs/EchoCommandsAll.out similarity index 100% rename from lldb/test/Shell/Settings/Inputs/EchoCommandsAll.out rename to lldb/lit/Settings/Inputs/EchoCommandsAll.out diff --git a/lldb/test/Shell/Settings/Inputs/EchoCommandsNoComments.out b/lldb/lit/Settings/Inputs/EchoCommandsNoComments.out similarity index 100% rename from lldb/test/Shell/Settings/Inputs/EchoCommandsNoComments.out rename to lldb/lit/Settings/Inputs/EchoCommandsNoComments.out diff --git a/lldb/test/Shell/Settings/Inputs/EchoCommandsNone.out b/lldb/lit/Settings/Inputs/EchoCommandsNone.out similarity index 100% rename from lldb/test/Shell/Settings/Inputs/EchoCommandsNone.out rename to lldb/lit/Settings/Inputs/EchoCommandsNone.out diff --git a/lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out b/lldb/lit/Settings/Inputs/EchoCommandsQuiet.out similarity index 100% rename from lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out rename to lldb/lit/Settings/Inputs/EchoCommandsQuiet.out diff --git a/lldb/test/Shell/Settings/Inputs/EchoCommandsTest.in b/lldb/lit/Settings/Inputs/EchoCommandsTest.in similarity index 100% rename from lldb/test/Shell/Settings/Inputs/EchoCommandsTest.in rename to lldb/lit/Settings/Inputs/EchoCommandsTest.in diff --git a/lldb/test/Shell/Settings/Inputs/StopCommandSource.in b/lldb/lit/Settings/Inputs/StopCommandSource.in similarity index 100% rename from lldb/test/Shell/Settings/Inputs/StopCommandSource.in rename to lldb/lit/Settings/Inputs/StopCommandSource.in diff --git a/lldb/test/Shell/Settings/Inputs/main.c b/lldb/lit/Settings/Inputs/main.c similarity index 100% rename from lldb/test/Shell/Settings/Inputs/main.c rename to lldb/lit/Settings/Inputs/main.c diff --git a/lldb/test/Shell/Settings/TestDisableColor.test b/lldb/lit/Settings/TestDisableColor.test similarity index 100% rename from lldb/test/Shell/Settings/TestDisableColor.test rename to lldb/lit/Settings/TestDisableColor.test diff --git a/lldb/test/Shell/Settings/TestDisassemblyFormat.test b/lldb/lit/Settings/TestDisassemblyFormat.test similarity index 100% rename from lldb/test/Shell/Settings/TestDisassemblyFormat.test rename to lldb/lit/Settings/TestDisassemblyFormat.test diff --git a/lldb/test/Shell/Settings/TestEchoCommands.test b/lldb/lit/Settings/TestEchoCommands.test similarity index 100% rename from lldb/test/Shell/Settings/TestEchoCommands.test rename to lldb/lit/Settings/TestEchoCommands.test diff --git a/lldb/test/Shell/Settings/TestFrameFormatColor.test b/lldb/lit/Settings/TestFrameFormatColor.test similarity index 100% rename from lldb/test/Shell/Settings/TestFrameFormatColor.test rename to lldb/lit/Settings/TestFrameFormatColor.test diff --git a/lldb/test/Shell/Settings/TestFrameFormatNoColor.test b/lldb/lit/Settings/TestFrameFormatNoColor.test similarity index 100% rename from lldb/test/Shell/Settings/TestFrameFormatNoColor.test rename to lldb/lit/Settings/TestFrameFormatNoColor.test diff --git a/lldb/test/Shell/Settings/TestModuleCacheSanity.test b/lldb/lit/Settings/TestModuleCacheSanity.test similarity index 100% rename from lldb/test/Shell/Settings/TestModuleCacheSanity.test rename to lldb/lit/Settings/TestModuleCacheSanity.test diff --git a/lldb/test/Shell/Settings/TestSettingsSet.test b/lldb/lit/Settings/TestSettingsSet.test similarity index 100% rename from lldb/test/Shell/Settings/TestSettingsSet.test rename to lldb/lit/Settings/TestSettingsSet.test diff --git a/lldb/test/Shell/Settings/TestSettingsWrite.test b/lldb/lit/Settings/TestSettingsWrite.test similarity index 100% rename from lldb/test/Shell/Settings/TestSettingsWrite.test rename to lldb/lit/Settings/TestSettingsWrite.test diff --git a/lldb/test/Shell/Settings/TestStopCommandSourceOnError.test b/lldb/lit/Settings/TestStopCommandSourceOnError.test similarity index 100% rename from lldb/test/Shell/Settings/TestStopCommandSourceOnError.test rename to lldb/lit/Settings/TestStopCommandSourceOnError.test diff --git a/lldb/test/API/lit.cfg b/lldb/lit/Suite/lit.cfg similarity index 96% rename from lldb/test/API/lit.cfg rename to lldb/lit/Suite/lit.cfg index bb9e3aaaaa44d..9504f4ca1d845 100644 --- a/lldb/test/API/lit.cfg +++ b/lldb/lit/Suite/lit.cfg @@ -9,7 +9,7 @@ import shlex import lit.formats # name: The name of this test suite. -config.name = 'lldb-api' +config.name = 'lldb-Suite' # suffixes: A list of file extensions to treat as test files. config.suffixes = ['.py'] @@ -73,7 +73,7 @@ if config.lldb_module_cache: dotest_cmd += ['--module-cache-dir', config.lldb_module_cache] # Load LLDB test format. -sys.path.append(os.path.join(config.lldb_src_root, "test", "API")) +sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite")) import lldbtest # testFormat: The test format to use to interpret tests. diff --git a/lldb/test/API/lit.site.cfg.in b/lldb/lit/Suite/lit.site.cfg.in similarity index 93% rename from lldb/test/API/lit.site.cfg.in rename to lldb/lit/Suite/lit.site.cfg.in index 883bc4033005b..306967d61fd00 100644 --- a/lldb/test/API/lit.site.cfg.in +++ b/lldb/lit/Suite/lit.site.cfg.in @@ -20,7 +20,7 @@ config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@" config.lldb_module_cache = "@LLDB_TEST_MODULE_CACHE_LLDB@" config.clang_module_cache = "@LLDB_TEST_MODULE_CACHE_CLANG@" config.python_executable = "@PYTHON_EXECUTABLE@" -config.dotest_path = "@LLDB_SOURCE_DIR@/test/API/dotest.py" +config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py" config.dotest_args_str = "@LLDB_DOTEST_ARGS@" config.lldb_disable_python = @LLDB_DISABLE_PYTHON@ config.dotest_lit_args_str = None @@ -43,4 +43,4 @@ except KeyError as e: lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/API/lit.cfg") +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Suite/lit.cfg") diff --git a/lldb/test/API/lldbtest.py b/lldb/lit/Suite/lldbtest.py similarity index 100% rename from lldb/test/API/lldbtest.py rename to lldb/lit/Suite/lldbtest.py diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-elf.yaml b/lldb/lit/SymbolFile/Breakpad/Inputs/basic-elf.yaml similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-elf.yaml rename to lldb/lit/SymbolFile/Breakpad/Inputs/basic-elf.yaml diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-macho.yaml b/lldb/lit/SymbolFile/Breakpad/Inputs/basic-macho.yaml similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-macho.yaml rename to lldb/lit/SymbolFile/Breakpad/Inputs/basic-macho.yaml diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/line-table.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/line-table.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml b/lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml rename to lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab-macho.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab-macho.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/symtab.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/symtab.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml b/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml rename to lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms b/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms rename to lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms diff --git a/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml b/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml rename to lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml diff --git a/lldb/test/Shell/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test b/lldb/lit/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test rename to lldb/lit/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/line-table-edgecases.test b/lldb/lit/SymbolFile/Breakpad/line-table-edgecases.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/line-table-edgecases.test rename to lldb/lit/SymbolFile/Breakpad/line-table-edgecases.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/line-table-missing-file.test b/lldb/lit/SymbolFile/Breakpad/line-table-missing-file.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/line-table-missing-file.test rename to lldb/lit/SymbolFile/Breakpad/line-table-missing-file.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/line-table-mixed-path-styles.test b/lldb/lit/SymbolFile/Breakpad/line-table-mixed-path-styles.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/line-table-mixed-path-styles.test rename to lldb/lit/SymbolFile/Breakpad/line-table-mixed-path-styles.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/line-table.test b/lldb/lit/SymbolFile/Breakpad/line-table.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/line-table.test rename to lldb/lit/SymbolFile/Breakpad/line-table.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/stack-cfi-parsing.test b/lldb/lit/SymbolFile/Breakpad/stack-cfi-parsing.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/stack-cfi-parsing.test rename to lldb/lit/SymbolFile/Breakpad/stack-cfi-parsing.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/symtab-macho.test b/lldb/lit/SymbolFile/Breakpad/symtab-macho.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/symtab-macho.test rename to lldb/lit/SymbolFile/Breakpad/symtab-macho.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/symtab.test b/lldb/lit/SymbolFile/Breakpad/symtab.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/symtab.test rename to lldb/lit/SymbolFile/Breakpad/symtab.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/unwind-via-raSearch.test b/lldb/lit/SymbolFile/Breakpad/unwind-via-raSearch.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/unwind-via-raSearch.test rename to lldb/lit/SymbolFile/Breakpad/unwind-via-raSearch.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-cfi.test b/lldb/lit/SymbolFile/Breakpad/unwind-via-stack-cfi.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-cfi.test rename to lldb/lit/SymbolFile/Breakpad/unwind-via-stack-cfi.test diff --git a/lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win.test b/lldb/lit/SymbolFile/Breakpad/unwind-via-stack-win.test similarity index 100% rename from lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win.test rename to lldb/lit/SymbolFile/Breakpad/unwind-via-stack-win.test diff --git a/lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-line-basic.script b/lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-line-basic.script rename to lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script diff --git a/lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-basic.cpp b/lldb/lit/SymbolFile/DWARF/Inputs/debug-types-basic.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-basic.cpp rename to lldb/lit/SymbolFile/DWARF/Inputs/debug-types-basic.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp b/lldb/lit/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp rename to lldb/lit/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit b/lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit rename to lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit diff --git a/lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit b/lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit rename to lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit diff --git a/lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit b/lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit rename to lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit diff --git a/lldb/test/Shell/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp b/lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp rename to lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/apple-index-is-used.cpp b/lldb/lit/SymbolFile/DWARF/apple-index-is-used.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/apple-index-is-used.cpp rename to lldb/lit/SymbolFile/DWARF/apple-index-is-used.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/array-sizes.s b/lldb/lit/SymbolFile/DWARF/array-sizes.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/array-sizes.s rename to lldb/lit/SymbolFile/DWARF/array-sizes.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/childless-compile-unit.s b/lldb/lit/SymbolFile/DWARF/childless-compile-unit.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/childless-compile-unit.s rename to lldb/lit/SymbolFile/DWARF/childless-compile-unit.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/compilercontext.ll b/lldb/lit/SymbolFile/DWARF/compilercontext.ll similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/compilercontext.ll rename to lldb/lit/SymbolFile/DWARF/compilercontext.ll diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-line-basic.s b/lldb/lit/SymbolFile/DWARF/debug-line-basic.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-line-basic.s rename to lldb/lit/SymbolFile/DWARF/debug-line-basic.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp b/lldb/lit/SymbolFile/DWARF/debug-names-compressed.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp rename to lldb/lit/SymbolFile/DWARF/debug-names-compressed.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-types-address-ranges.s b/lldb/lit/SymbolFile/DWARF/debug-types-address-ranges.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-types-address-ranges.s rename to lldb/lit/SymbolFile/DWARF/debug-types-address-ranges.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-types-basic.test b/lldb/lit/SymbolFile/DWARF/debug-types-basic.test similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-types-basic.test rename to lldb/lit/SymbolFile/DWARF/debug-types-basic.test diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-types-dwarf5.s b/lldb/lit/SymbolFile/DWARF/debug-types-dwarf5.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-types-dwarf5.s rename to lldb/lit/SymbolFile/DWARF/debug-types-dwarf5.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp b/lldb/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp rename to lldb/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test b/lldb/lit/SymbolFile/DWARF/debug-types-expressions.test similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test rename to lldb/lit/SymbolFile/DWARF/debug-types-expressions.test diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-types-line-tables.s b/lldb/lit/SymbolFile/DWARF/debug-types-line-tables.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-types-line-tables.s rename to lldb/lit/SymbolFile/DWARF/debug-types-line-tables.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-types-missing-signature.test b/lldb/lit/SymbolFile/DWARF/debug-types-missing-signature.test similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-types-missing-signature.test rename to lldb/lit/SymbolFile/DWARF/debug-types-missing-signature.test diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug-types-signature-loop.s b/lldb/lit/SymbolFile/DWARF/debug-types-signature-loop.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug-types-signature-loop.s rename to lldb/lit/SymbolFile/DWARF/debug-types-signature-loop.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug_aranges-empty-section.s b/lldb/lit/SymbolFile/DWARF/debug_aranges-empty-section.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug_aranges-empty-section.s rename to lldb/lit/SymbolFile/DWARF/debug_aranges-empty-section.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug_loc.s b/lldb/lit/SymbolFile/DWARF/debug_loc.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug_loc.s rename to lldb/lit/SymbolFile/DWARF/debug_loc.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug_ranges-missing-section.s b/lldb/lit/SymbolFile/DWARF/debug_ranges-missing-section.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug_ranges-missing-section.s rename to lldb/lit/SymbolFile/DWARF/debug_ranges-missing-section.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug_ranges.s b/lldb/lit/SymbolFile/DWARF/debug_ranges.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug_ranges.s rename to lldb/lit/SymbolFile/DWARF/debug_ranges.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug_ranges_and_rnglists.test b/lldb/lit/SymbolFile/DWARF/debug_ranges_and_rnglists.test similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug_ranges_and_rnglists.test rename to lldb/lit/SymbolFile/DWARF/debug_ranges_and_rnglists.test diff --git a/lldb/test/Shell/SymbolFile/DWARF/debug_rnglists.s b/lldb/lit/SymbolFile/DWARF/debug_rnglists.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/debug_rnglists.s rename to lldb/lit/SymbolFile/DWARF/debug_rnglists.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp b/lldb/lit/SymbolFile/DWARF/deterministic-build.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp rename to lldb/lit/SymbolFile/DWARF/deterministic-build.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s b/lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s rename to lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir.s b/lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir.s rename to lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/dir-separator-posix.s b/lldb/lit/SymbolFile/DWARF/dir-separator-posix.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/dir-separator-posix.s rename to lldb/lit/SymbolFile/DWARF/dir-separator-posix.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/dir-separator-windows.s b/lldb/lit/SymbolFile/DWARF/dir-separator-windows.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/dir-separator-windows.s rename to lldb/lit/SymbolFile/DWARF/dir-separator-windows.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/dwarf5-index-is-used.cpp b/lldb/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/dwarf5-index-is-used.cpp rename to lldb/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/dwarf5-partial-index.cpp b/lldb/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/dwarf5-partial-index.cpp rename to lldb/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/dwarf5_locations.s b/lldb/lit/SymbolFile/DWARF/dwarf5_locations.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/dwarf5_locations.s rename to lldb/lit/SymbolFile/DWARF/dwarf5_locations.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp b/lldb/lit/SymbolFile/DWARF/find-basic-function.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp rename to lldb/lit/SymbolFile/DWARF/find-basic-function.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-basic-namespace.cpp b/lldb/lit/SymbolFile/DWARF/find-basic-namespace.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-basic-namespace.cpp rename to lldb/lit/SymbolFile/DWARF/find-basic-namespace.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-basic-type.cpp b/lldb/lit/SymbolFile/DWARF/find-basic-type.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-basic-type.cpp rename to lldb/lit/SymbolFile/DWARF/find-basic-type.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-basic-variable.cpp b/lldb/lit/SymbolFile/DWARF/find-basic-variable.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-basic-variable.cpp rename to lldb/lit/SymbolFile/DWARF/find-basic-variable.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-function-regex.cpp b/lldb/lit/SymbolFile/DWARF/find-function-regex.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-function-regex.cpp rename to lldb/lit/SymbolFile/DWARF/find-function-regex.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-inline-method.s b/lldb/lit/SymbolFile/DWARF/find-inline-method.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-inline-method.s rename to lldb/lit/SymbolFile/DWARF/find-inline-method.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-method-local-struct.cpp b/lldb/lit/SymbolFile/DWARF/find-method-local-struct.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-method-local-struct.cpp rename to lldb/lit/SymbolFile/DWARF/find-method-local-struct.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-method.cpp b/lldb/lit/SymbolFile/DWARF/find-method.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-method.cpp rename to lldb/lit/SymbolFile/DWARF/find-method.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-qualified-variable.cpp b/lldb/lit/SymbolFile/DWARF/find-qualified-variable.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-qualified-variable.cpp rename to lldb/lit/SymbolFile/DWARF/find-qualified-variable.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-type-in-function.cpp b/lldb/lit/SymbolFile/DWARF/find-type-in-function.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-type-in-function.cpp rename to lldb/lit/SymbolFile/DWARF/find-type-in-function.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-variable-dwo.cpp b/lldb/lit/SymbolFile/DWARF/find-variable-dwo.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-variable-dwo.cpp rename to lldb/lit/SymbolFile/DWARF/find-variable-dwo.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/find-variable-file.cpp b/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/find-variable-file.cpp rename to lldb/lit/SymbolFile/DWARF/find-variable-file.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/forward-declarations.s b/lldb/lit/SymbolFile/DWARF/forward-declarations.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/forward-declarations.s rename to lldb/lit/SymbolFile/DWARF/forward-declarations.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/gnu-style-compression.cpp b/lldb/lit/SymbolFile/DWARF/gnu-style-compression.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/gnu-style-compression.cpp rename to lldb/lit/SymbolFile/DWARF/gnu-style-compression.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/lit.local.cfg b/lldb/lit/SymbolFile/DWARF/lit.local.cfg similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/lit.local.cfg rename to lldb/lit/SymbolFile/DWARF/lit.local.cfg diff --git a/lldb/test/Shell/SymbolFile/DWARF/parallel-indexing-stress.s b/lldb/lit/SymbolFile/DWARF/parallel-indexing-stress.s similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/parallel-indexing-stress.s rename to lldb/lit/SymbolFile/DWARF/parallel-indexing-stress.s diff --git a/lldb/test/Shell/SymbolFile/DWARF/split-dwarf-inlining.cpp b/lldb/lit/SymbolFile/DWARF/split-dwarf-inlining.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/split-dwarf-inlining.cpp rename to lldb/lit/SymbolFile/DWARF/split-dwarf-inlining.cpp diff --git a/lldb/test/Shell/SymbolFile/DWARF/split-dwarf-multiple-cu.ll b/lldb/lit/SymbolFile/DWARF/split-dwarf-multiple-cu.ll similarity index 100% rename from lldb/test/Shell/SymbolFile/DWARF/split-dwarf-multiple-cu.ll rename to lldb/lit/SymbolFile/DWARF/split-dwarf-multiple-cu.ll diff --git a/lldb/test/Shell/SymbolFile/Inputs/sizeless-symbol.s b/lldb/lit/SymbolFile/Inputs/sizeless-symbol.s similarity index 100% rename from lldb/test/Shell/SymbolFile/Inputs/sizeless-symbol.s rename to lldb/lit/SymbolFile/Inputs/sizeless-symbol.s diff --git a/lldb/test/Shell/SymbolFile/Inputs/target-symbols-add-unwind.c b/lldb/lit/SymbolFile/Inputs/target-symbols-add-unwind.c similarity index 100% rename from lldb/test/Shell/SymbolFile/Inputs/target-symbols-add-unwind.c rename to lldb/lit/SymbolFile/Inputs/target-symbols-add-unwind.c diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-types.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/ast-types.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-types.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/ast-types.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/bitfields.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/bitfields.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/bitfields.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/bitfields.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/disassembly.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/disassembly.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/disassembly.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/disassembly.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/local-variables.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/local-variables.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/nested-types.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/nested-types.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.s b/lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.s similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.s rename to lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.s diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/source-list.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/source-list.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/source-list.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/source-list.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/tag-types.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/tag-types.lldbinit similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/Inputs/tag-types.lldbinit rename to lldb/lit/SymbolFile/NativePDB/Inputs/tag-types.lldbinit diff --git a/lldb/test/Shell/SymbolFile/NativePDB/ast-functions-msvc.cpp b/lldb/lit/SymbolFile/NativePDB/ast-functions-msvc.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/ast-functions-msvc.cpp rename to lldb/lit/SymbolFile/NativePDB/ast-functions-msvc.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/ast-functions.cpp b/lldb/lit/SymbolFile/NativePDB/ast-functions.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/ast-functions.cpp rename to lldb/lit/SymbolFile/NativePDB/ast-functions.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/ast-methods.cpp b/lldb/lit/SymbolFile/NativePDB/ast-methods.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/ast-methods.cpp rename to lldb/lit/SymbolFile/NativePDB/ast-methods.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp b/lldb/lit/SymbolFile/NativePDB/ast-types.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp rename to lldb/lit/SymbolFile/NativePDB/ast-types.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/bitfields.cpp b/lldb/lit/SymbolFile/NativePDB/bitfields.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/bitfields.cpp rename to lldb/lit/SymbolFile/NativePDB/bitfields.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/break-by-function.cpp b/lldb/lit/SymbolFile/NativePDB/break-by-function.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/break-by-function.cpp rename to lldb/lit/SymbolFile/NativePDB/break-by-function.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/break-by-line.cpp b/lldb/lit/SymbolFile/NativePDB/break-by-line.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/break-by-line.cpp rename to lldb/lit/SymbolFile/NativePDB/break-by-line.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/disassembly.cpp b/lldb/lit/SymbolFile/NativePDB/disassembly.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/disassembly.cpp rename to lldb/lit/SymbolFile/NativePDB/disassembly.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/function-types-builtins.cpp b/lldb/lit/SymbolFile/NativePDB/function-types-builtins.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/function-types-builtins.cpp rename to lldb/lit/SymbolFile/NativePDB/function-types-builtins.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp b/lldb/lit/SymbolFile/NativePDB/function-types-calling-conv.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp rename to lldb/lit/SymbolFile/NativePDB/function-types-calling-conv.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/function-types-classes.cpp b/lldb/lit/SymbolFile/NativePDB/function-types-classes.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/function-types-classes.cpp rename to lldb/lit/SymbolFile/NativePDB/function-types-classes.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/global-classes.cpp b/lldb/lit/SymbolFile/NativePDB/global-classes.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/global-classes.cpp rename to lldb/lit/SymbolFile/NativePDB/global-classes.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/globals-bss.cpp b/lldb/lit/SymbolFile/NativePDB/globals-bss.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/globals-bss.cpp rename to lldb/lit/SymbolFile/NativePDB/globals-bss.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/globals-fundamental.cpp b/lldb/lit/SymbolFile/NativePDB/globals-fundamental.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/globals-fundamental.cpp rename to lldb/lit/SymbolFile/NativePDB/globals-fundamental.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/local-variables.cpp b/lldb/lit/SymbolFile/NativePDB/local-variables.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/local-variables.cpp rename to lldb/lit/SymbolFile/NativePDB/local-variables.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/nested-types.cpp b/lldb/lit/SymbolFile/NativePDB/nested-types.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/nested-types.cpp rename to lldb/lit/SymbolFile/NativePDB/nested-types.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/s_constant.cpp b/lldb/lit/SymbolFile/NativePDB/s_constant.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/s_constant.cpp rename to lldb/lit/SymbolFile/NativePDB/s_constant.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/source-list.cpp b/lldb/lit/SymbolFile/NativePDB/source-list.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/source-list.cpp rename to lldb/lit/SymbolFile/NativePDB/source-list.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/stack_unwinding01.cpp b/lldb/lit/SymbolFile/NativePDB/stack_unwinding01.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/stack_unwinding01.cpp rename to lldb/lit/SymbolFile/NativePDB/stack_unwinding01.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/tag-types.cpp b/lldb/lit/SymbolFile/NativePDB/tag-types.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/tag-types.cpp rename to lldb/lit/SymbolFile/NativePDB/tag-types.cpp diff --git a/lldb/test/Shell/SymbolFile/NativePDB/typedefs.cpp b/lldb/lit/SymbolFile/NativePDB/typedefs.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/NativePDB/typedefs.cpp rename to lldb/lit/SymbolFile/NativePDB/typedefs.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/AstRestoreTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/AstRestoreTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/CompilandsTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/CompilandsTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest0.script b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest0.script similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest0.script rename to lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest0.script diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest1.script b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest1.script similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest1.script rename to lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest1.script diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest2.script b/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest2.script similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest2.script rename to lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest2.script diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbols.cpp b/lldb/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbols.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp b/lldb/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h b/lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h rename to lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord b/lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord rename to lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/PointerTypeTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/PointerTypeTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/PointerTypeTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/PointerTypeTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/TypeQualsTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/TypeQualsTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.script b/lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.script similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.script rename to lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.script diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.cpp b/lldb/lit/SymbolFile/PDB/Inputs/VBases.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/VBases.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.script b/lldb/lit/SymbolFile/PDB/Inputs/VBases.script similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.script rename to lldb/lit/SymbolFile/PDB/Inputs/VBases.script diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.script b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.script rename to lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script diff --git a/lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesTest.cpp rename to lldb/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp diff --git a/lldb/test/Shell/SymbolFile/PDB/ast-restore.test b/lldb/lit/SymbolFile/PDB/ast-restore.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/ast-restore.test rename to lldb/lit/SymbolFile/PDB/ast-restore.test diff --git a/lldb/test/Shell/SymbolFile/PDB/calling-conventions.test b/lldb/lit/SymbolFile/PDB/calling-conventions.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/calling-conventions.test rename to lldb/lit/SymbolFile/PDB/calling-conventions.test diff --git a/lldb/test/Shell/SymbolFile/PDB/class-layout.test b/lldb/lit/SymbolFile/PDB/class-layout.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/class-layout.test rename to lldb/lit/SymbolFile/PDB/class-layout.test diff --git a/lldb/test/Shell/SymbolFile/PDB/compilands.test b/lldb/lit/SymbolFile/PDB/compilands.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/compilands.test rename to lldb/lit/SymbolFile/PDB/compilands.test diff --git a/lldb/test/Shell/SymbolFile/PDB/enums-layout.test b/lldb/lit/SymbolFile/PDB/enums-layout.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/enums-layout.test rename to lldb/lit/SymbolFile/PDB/enums-layout.test diff --git a/lldb/test/Shell/SymbolFile/PDB/expressions.test b/lldb/lit/SymbolFile/PDB/expressions.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/expressions.test rename to lldb/lit/SymbolFile/PDB/expressions.test diff --git a/lldb/test/Shell/SymbolFile/PDB/func-symbols.test b/lldb/lit/SymbolFile/PDB/func-symbols.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/func-symbols.test rename to lldb/lit/SymbolFile/PDB/func-symbols.test diff --git a/lldb/test/Shell/SymbolFile/PDB/function-level-linking.test b/lldb/lit/SymbolFile/PDB/function-level-linking.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/function-level-linking.test rename to lldb/lit/SymbolFile/PDB/function-level-linking.test diff --git a/lldb/test/Shell/SymbolFile/PDB/function-nested-block.test b/lldb/lit/SymbolFile/PDB/function-nested-block.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/function-nested-block.test rename to lldb/lit/SymbolFile/PDB/function-nested-block.test diff --git a/lldb/test/Shell/SymbolFile/PDB/pointers.test b/lldb/lit/SymbolFile/PDB/pointers.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/pointers.test rename to lldb/lit/SymbolFile/PDB/pointers.test diff --git a/lldb/test/Shell/SymbolFile/PDB/type-quals.test b/lldb/lit/SymbolFile/PDB/type-quals.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/type-quals.test rename to lldb/lit/SymbolFile/PDB/type-quals.test diff --git a/lldb/test/Shell/SymbolFile/PDB/typedefs.test b/lldb/lit/SymbolFile/PDB/typedefs.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/typedefs.test rename to lldb/lit/SymbolFile/PDB/typedefs.test diff --git a/lldb/test/Shell/SymbolFile/PDB/udt-layout.test b/lldb/lit/SymbolFile/PDB/udt-layout.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/udt-layout.test rename to lldb/lit/SymbolFile/PDB/udt-layout.test diff --git a/lldb/test/Shell/SymbolFile/PDB/variables-locations.test b/lldb/lit/SymbolFile/PDB/variables-locations.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/variables-locations.test rename to lldb/lit/SymbolFile/PDB/variables-locations.test diff --git a/lldb/test/Shell/SymbolFile/PDB/variables.test b/lldb/lit/SymbolFile/PDB/variables.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/variables.test rename to lldb/lit/SymbolFile/PDB/variables.test diff --git a/lldb/test/Shell/SymbolFile/PDB/vbases.test b/lldb/lit/SymbolFile/PDB/vbases.test similarity index 100% rename from lldb/test/Shell/SymbolFile/PDB/vbases.test rename to lldb/lit/SymbolFile/PDB/vbases.test diff --git a/lldb/test/Shell/SymbolFile/dissassemble-entry-point.s b/lldb/lit/SymbolFile/dissassemble-entry-point.s similarity index 100% rename from lldb/test/Shell/SymbolFile/dissassemble-entry-point.s rename to lldb/lit/SymbolFile/dissassemble-entry-point.s diff --git a/lldb/test/Shell/SymbolFile/sizeless-symbol.test b/lldb/lit/SymbolFile/sizeless-symbol.test similarity index 100% rename from lldb/test/Shell/SymbolFile/sizeless-symbol.test rename to lldb/lit/SymbolFile/sizeless-symbol.test diff --git a/lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test b/lldb/lit/SymbolFile/target-symbols-add-unwind.test similarity index 100% rename from lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test rename to lldb/lit/SymbolFile/target-symbols-add-unwind.test diff --git a/lldb/test/Unit/lit.cfg.py b/lldb/lit/Unit/lit.cfg.py similarity index 97% rename from lldb/test/Unit/lit.cfg.py rename to lldb/lit/Unit/lit.cfg.py index e53bcd394ca1e..3633c73a1d404 100644 --- a/lldb/test/Unit/lit.cfg.py +++ b/lldb/lit/Unit/lit.cfg.py @@ -9,7 +9,7 @@ from lit.llvm import llvm_config # name: The name of this test suite. -config.name = 'lldb-unit' +config.name = 'lldb-Unit' # suffixes: A list of file extensions to treat as test files. config.suffixes = [] diff --git a/lldb/test/Unit/lit.site.cfg.py.in b/lldb/lit/Unit/lit.site.cfg.py.in similarity index 93% rename from lldb/test/Unit/lit.site.cfg.py.in rename to lldb/lit/Unit/lit.site.cfg.py.in index 9d9bcd4ba628d..0c629fdfaa565 100644 --- a/lldb/test/Unit/lit.site.cfg.py.in +++ b/lldb/lit/Unit/lit.site.cfg.py.in @@ -26,4 +26,4 @@ import lit.llvm lit.llvm.initialize(lit_config, config) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Unit/lit.cfg.py") +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Unit/lit.cfg.py") diff --git a/lldb/test/Shell/Unwind/Inputs/call-asm.c b/lldb/lit/Unwind/Inputs/call-asm.c similarity index 100% rename from lldb/test/Shell/Unwind/Inputs/call-asm.c rename to lldb/lit/Unwind/Inputs/call-asm.c diff --git a/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s b/lldb/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s similarity index 100% rename from lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s rename to lldb/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s diff --git a/lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s b/lldb/lit/Unwind/Inputs/eh-frame-small-fde.s similarity index 100% rename from lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s rename to lldb/lit/Unwind/Inputs/eh-frame-small-fde.s diff --git a/lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s b/lldb/lit/Unwind/Inputs/prefer-debug-over-eh-frame.s similarity index 100% rename from lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s rename to lldb/lit/Unwind/Inputs/prefer-debug-over-eh-frame.s diff --git a/lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s b/lldb/lit/Unwind/Inputs/trap_frame_sym_ctx.s similarity index 100% rename from lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s rename to lldb/lit/Unwind/Inputs/trap_frame_sym_ctx.s diff --git a/lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s b/lldb/lit/Unwind/Inputs/unwind-plan-dwarf-dump.s similarity index 100% rename from lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s rename to lldb/lit/Unwind/Inputs/unwind-plan-dwarf-dump.s diff --git a/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test b/lldb/lit/Unwind/eh-frame-dwarf-unwind.test similarity index 100% rename from lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test rename to lldb/lit/Unwind/eh-frame-dwarf-unwind.test diff --git a/lldb/test/Shell/Unwind/eh-frame-small-fde.test b/lldb/lit/Unwind/eh-frame-small-fde.test similarity index 100% rename from lldb/test/Shell/Unwind/eh-frame-small-fde.test rename to lldb/lit/Unwind/eh-frame-small-fde.test diff --git a/lldb/test/Shell/Unwind/prefer-debug-over-eh-frame.test b/lldb/lit/Unwind/prefer-debug-over-eh-frame.test similarity index 100% rename from lldb/test/Shell/Unwind/prefer-debug-over-eh-frame.test rename to lldb/lit/Unwind/prefer-debug-over-eh-frame.test diff --git a/lldb/test/Shell/Unwind/trap_frame_sym_ctx.test b/lldb/lit/Unwind/trap_frame_sym_ctx.test similarity index 100% rename from lldb/test/Shell/Unwind/trap_frame_sym_ctx.test rename to lldb/lit/Unwind/trap_frame_sym_ctx.test diff --git a/lldb/test/Shell/Unwind/unwind-plan-dwarf-dump.test b/lldb/lit/Unwind/unwind-plan-dwarf-dump.test similarity index 100% rename from lldb/test/Shell/Unwind/unwind-plan-dwarf-dump.test rename to lldb/lit/Unwind/unwind-plan-dwarf-dump.test diff --git a/lldb/test/Shell/Watchpoint/Inputs/main.cpp b/lldb/lit/Watchpoint/Inputs/main.cpp similarity index 100% rename from lldb/test/Shell/Watchpoint/Inputs/main.cpp rename to lldb/lit/Watchpoint/Inputs/main.cpp diff --git a/lldb/test/Shell/Watchpoint/SetErrorCases.test b/lldb/lit/Watchpoint/SetErrorCases.test similarity index 100% rename from lldb/test/Shell/Watchpoint/SetErrorCases.test rename to lldb/lit/Watchpoint/SetErrorCases.test diff --git a/lldb/test/Shell/helper/__init__.py b/lldb/lit/helper/__init__.py similarity index 100% rename from lldb/test/Shell/helper/__init__.py rename to lldb/lit/helper/__init__.py diff --git a/lldb/test/Shell/helper/build.py b/lldb/lit/helper/build.py similarity index 100% rename from lldb/test/Shell/helper/build.py rename to lldb/lit/helper/build.py diff --git a/lldb/test/Shell/helper/toolchain.py b/lldb/lit/helper/toolchain.py similarity index 98% rename from lldb/test/Shell/helper/toolchain.py rename to lldb/lit/helper/toolchain.py index d9e5c0593ec1c..0290e12c8f550 100644 --- a/lldb/test/Shell/helper/toolchain.py +++ b/lldb/lit/helper/toolchain.py @@ -29,7 +29,7 @@ def use_lldb_substitutions(config): if config.llvm_libs_dir: build_script_args.append('--libs-dir={0}'.format(config.llvm_libs_dir)) - lldb_init = os.path.join(config.test_exec_root, 'Shell', 'lit-lldb-init') + lldb_init = os.path.join(config.test_exec_root, 'lit-lldb-init') primary_tools = [ ToolSubst('%lldb', diff --git a/lldb/test/Shell/lit-lldb-init.in b/lldb/lit/lit-lldb-init.in similarity index 100% rename from lldb/test/Shell/lit-lldb-init.in rename to lldb/lit/lit-lldb-init.in diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/lit/lit.cfg.py similarity index 97% rename from lldb/test/Shell/lit.cfg.py rename to lldb/lit/lit.cfg.py index 3503e95692295..208338ce95c18 100644 --- a/lldb/test/Shell/lit.cfg.py +++ b/lldb/lit/lit.cfg.py @@ -17,7 +17,7 @@ from helper import toolchain # name: The name of this test suite. -config.name = 'lldb-shell' +config.name = 'LLDB' # testFormat: The test format to use to interpret tests. config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) @@ -35,7 +35,7 @@ config.test_source_root = os.path.dirname(__file__) # test_exec_root: The root path where tests should be run. -config.test_exec_root = os.path.join(config.lldb_obj_root, 'test') +config.test_exec_root = os.path.join(config.lldb_obj_root, 'lit') llvm_config.use_default_substitutions() diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/lit/lit.site.cfg.py.in similarity index 96% rename from lldb/test/Shell/lit.site.cfg.py.in rename to lldb/lit/lit.site.cfg.py.in index 459d560454121..c9b6e09cc0e75 100644 --- a/lldb/test/Shell/lit.site.cfg.py.in +++ b/lldb/lit/lit.site.cfg.py.in @@ -41,4 +41,4 @@ import lit.llvm lit.llvm.initialize(lit_config, config) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Shell/lit.cfg.py") +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/lit.cfg.py") diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt deleted file mode 100644 index 7080dc4520457..0000000000000 --- a/lldb/test/API/CMakeLists.txt +++ /dev/null @@ -1,149 +0,0 @@ -function(add_python_test_target name test_script args comment) - set(PYTHON_TEST_COMMAND - ${PYTHON_EXECUTABLE} - ${test_script} - ${args} - ) - - add_custom_target(${name} - COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS} - COMMENT "${comment}" - USES_TERMINAL - ) - add_dependencies(${name} lldb-test-deps) -endfunction() - -# The default architecture with which to compile test executables is the default LLVM target -# architecture, which itself defaults to the host architecture. -string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH) -if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" ) - string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE}) -endif () - -# Allow the user to override the default by setting LLDB_TEST_ARCH -set(LLDB_TEST_ARCH - ${LLDB_DEFAULT_TEST_ARCH} - CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") - -# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script -set(LLDB_TEST_USER_ARGS - "" - CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") - -# The .noindex suffix is a marker for Spotlight to never index the -# build directory. LLDB queries Spotlight to locate .dSYM bundles -# based on the UUID embedded in a binary, and because the UUID is a -# hash of filename and .text section, there *will* be conflicts inside -# the build directory. -set(LLDB_TEST_COMMON_ARGS - --arch=${LLDB_TEST_ARCH} - -s - ${CMAKE_BINARY_DIR}/lldb-test-traces - -S nm - -u CXXFLAGS - -u CFLAGS - ) - -list(APPEND LLDB_TEST_COMMON_ARGS - --executable ${LLDB_TEST_EXECUTABLE} - --dsymutil ${LLDB_TEST_DSYMUTIL} - --filecheck ${LLDB_TEST_FILECHECK} - -C ${LLDB_TEST_C_COMPILER} - ) - -if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - # All tests are currently flaky on Windows, so rerun them all once when they fail. - set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues) - - set(LLDB_TEST_DEBUG_TEST_CRASHES - 0 - CACHE BOOL "(Windows only) Enables debugging of tests in the test suite by showing the crash dialog when lldb crashes") - - set(LLDB_TEST_HIDE_CONSOLE_WINDOWS - 1 - CACHE BOOL "(Windows only) Hides the console window for an inferior when it is launched through the test suite") - - if (LLDB_TEST_DEBUG_TEST_CRASHES) - set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --enable-crash-dialog) - endif() - - if (NOT LLDB_TEST_HIDE_CONSOLE_WINDOWS) - set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --show-inferior-console) - endif() -endif() - -if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin") - list(APPEND LLDB_TEST_COMMON_ARGS - --env ARCHIVER=${CMAKE_AR} --env OBJCOPY=${CMAKE_OBJCOPY}) -endif() - -if (NOT "${LLDB_LIT_TOOLS_DIR}" STREQUAL "") - if (NOT EXISTS "${LLDB_LIT_TOOLS_DIR}") - message(WARNING "LLDB_LIT_TOOLS_DIR ${LLDB_LIT_TOOLS_DIR} does not exist.") - endif() -endif() - -if(CMAKE_HOST_APPLE) - if(LLDB_BUILD_FRAMEWORK) - get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) - list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_build_dir}/LLDB.framework) - endif() - - # Use the same identity for testing - get_property(code_sign_identity_used GLOBAL PROPERTY LLDB_DEBUGSERVER_CODESIGN_IDENTITY) - if(code_sign_identity_used) - list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${code_sign_identity_used}") - endif() - - if(LLDB_USE_SYSTEM_DEBUGSERVER) - lldb_find_system_debugserver(system_debugserver_path) - add_custom_target(debugserver - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${system_debugserver_path} ${LLVM_RUNTIME_OUTPUT_INTDIR} - COMMENT "Copying the system debugserver to LLDB's binaries directory for testing.") - # The custom target for the system debugserver has no install target, so we - # need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list. - if (LLVM_DISTRIBUTION_COMPONENTS) - list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS debugserver) - set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} PARENT_SCOPE) - endif() - message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}") - list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver) - add_lldb_test_dependency(debugserver) - elseif(TARGET debugserver) - set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver) - message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}") - list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path}) - add_lldb_test_dependency(debugserver) - elseif(TARGET lldb-server) - set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server) - message(STATUS "LLDB Tests use just-built lldb-server: ${lldb_server_path}") - list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path}) - add_lldb_test_dependency(lldb-server) - else() - message(WARNING "LLDB Tests enabled, but no server available") - endif() -endif() - -set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}) -set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS}) - -add_custom_target(check-lldb) -add_dependencies(check-lldb lldb-test-deps) -set_target_properties(check-lldb PROPERTIES FOLDER "lldb misc") - -# LLD is required to link test executables on Windows. -if (CMAKE_SYSTEM_NAME MATCHES "Windows") - if (TARGET lld) - add_lldb_test_dependency(lld) - else () - message(WARNING "lld required to test LLDB on Windows") - endif () -endif () - -# Run the lit-style tests and the unittests as part of the check-lldb target. -add_dependencies(check-lldb check-lldb-lit) - -# This will add LLDB's test dependencies to the dependencies for check-all and -# include them in the test-depends target. -set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS}) diff --git a/lldb/test/API/README.md b/lldb/test/API/README.md deleted file mode 100644 index fbb37136e26de..0000000000000 --- a/lldb/test/API/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# LLDB API Tests - -This directory only exists for the lit test driver. The actual tests live in -the `tests` directory in top level LLDB directory. diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index a5178764bfcbc..7080dc4520457 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -1,117 +1,149 @@ -# Test runner infrastructure for LLDB. This configures the LLDB test trees -# for use by Lit, and delegates to LLVM's lit test handlers. +function(add_python_test_target name test_script args comment) + set(PYTHON_TEST_COMMAND + ${PYTHON_EXECUTABLE} + ${test_script} + ${args} + ) + + add_custom_target(${name} + COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS} + COMMENT "${comment}" + USES_TERMINAL + ) + add_dependencies(${name} lldb-test-deps) +endfunction() + +# The default architecture with which to compile test executables is the default LLVM target +# architecture, which itself defaults to the host architecture. +string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH) +if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" ) + string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE}) +endif () -add_subdirectory(API) +# Allow the user to override the default by setting LLDB_TEST_ARCH +set(LLDB_TEST_ARCH + ${LLDB_DEFAULT_TEST_ARCH} + CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") + +# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script +set(LLDB_TEST_USER_ARGS + "" + CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") + +# The .noindex suffix is a marker for Spotlight to never index the +# build directory. LLDB queries Spotlight to locate .dSYM bundles +# based on the UUID embedded in a binary, and because the UUID is a +# hash of filename and .text section, there *will* be conflicts inside +# the build directory. +set(LLDB_TEST_COMMON_ARGS + --arch=${LLDB_TEST_ARCH} + -s + ${CMAKE_BINARY_DIR}/lldb-test-traces + -S nm + -u CXXFLAGS + -u CFLAGS + ) -# LLVM_BUILD_MODE is used in lit.site.cfg -if (CMAKE_CFG_INTDIR STREQUAL ".") - set(LLVM_BUILD_MODE ".") -else () - set(LLVM_BUILD_MODE "%(build_mode)s") -endif () +list(APPEND LLDB_TEST_COMMON_ARGS + --executable ${LLDB_TEST_EXECUTABLE} + --dsymutil ${LLDB_TEST_DSYMUTIL} + --filecheck ${LLDB_TEST_FILECHECK} + -C ${LLDB_TEST_C_COMPILER} + ) -if (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(LLDB_IS_64_BITS 1) -endif() +if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) + # All tests are currently flaky on Windows, so rerun them all once when they fail. + set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues) -get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY) -set(dotest_args_replacement ${LLVM_BUILD_MODE}) - -set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.") -set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.") - -if(LLDB_BUILT_STANDALONE) - # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder. - string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR}) - string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") - - # Remaining ones must be paths to the provided LLVM build-tree. - if(LLVM_CONFIGURATION_TYPES) - # LLDB uses single-config; LLVM multi-config; pick one and prefer Release types. - # Otherwise, if both use multi-config the default is fine. - if(NOT CMAKE_CONFIGURATION_TYPES) - if(RelWithDebInfo IN_LIST LLVM_CONFIGURATION_TYPES) - set(dotest_args_replacement RelWithDebInfo) - elseif(Release IN_LIST LLVM_CONFIGURATION_TYPES) - set(dotest_args_replacement Release) - else() - list(GET LLVM_CONFIGURATION_TYPES 0 dotest_args_replacement) - endif() - endif() - else() - # Common case: LLVM used a single-configuration generator like Ninja. - set(dotest_args_replacement ".") + set(LLDB_TEST_DEBUG_TEST_CRASHES + 0 + CACHE BOOL "(Windows only) Enables debugging of tests in the test suite by showing the crash dialog when lldb crashes") + + set(LLDB_TEST_HIDE_CONSOLE_WINDOWS + 1 + CACHE BOOL "(Windows only) Hides the console window for an inferior when it is launched through the test suite") + + if (LLDB_TEST_DEBUG_TEST_CRASHES) + set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --enable-crash-dialog) endif() -endif() -string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") -string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) -string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) - -add_lldb_test_dependency( - lit-cpuid - llc - lli - llvm-config - llvm-dwarfdump - llvm-nm - llvm-mc - llvm-objcopy - llvm-readobj - llvm-strip - ) + if (NOT LLDB_TEST_HIDE_CONSOLE_WINDOWS) + set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --show-inferior-console) + endif() +endif() -if(TARGET lld) - add_lldb_test_dependency(lld) +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin") + list(APPEND LLDB_TEST_COMMON_ARGS + --env ARCHIVER=${CMAKE_AR} --env OBJCOPY=${CMAKE_OBJCOPY}) endif() -# the value is not canonicalized within LLVM -llvm_canonicalize_cmake_booleans( - LLDB_DISABLE_PYTHON - LLVM_ENABLE_ZLIB - LLVM_ENABLE_SHARED_LIBS - LLDB_IS_64_BITS) - -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Shell/lit.site.cfg.py - MAIN_CONFIG - ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit.cfg.py) -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py - MAIN_CONFIG - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py) -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/API/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/API/lit.site.cfg) - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit-lldb-init.in - ${CMAKE_CURRENT_BINARY_DIR}/Shell/lit-lldb-init) - -if(NOT LLDB_BUILT_STANDALONE) - add_lldb_test_dependency( - FileCheck - count - not - ) +if (NOT "${LLDB_LIT_TOOLS_DIR}" STREQUAL "") + if (NOT EXISTS "${LLDB_LIT_TOOLS_DIR}") + message(WARNING "LLDB_LIT_TOOLS_DIR ${LLDB_LIT_TOOLS_DIR} does not exist.") + endif() endif() -add_lit_testsuite(check-lldb-lit "Running lldb lit test suite" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS lldb-test-deps - ) +if(CMAKE_HOST_APPLE) + if(LLDB_BUILD_FRAMEWORK) + get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) + list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_build_dir}/LLDB.framework) + endif() -set_target_properties(check-lldb-lit PROPERTIES FOLDER "lldb tests") + # Use the same identity for testing + get_property(code_sign_identity_used GLOBAL PROPERTY LLDB_DEBUGSERVER_CODESIGN_IDENTITY) + if(code_sign_identity_used) + list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${code_sign_identity_used}") + endif() -# If we're building with an in-tree clang, then list clang as a dependency -# to run tests. -if (TARGET clang) - add_dependencies(check-lldb-lit clang) + if(LLDB_USE_SYSTEM_DEBUGSERVER) + lldb_find_system_debugserver(system_debugserver_path) + add_custom_target(debugserver + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${system_debugserver_path} ${LLVM_RUNTIME_OUTPUT_INTDIR} + COMMENT "Copying the system debugserver to LLDB's binaries directory for testing.") + # The custom target for the system debugserver has no install target, so we + # need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list. + if (LLVM_DISTRIBUTION_COMPONENTS) + list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS debugserver) + set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} PARENT_SCOPE) + endif() + message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver) + add_lldb_test_dependency(debugserver) + elseif(TARGET debugserver) + set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver) + message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path}) + add_lldb_test_dependency(debugserver) + elseif(TARGET lldb-server) + set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server) + message(STATUS "LLDB Tests use just-built lldb-server: ${lldb_server_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path}) + add_lldb_test_dependency(lldb-server) + else() + message(WARNING "LLDB Tests enabled, but no server available") + endif() endif() -add_lit_testsuites(LLDB - ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS lldb-test-deps - ) +set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}) +set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS}) + +add_custom_target(check-lldb) +add_dependencies(check-lldb lldb-test-deps) +set_target_properties(check-lldb PROPERTIES FOLDER "lldb misc") + +# LLD is required to link test executables on Windows. +if (CMAKE_SYSTEM_NAME MATCHES "Windows") + if (TARGET lld) + add_lldb_test_dependency(lld) + else () + message(WARNING "lld required to test LLDB on Windows") + endif () +endif () + +# Run the lit-style tests and the unittests as part of the check-lldb target. +add_dependencies(check-lldb check-lldb-lit) + +# This will add LLDB's test dependencies to the dependencies for check-all and +# include them in the test-depends target. +set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS}) diff --git a/lldb/test/Unit/README.md b/lldb/test/Unit/README.md deleted file mode 100644 index 0302747acd9fa..0000000000000 --- a/lldb/test/Unit/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# LLDB Unit Tests - -This directory only exists for the lit test driver. The actual tests live in -the `unittest` directory in top level LLDB directory. diff --git a/lldb/test/API/dotest.py b/lldb/test/dotest.py similarity index 100% rename from lldb/test/API/dotest.py rename to lldb/test/dotest.py diff --git a/lldb/test/lit.cfg.py b/lldb/test/lit.cfg.py deleted file mode 100644 index 797750bac2126..0000000000000 --- a/lldb/test/lit.cfg.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- Python -*- - -import os -import platform -import re -import shutil -import site -import sys - -import lit.formats -from lit.llvm import llvm_config -from lit.llvm.subst import FindTool -from lit.llvm.subst import ToolSubst -from distutils.spawn import find_executable - -# This is the top level configuration. Most of these configuration options will -# be overriden by individual lit configuration files in the test -# subdirectories. - -# name: The name of this test suite. -config.name = 'lldb' - -# testFormat: The test format to use to interpret tests. -config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) - -# suffixes: A list of file extensions to treat as test files. This is overriden -# by individual lit.local.cfg files in the test subdirectories. -config.suffixes = ['.test', '.cpp', '.s'] - -# excludes: A list of directories to exclude from the testsuite. The 'Inputs' -# subdirectories contain auxiliary inputs for various tests in their parent -# directories. -config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt'] - -# test_source_root: The root path where tests are located. -config.test_source_root = os.path.dirname(__file__) - -# test_exec_root: The root path where tests should be run. -config.test_exec_root = os.path.join(config.lldb_obj_root, 'test') - -llvm_config.use_default_substitutions() diff --git a/lldb/test/API/testcases b/lldb/test/testcases similarity index 100% rename from lldb/test/API/testcases rename to lldb/test/testcases diff --git a/lldb/test/API/use_lldb_suite.py b/lldb/test/use_lldb_suite.py similarity index 100% rename from lldb/test/API/use_lldb_suite.py rename to lldb/test/use_lldb_suite.py From d5b7a4e2e8dc63b02129a29745c548613152a522 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 9 Oct 2019 17:39:19 +0000 Subject: [PATCH 20/44] [WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering Summary: Adds the new v8x16.swizzle SIMD instruction as specified at https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#swizzling-using-variable-indices. In addition to adding swizzles as a candidate lowering in LowerBUILD_VECTOR, also rewrites and simplifies the lowering to minimize the number of replace_lanes necessary rather than trying to minimize code size. This leads to more uses of v128.const instead of splats, which is expected to increase performance. The new code will be easier to tune once V8 implements all the vector construction operations, and it will also be easier to add new candidate instructions in the future if necessary. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68527 llvm-svn: 374188 --- .../lib/Target/WebAssembly/WebAssemblyISD.def | 1 + .../WebAssembly/WebAssemblyISelLowering.cpp | 196 +++++++++++------- .../WebAssembly/WebAssemblyInstrSIMD.td | 9 + .../CodeGen/WebAssembly/simd-build-vector.ll | 187 +++++++++++++++-- llvm/test/MC/WebAssembly/simd-encodings.s | 3 + 5 files changed, 300 insertions(+), 96 deletions(-) diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISD.def b/llvm/lib/Target/WebAssembly/WebAssemblyISD.def index 827a7441ff873..13f0476eb4a5a 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISD.def +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISD.def @@ -26,6 +26,7 @@ HANDLE_NODETYPE(WrapperPIC) HANDLE_NODETYPE(BR_IF) HANDLE_NODETYPE(BR_TABLE) HANDLE_NODETYPE(SHUFFLE) +HANDLE_NODETYPE(SWIZZLE) HANDLE_NODETYPE(VEC_SHL) HANDLE_NODETYPE(VEC_SHR_S) HANDLE_NODETYPE(VEC_SHR_U) diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp index 53ca7d77ca057..538234384af15 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp @@ -1292,68 +1292,116 @@ SDValue WebAssemblyTargetLowering::LowerBUILD_VECTOR(SDValue Op, const EVT VecT = Op.getValueType(); const EVT LaneT = Op.getOperand(0).getValueType(); const size_t Lanes = Op.getNumOperands(); + bool CanSwizzle = Subtarget->hasUnimplementedSIMD128() && VecT == MVT::v16i8; + + // BUILD_VECTORs are lowered to the instruction that initializes the highest + // possible number of lanes at once followed by a sequence of replace_lane + // instructions to individually initialize any remaining lanes. + + // TODO: Tune this. For example, lanewise swizzling is very expensive, so + // swizzled lanes should be given greater weight. + + // TODO: Investigate building vectors by shuffling together vectors built by + // separately specialized means. + auto IsConstant = [](const SDValue &V) { return V.getOpcode() == ISD::Constant || V.getOpcode() == ISD::ConstantFP; }; - // Find the most common operand, which is approximately the best to splat - using Entry = std::pair; - SmallVector ValueCounts; - size_t NumConst = 0, NumDynamic = 0; - for (const SDValue &Lane : Op->op_values()) { - if (Lane.isUndef()) { - continue; - } else if (IsConstant(Lane)) { - NumConst++; - } else { - NumDynamic++; - } - auto CountIt = std::find_if(ValueCounts.begin(), ValueCounts.end(), - [&Lane](Entry A) { return A.first == Lane; }); - if (CountIt == ValueCounts.end()) { - ValueCounts.emplace_back(Lane, 1); + // Returns the source vector and index vector pair if they exist. Checks for: + // (extract_vector_elt + // $src, + // (sign_extend_inreg (extract_vector_elt $indices, $i)) + // ) + auto GetSwizzleSrcs = [](size_t I, const SDValue &Lane) { + auto Bail = std::make_pair(SDValue(), SDValue()); + if (Lane->getOpcode() != ISD::EXTRACT_VECTOR_ELT) + return Bail; + const SDValue &SwizzleSrc = Lane->getOperand(0); + const SDValue &IndexExt = Lane->getOperand(1); + if (IndexExt->getOpcode() != ISD::SIGN_EXTEND_INREG) + return Bail; + const SDValue &Index = IndexExt->getOperand(0); + if (Index->getOpcode() != ISD::EXTRACT_VECTOR_ELT) + return Bail; + const SDValue &SwizzleIndices = Index->getOperand(0); + if (SwizzleSrc.getValueType() != MVT::v16i8 || + SwizzleIndices.getValueType() != MVT::v16i8 || + Index->getOperand(1)->getOpcode() != ISD::Constant || + Index->getConstantOperandVal(1) != I) + return Bail; + return std::make_pair(SwizzleSrc, SwizzleIndices); + }; + + using ValueEntry = std::pair; + SmallVector SplatValueCounts; + + using SwizzleEntry = std::pair, size_t>; + SmallVector SwizzleCounts; + + auto AddCount = [](auto &Counts, const auto &Val) { + auto CountIt = std::find_if(Counts.begin(), Counts.end(), + [&Val](auto E) { return E.first == Val; }); + if (CountIt == Counts.end()) { + Counts.emplace_back(Val, 1); } else { CountIt->second++; } + }; + + auto GetMostCommon = [](auto &Counts) { + auto CommonIt = + std::max_element(Counts.begin(), Counts.end(), + [](auto A, auto B) { return A.second < B.second; }); + assert(CommonIt != Counts.end() && "Unexpected all-undef build_vector"); + return *CommonIt; + }; + + size_t NumConstantLanes = 0; + + // Count eligible lanes for each type of vector creation op + for (size_t I = 0; I < Lanes; ++I) { + const SDValue &Lane = Op->getOperand(I); + if (Lane.isUndef()) + continue; + + AddCount(SplatValueCounts, Lane); + + if (IsConstant(Lane)) { + NumConstantLanes++; + } else if (CanSwizzle) { + auto SwizzleSrcs = GetSwizzleSrcs(I, Lane); + if (SwizzleSrcs.first) + AddCount(SwizzleCounts, SwizzleSrcs); + } } - auto CommonIt = - std::max_element(ValueCounts.begin(), ValueCounts.end(), - [](Entry A, Entry B) { return A.second < B.second; }); - assert(CommonIt != ValueCounts.end() && "Unexpected all-undef build_vector"); - SDValue SplatValue = CommonIt->first; - size_t NumCommon = CommonIt->second; - - // If v128.const is available, consider using it instead of a splat + + SDValue SplatValue; + size_t NumSplatLanes; + std::tie(SplatValue, NumSplatLanes) = GetMostCommon(SplatValueCounts); + + SDValue SwizzleSrc; + SDValue SwizzleIndices; + size_t NumSwizzleLanes = 0; + if (SwizzleCounts.size()) + std::forward_as_tuple(std::tie(SwizzleSrc, SwizzleIndices), + NumSwizzleLanes) = GetMostCommon(SwizzleCounts); + + // Predicate returning true if the lane is properly initialized by the + // original instruction + std::function IsLaneConstructed; + SDValue Result; if (Subtarget->hasUnimplementedSIMD128()) { - // {i32,i64,f32,f64}.const opcode, and value - const size_t ConstBytes = 1 + std::max(size_t(4), 16 / Lanes); - // SIMD prefix and opcode - const size_t SplatBytes = 2; - const size_t SplatConstBytes = SplatBytes + ConstBytes; - // SIMD prefix, opcode, and lane index - const size_t ReplaceBytes = 3; - const size_t ReplaceConstBytes = ReplaceBytes + ConstBytes; - // SIMD prefix, v128.const opcode, and 128-bit value - const size_t VecConstBytes = 18; - // Initial v128.const and a replace_lane for each non-const operand - const size_t ConstInitBytes = VecConstBytes + NumDynamic * ReplaceBytes; - // Initial splat and all necessary replace_lanes - const size_t SplatInitBytes = - IsConstant(SplatValue) - // Initial constant splat - ? (SplatConstBytes + - // Constant replace_lanes - (NumConst - NumCommon) * ReplaceConstBytes + - // Dynamic replace_lanes - (NumDynamic * ReplaceBytes)) - // Initial dynamic splat - : (SplatBytes + - // Constant replace_lanes - (NumConst * ReplaceConstBytes) + - // Dynamic replace_lanes - (NumDynamic - NumCommon) * ReplaceBytes); - if (ConstInitBytes < SplatInitBytes) { - // Create build_vector that will lower to initial v128.const + // Prefer swizzles over vector consts over splats + if (NumSwizzleLanes >= NumSplatLanes && + NumSwizzleLanes >= NumConstantLanes) { + Result = DAG.getNode(WebAssemblyISD::SWIZZLE, DL, VecT, SwizzleSrc, + SwizzleIndices); + auto Swizzled = std::make_pair(SwizzleSrc, SwizzleIndices); + IsLaneConstructed = [&, Swizzled](size_t I, const SDValue &Lane) { + return Swizzled == GetSwizzleSrcs(I, Lane); + }; + } else if (NumConstantLanes >= NumSplatLanes) { SmallVector ConstLanes; for (const SDValue &Lane : Op->op_values()) { if (IsConstant(Lane)) { @@ -1364,35 +1412,35 @@ SDValue WebAssemblyTargetLowering::LowerBUILD_VECTOR(SDValue Op, ConstLanes.push_back(DAG.getConstant(0, DL, LaneT)); } } - SDValue Result = DAG.getBuildVector(VecT, DL, ConstLanes); - // Add replace_lane instructions for non-const lanes - for (size_t I = 0; I < Lanes; ++I) { - const SDValue &Lane = Op->getOperand(I); - if (!Lane.isUndef() && !IsConstant(Lane)) - Result = DAG.getNode(ISD::INSERT_VECTOR_ELT, DL, VecT, Result, Lane, - DAG.getConstant(I, DL, MVT::i32)); - } - return Result; + Result = DAG.getBuildVector(VecT, DL, ConstLanes); + IsLaneConstructed = [&](size_t _, const SDValue &Lane) { + return IsConstant(Lane); + }; } } - // Use a splat for the initial vector - SDValue Result; - // Possibly a load_splat - LoadSDNode *SplattedLoad; - if (Subtarget->hasUnimplementedSIMD128() && - (SplattedLoad = dyn_cast(SplatValue)) && - SplattedLoad->getMemoryVT() == VecT.getVectorElementType()) { - Result = DAG.getNode(WebAssemblyISD::LOAD_SPLAT, DL, VecT, SplatValue); - } else { - Result = DAG.getSplatBuildVector(VecT, DL, SplatValue); + if (!Result) { + // Use a splat, but possibly a load_splat + LoadSDNode *SplattedLoad; + if (Subtarget->hasUnimplementedSIMD128() && + (SplattedLoad = dyn_cast(SplatValue)) && + SplattedLoad->getMemoryVT() == VecT.getVectorElementType()) { + Result = DAG.getNode(WebAssemblyISD::LOAD_SPLAT, DL, VecT, SplatValue); + } else { + Result = DAG.getSplatBuildVector(VecT, DL, SplatValue); + } + IsLaneConstructed = [&](size_t _, const SDValue &Lane) { + return Lane == SplatValue; + }; } - // Add replace_lane instructions for other values + + // Add replace_lane instructions for any unhandled values for (size_t I = 0; I < Lanes; ++I) { const SDValue &Lane = Op->getOperand(I); - if (Lane != SplatValue) + if (!Lane.isUndef() && !IsLaneConstructed(I, Lane)) Result = DAG.getNode(ISD::INSERT_VECTOR_ELT, DL, VecT, Result, Lane, DAG.getConstant(I, DL, MVT::i32)); } + return Result; } diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td index a9966af4b586c..16549f39b186e 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td @@ -275,6 +275,15 @@ def : Pat<(vec_t (wasm_shuffle (vec_t V128:$x), (vec_t V128:$y), (i32 LaneIdx32:$mE), (i32 LaneIdx32:$mF)))>; } +// Swizzle lanes: v8x16.swizzle +def wasm_swizzle_t : SDTypeProfile<1, 2, []>; +def wasm_swizzle : SDNode<"WebAssemblyISD::SWIZZLE", wasm_swizzle_t>; +defm SWIZZLE : + SIMD_I<(outs V128:$dst), (ins V128:$src, V128:$mask), (outs), (ins), + [(set (v16i8 V128:$dst), + (wasm_swizzle (v16i8 V128:$src), (v16i8 V128:$mask)))], + "v8x16.swizzle\t$dst, $src, $mask", "v8x16.swizzle", 192>; + // Create vector with identical lanes: splat def splat2 : PatFrag<(ops node:$x), (build_vector node:$x, node:$x)>; def splat4 : PatFrag<(ops node:$x), (build_vector diff --git a/llvm/test/CodeGen/WebAssembly/simd-build-vector.ll b/llvm/test/CodeGen/WebAssembly/simd-build-vector.ll index 41a320c92f702..469c50ae2714c 100644 --- a/llvm/test/CodeGen/WebAssembly/simd-build-vector.ll +++ b/llvm/test/CodeGen/WebAssembly/simd-build-vector.ll @@ -7,13 +7,12 @@ target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown" -; CHECK-LABEL: same_const_one_replaced_i8x16: -; CHECK-NEXT: .functype same_const_one_replaced_i8x16 (i32) -> (v128) -; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 42 -; CHECK-NEXT: i16x8.splat $push[[L1:[0-9]+]]=, $pop[[L0]] -; CHECK-NEXT: i16x8.replace_lane $push[[L2:[0-9]+]]=, $pop[[L1]], 5, $0 -; CHECK-NEXT: return $pop[[L2]] -define <8 x i16> @same_const_one_replaced_i8x16(i16 %x) { +; CHECK-LABEL: same_const_one_replaced_i16x8: +; CHECK-NEXT: .functype same_const_one_replaced_i16x8 (i32) -> (v128) +; CHECK-NEXT: v128.const $push[[L0:[0-9]+]]=, 42, 42, 42, 42, 42, 0, 42, 42 +; CHECK-NEXT: i16x8.replace_lane $push[[L1:[0-9]+]]=, $pop[[L0]], 5, $0 +; CHECK-NEXT: return $pop[[L1]] +define <8 x i16> @same_const_one_replaced_i16x8(i16 %x) { %v = insertelement <8 x i16> , i16 %x, @@ -21,12 +20,12 @@ define <8 x i16> @same_const_one_replaced_i8x16(i16 %x) { ret <8 x i16> %v } -; CHECK-LABEL: different_const_one_replaced_i8x16: -; CHECK-NEXT: .functype different_const_one_replaced_i8x16 (i32) -> (v128) +; CHECK-LABEL: different_const_one_replaced_i16x8: +; CHECK-NEXT: .functype different_const_one_replaced_i16x8 (i32) -> (v128) ; CHECK-NEXT: v128.const $push[[L0:[0-9]+]]=, 1, -2, 3, -4, 5, 0, 7, -8 ; CHECK-NEXT: i16x8.replace_lane $push[[L1:[0-9]+]]=, $pop[[L0]], 5, $0 ; CHECK-NEXT: return $pop[[L1]] -define <8 x i16> @different_const_one_replaced_i8x16(i16 %x) { +define <8 x i16> @different_const_one_replaced_i16x8(i16 %x) { %v = insertelement <8 x i16> , i16 %x, @@ -36,10 +35,9 @@ define <8 x i16> @different_const_one_replaced_i8x16(i16 %x) { ; CHECK-LABEL: same_const_one_replaced_f32x4: ; CHECK-NEXT: .functype same_const_one_replaced_f32x4 (f32) -> (v128) -; CHECK-NEXT: f32.const $push[[L0:[0-9]+]]=, 0x1.5p5 -; CHECK-NEXT: f32x4.splat $push[[L1:[0-9]+]]=, $pop[[L0]] -; CHECK-NEXT: f32x4.replace_lane $push[[L2:[0-9]+]]=, $pop[[L1]], 2, $0 -; CHECK-NEXT: return $pop[[L2]] +; CHECK-NEXT: v128.const $push[[L0:[0-9]+]]=, 0x1.5p5, 0x1.5p5, 0x0p0, 0x1.5p5 +; CHECK-NEXT: f32x4.replace_lane $push[[L1:[0-9]+]]=, $pop[[L0]], 2, $0 +; CHECK-NEXT: return $pop[[L1]] define <4 x float> @same_const_one_replaced_f32x4(float %x) { %v = insertelement <4 x float> , @@ -63,11 +61,8 @@ define <4 x float> @different_const_one_replaced_f32x4(float %x) { ; CHECK-LABEL: splat_common_const_i32x4: ; CHECK-NEXT: .functype splat_common_const_i32x4 () -> (v128) -; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 3 -; CHECK-NEXT: i32x4.splat $push[[L1:[0-9]+]]=, $pop[[L0]] -; CHECK-NEXT: i32.const $push[[L2:[0-9]+]]=, 1 -; CHECK-NEXT: i32x4.replace_lane $push[[L3:[0-9]+]]=, $pop[[L1]], 3, $pop[[L2]] -; CHECK-NEXT: return $pop[[L3]] +; CHECK-NEXT: v128.const $push[[L0:[0-9]+]]=, 0, 3, 3, 1 +; CHECK-NEXT: return $pop[[L0]] define <4 x i32> @splat_common_const_i32x4() { ret <4 x i32> } @@ -92,11 +87,159 @@ define <8 x i16> @splat_common_arg_i16x8(i16 %a, i16 %b, i16 %c) { ret <8 x i16> %v7 } +; CHECK-LABEL: swizzle_one_i8x16: +; CHECK-NEXT: .functype swizzle_one_i8x16 (v128, v128) -> (v128) +; CHECK-NEXT: v8x16.swizzle $push[[L0:[0-9]+]]=, $0, $1 +; CHECK-NEXT: return $pop[[L0]] +define <16 x i8> @swizzle_one_i8x16(<16 x i8> %src, <16 x i8> %mask) { + %m0 = extractelement <16 x i8> %mask, i32 0 + %s0 = extractelement <16 x i8> %src, i8 %m0 + %v0 = insertelement <16 x i8> undef, i8 %s0, i32 0 + ret <16 x i8> %v0 +} + +; CHECK-LABEL: swizzle_all_i8x16: +; CHECK-NEXT: .functype swizzle_all_i8x16 (v128, v128) -> (v128) +; CHECK-NEXT: v8x16.swizzle $push[[L0:[0-9]+]]=, $0, $1 +; CHECK-NEXT: return $pop[[L0]] +define <16 x i8> @swizzle_all_i8x16(<16 x i8> %src, <16 x i8> %mask) { + %m0 = extractelement <16 x i8> %mask, i32 0 + %s0 = extractelement <16 x i8> %src, i8 %m0 + %v0 = insertelement <16 x i8> undef, i8 %s0, i32 0 + %m1 = extractelement <16 x i8> %mask, i32 1 + %s1 = extractelement <16 x i8> %src, i8 %m1 + %v1 = insertelement <16 x i8> %v0, i8 %s1, i32 1 + %m2 = extractelement <16 x i8> %mask, i32 2 + %s2 = extractelement <16 x i8> %src, i8 %m2 + %v2 = insertelement <16 x i8> %v1, i8 %s2, i32 2 + %m3 = extractelement <16 x i8> %mask, i32 3 + %s3 = extractelement <16 x i8> %src, i8 %m3 + %v3 = insertelement <16 x i8> %v2, i8 %s3, i32 3 + %m4 = extractelement <16 x i8> %mask, i32 4 + %s4 = extractelement <16 x i8> %src, i8 %m4 + %v4 = insertelement <16 x i8> %v3, i8 %s4, i32 4 + %m5 = extractelement <16 x i8> %mask, i32 5 + %s5 = extractelement <16 x i8> %src, i8 %m5 + %v5 = insertelement <16 x i8> %v4, i8 %s5, i32 5 + %m6 = extractelement <16 x i8> %mask, i32 6 + %s6 = extractelement <16 x i8> %src, i8 %m6 + %v6 = insertelement <16 x i8> %v5, i8 %s6, i32 6 + %m7 = extractelement <16 x i8> %mask, i32 7 + %s7 = extractelement <16 x i8> %src, i8 %m7 + %v7 = insertelement <16 x i8> %v6, i8 %s7, i32 7 + %m8 = extractelement <16 x i8> %mask, i32 8 + %s8 = extractelement <16 x i8> %src, i8 %m8 + %v8 = insertelement <16 x i8> %v7, i8 %s8, i32 8 + %m9 = extractelement <16 x i8> %mask, i32 9 + %s9 = extractelement <16 x i8> %src, i8 %m9 + %v9 = insertelement <16 x i8> %v8, i8 %s9, i32 9 + %m10 = extractelement <16 x i8> %mask, i32 10 + %s10 = extractelement <16 x i8> %src, i8 %m10 + %v10 = insertelement <16 x i8> %v9, i8 %s10, i32 10 + %m11 = extractelement <16 x i8> %mask, i32 11 + %s11 = extractelement <16 x i8> %src, i8 %m11 + %v11 = insertelement <16 x i8> %v10, i8 %s11, i32 11 + %m12 = extractelement <16 x i8> %mask, i32 12 + %s12 = extractelement <16 x i8> %src, i8 %m12 + %v12 = insertelement <16 x i8> %v11, i8 %s12, i32 12 + %m13 = extractelement <16 x i8> %mask, i32 13 + %s13 = extractelement <16 x i8> %src, i8 %m13 + %v13 = insertelement <16 x i8> %v12, i8 %s13, i32 13 + %m14 = extractelement <16 x i8> %mask, i32 14 + %s14 = extractelement <16 x i8> %src, i8 %m14 + %v14 = insertelement <16 x i8> %v13, i8 %s14, i32 14 + %m15 = extractelement <16 x i8> %mask, i32 15 + %s15 = extractelement <16 x i8> %src, i8 %m15 + %v15 = insertelement <16 x i8> %v14, i8 %s15, i32 15 + ret <16 x i8> %v15 +} + +; CHECK-LABEL: swizzle_one_i16x8: +; CHECK-NEXT: .functype swizzle_one_i16x8 (v128, v128) -> (v128) +; CHECK-NOT: swizzle +; CHECK: return +define <8 x i16> @swizzle_one_i16x8(<8 x i16> %src, <8 x i16> %mask) { + %m0 = extractelement <8 x i16> %mask, i32 0 + %s0 = extractelement <8 x i16> %src, i16 %m0 + %v0 = insertelement <8 x i16> undef, i16 %s0, i32 0 + ret <8 x i16> %v0 +} + +; CHECK-LABEL: mashup_swizzle_i8x16: +; CHECK-NEXT: .functype mashup_swizzle_i8x16 (v128, v128, i32) -> (v128) +; CHECK-NEXT: v8x16.swizzle $push[[L0:[0-9]+]]=, $0, $1 +; CHECK: i8x16.replace_lane +; CHECK: i8x16.replace_lane +; CHECK: i8x16.replace_lane +; CHECK: i8x16.replace_lane +; CHECK: return +define <16 x i8> @mashup_swizzle_i8x16(<16 x i8> %src, <16 x i8> %mask, i8 %splatted) { + ; swizzle 0 + %m0 = extractelement <16 x i8> %mask, i32 0 + %s0 = extractelement <16 x i8> %src, i8 %m0 + %v0 = insertelement <16 x i8> undef, i8 %s0, i32 0 + ; swizzle 7 + %m1 = extractelement <16 x i8> %mask, i32 7 + %s1 = extractelement <16 x i8> %src, i8 %m1 + %v1 = insertelement <16 x i8> %v0, i8 %s1, i32 7 + ; splat 3 + %v2 = insertelement <16 x i8> %v1, i8 %splatted, i32 3 + ; splat 12 + %v3 = insertelement <16 x i8> %v2, i8 %splatted, i32 12 + ; const 4 + %v4 = insertelement <16 x i8> %v3, i8 42, i32 4 + ; const 14 + %v5 = insertelement <16 x i8> %v4, i8 42, i32 14 + ret <16 x i8> %v5 +} + +; CHECK-LABEL: mashup_const_i8x16: +; CHECK-NEXT: .functype mashup_const_i8x16 (v128, v128, i32) -> (v128) +; CHECK: v128.const $push[[L0:[0-9]+]]=, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0 +; CHECK: i8x16.replace_lane +; CHECK: i8x16.replace_lane +; CHECK: i8x16.replace_lane +; CHECK: return +define <16 x i8> @mashup_const_i8x16(<16 x i8> %src, <16 x i8> %mask, i8 %splatted) { + ; swizzle 0 + %m0 = extractelement <16 x i8> %mask, i32 0 + %s0 = extractelement <16 x i8> %src, i8 %m0 + %v0 = insertelement <16 x i8> undef, i8 %s0, i32 0 + ; splat 3 + %v1 = insertelement <16 x i8> %v0, i8 %splatted, i32 3 + ; splat 12 + %v2 = insertelement <16 x i8> %v1, i8 %splatted, i32 12 + ; const 4 + %v3 = insertelement <16 x i8> %v2, i8 42, i32 4 + ; const 14 + %v4 = insertelement <16 x i8> %v3, i8 42, i32 14 + ret <16 x i8> %v4 +} + +; CHECK-LABEL: mashup_splat_i8x16: +; CHECK-NEXT: .functype mashup_splat_i8x16 (v128, v128, i32) -> (v128) +; CHECK: i8x16.splat $push[[L0:[0-9]+]]=, $2 +; CHECK: i8x16.replace_lane +; CHECK: i8x16.replace_lane +; CHECK: return +define <16 x i8> @mashup_splat_i8x16(<16 x i8> %src, <16 x i8> %mask, i8 %splatted) { + ; swizzle 0 + %m0 = extractelement <16 x i8> %mask, i32 0 + %s0 = extractelement <16 x i8> %src, i8 %m0 + %v0 = insertelement <16 x i8> undef, i8 %s0, i32 0 + ; splat 3 + %v1 = insertelement <16 x i8> %v0, i8 %splatted, i32 3 + ; splat 12 + %v2 = insertelement <16 x i8> %v1, i8 %splatted, i32 12 + ; const 4 + %v3 = insertelement <16 x i8> %v2, i8 42, i32 4 + ret <16 x i8> %v3 +} + ; CHECK-LABEL: undef_const_insert_f32x4: ; CHECK-NEXT: .functype undef_const_insert_f32x4 () -> (v128) -; CHECK-NEXT: f32.const $push[[L0:[0-9]+]]=, 0x1.5p5 -; CHECK-NEXT: f32x4.splat $push[[L1:[0-9]+]]=, $pop[[L0]] -; CHECK-NEXT: return $pop[[L1]] +; CHECK-NEXT: v128.const $push[[L0:[0-9]+]]=, 0x0p0, 0x1.5p5, 0x0p0, 0x0p0 +; CHECK-NEXT: return $pop[[L0]] define <4 x float> @undef_const_insert_f32x4() { %v = insertelement <4 x float> undef, float 42., i32 1 ret <4 x float> %v diff --git a/llvm/test/MC/WebAssembly/simd-encodings.s b/llvm/test/MC/WebAssembly/simd-encodings.s index 2ee9f9ea8db00..f321094b53db7 100644 --- a/llvm/test/MC/WebAssembly/simd-encodings.s +++ b/llvm/test/MC/WebAssembly/simd-encodings.s @@ -463,6 +463,9 @@ main: # CHECK: f64x2.convert_i64x2_u # encoding: [0xfd,0xb2,0x01] f64x2.convert_i64x2_u + # CHECK: v8x16.swizzle # encoding: [0xfd,0xc0,0x01] + v8x16.swizzle + # CHECK: v8x16.load_splat 48 # encoding: [0xfd,0xc2,0x01,0x00,0x30] v8x16.load_splat 48 From 3419e90dc1a26b60555ee202a1e0914e04150f97 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 9 Oct 2019 17:45:47 +0000 Subject: [PATCH 21/44] [WebAssembly] Add builtin and intrinsic for v8x16.swizzle Summary: This clang builtin and corresponding LLVM intrinsic are necessary to expose the exact semantics of the underlying WebAssembly instruction to users. LLVM produces a poison value if the dynamic swizzle indices are greater than the vector size, but the WebAssembly instruction sets the corresponding output lane to zero. Users who depend on this behavior can safely use this builtin. Depends on D68527. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D68531 llvm-svn: 374189 --- clang/include/clang/Basic/BuiltinsWebAssembly.def | 2 ++ clang/lib/CodeGen/CGBuiltin.cpp | 6 ++++++ clang/test/CodeGen/builtins-wasm.c | 7 ++++++- llvm/include/llvm/IR/IntrinsicsWebAssembly.td | 4 ++++ llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td | 4 ++++ llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll | 10 ++++++++++ 6 files changed, 32 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Basic/BuiltinsWebAssembly.def b/clang/include/clang/Basic/BuiltinsWebAssembly.def index f825040d61428..7e80e91c567ff 100644 --- a/clang/include/clang/Basic/BuiltinsWebAssembly.def +++ b/clang/include/clang/Basic/BuiltinsWebAssembly.def @@ -60,6 +60,8 @@ TARGET_BUILTIN(__builtin_wasm_trunc_saturate_s_i64_f64, "LLid", "nc", "nontrappi TARGET_BUILTIN(__builtin_wasm_trunc_saturate_u_i64_f64, "LLid", "nc", "nontrapping-fptoint") // SIMD builtins +TARGET_BUILTIN(__builtin_wasm_swizzle_v8x16, "V16cV16cV16c", "nc", "unimplemented-simd128") + TARGET_BUILTIN(__builtin_wasm_extract_lane_s_i8x16, "iV16cIi", "nc", "simd128") TARGET_BUILTIN(__builtin_wasm_extract_lane_u_i8x16, "iV16cIi", "nc", "unimplemented-simd128") TARGET_BUILTIN(__builtin_wasm_extract_lane_s_i16x8, "iV8sIi", "nc", "simd128") diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index d5389d74cb8da..0562a623ae2b3 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -14066,6 +14066,12 @@ Value *CodeGenFunction::EmitWebAssemblyBuiltinExpr(unsigned BuiltinID, ConvertType(E->getType())); return Builder.CreateCall(Callee, {LHS, RHS}); } + case WebAssembly::BI__builtin_wasm_swizzle_v8x16: { + Value *Src = EmitScalarExpr(E->getArg(0)); + Value *Indices = EmitScalarExpr(E->getArg(1)); + Function *Callee = CGM.getIntrinsic(Intrinsic::wasm_swizzle); + return Builder.CreateCall(Callee, {Src, Indices}); + } case WebAssembly::BI__builtin_wasm_extract_lane_s_i8x16: case WebAssembly::BI__builtin_wasm_extract_lane_u_i8x16: case WebAssembly::BI__builtin_wasm_extract_lane_s_i16x8: diff --git a/clang/test/CodeGen/builtins-wasm.c b/clang/test/CodeGen/builtins-wasm.c index ca407ebc0ed4f..436f47c7b4448 100644 --- a/clang/test/CodeGen/builtins-wasm.c +++ b/clang/test/CodeGen/builtins-wasm.c @@ -157,7 +157,6 @@ double max_f64(double x, double y) { // WEBASSEMBLY-NEXT: ret } - int extract_lane_s_i8x16(i8x16 v) { return __builtin_wasm_extract_lane_s_i8x16(v, 13); // MISSING-SIMD: error: '__builtin_wasm_extract_lane_s_i8x16' needs target feature simd128 @@ -539,3 +538,9 @@ i32x4 widen_high_u_i32x4_i16x8(i16x8 v) { // WEBASSEMBLY: call <4 x i32> @llvm.wasm.widen.high.unsigned.v4i32.v8i16(<8 x i16> %v) // WEBASSEMBLY: ret } + +i8x16 swizzle_v8x16(i8x16 x, i8x16 y) { + return __builtin_wasm_swizzle_v8x16(x, y); + // WEBASSEMBLY: call <16 x i8> @llvm.wasm.swizzle(<16 x i8> %x, <16 x i8> %y) + // WEBASSEMBLY-NEXT: ret +} diff --git a/llvm/include/llvm/IR/IntrinsicsWebAssembly.td b/llvm/include/llvm/IR/IntrinsicsWebAssembly.td index 6b5d0cbf799ab..ef5219b05bb49 100644 --- a/llvm/include/llvm/IR/IntrinsicsWebAssembly.td +++ b/llvm/include/llvm/IR/IntrinsicsWebAssembly.td @@ -89,6 +89,10 @@ def int_wasm_atomic_notify: // SIMD intrinsics //===----------------------------------------------------------------------===// +def int_wasm_swizzle : + Intrinsic<[llvm_v16i8_ty], + [llvm_v16i8_ty, llvm_v16i8_ty], + [IntrNoMem, IntrSpeculatable]>; def int_wasm_sub_saturate_signed : Intrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>, LLVMMatchType<0>], diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td index 16549f39b186e..fc5d73dac52ed 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td @@ -278,12 +278,16 @@ def : Pat<(vec_t (wasm_shuffle (vec_t V128:$x), (vec_t V128:$y), // Swizzle lanes: v8x16.swizzle def wasm_swizzle_t : SDTypeProfile<1, 2, []>; def wasm_swizzle : SDNode<"WebAssemblyISD::SWIZZLE", wasm_swizzle_t>; +let Predicates = [HasUnimplementedSIMD128] in defm SWIZZLE : SIMD_I<(outs V128:$dst), (ins V128:$src, V128:$mask), (outs), (ins), [(set (v16i8 V128:$dst), (wasm_swizzle (v16i8 V128:$src), (v16i8 V128:$mask)))], "v8x16.swizzle\t$dst, $src, $mask", "v8x16.swizzle", 192>; +def : Pat<(int_wasm_swizzle (v16i8 V128:$src), (v16i8 V128:$mask)), + (SWIZZLE V128:$src, V128:$mask)>; + // Create vector with identical lanes: splat def splat2 : PatFrag<(ops node:$x), (build_vector node:$x, node:$x)>; def splat4 : PatFrag<(ops node:$x), (build_vector diff --git a/llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll b/llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll index f88b8b454268c..6a901ee4dadb0 100644 --- a/llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll +++ b/llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll @@ -11,6 +11,16 @@ target triple = "wasm32-unknown-unknown" ; ============================================================================== ; 16 x i8 ; ============================================================================== +; CHECK-LABEL: swizzle_v16i8: +; SIMD128-NEXT: .functype swizzle_v16i8 (v128, v128) -> (v128){{$}} +; SIMD128-NEXT: v8x16.swizzle $push[[R:[0-9]+]]=, $0, $1{{$}} +; SIMD128-NEXT: return $pop[[R]]{{$}} +declare <16 x i8> @llvm.wasm.swizzle(<16 x i8>, <16 x i8>) +define <16 x i8> @swizzle_v16i8(<16 x i8> %x, <16 x i8> %y) { + %a = call <16 x i8> @llvm.wasm.swizzle(<16 x i8> %x, <16 x i8> %y) + ret <16 x i8> %a +} + ; CHECK-LABEL: add_sat_s_v16i8: ; SIMD128-NEXT: .functype add_sat_s_v16i8 (v128, v128) -> (v128){{$}} ; SIMD128-NEXT: i8x16.add_saturate_s $push[[R:[0-9]+]]=, $0, $1{{$}} From 0845ac7331e1e7af7ae4c104228f43a3f187b9c6 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 9 Oct 2019 17:52:26 +0000 Subject: [PATCH 22/44] [InstCombine] add another test for gep inbounds; NFC llvm-svn: 374190 --- llvm/test/Transforms/InstCombine/load-bitcast-vec.ll | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/llvm/test/Transforms/InstCombine/load-bitcast-vec.ll b/llvm/test/Transforms/InstCombine/load-bitcast-vec.ll index cb1b224e06091..4874f2f5f420f 100644 --- a/llvm/test/Transforms/InstCombine/load-bitcast-vec.ll +++ b/llvm/test/Transforms/InstCombine/load-bitcast-vec.ll @@ -89,6 +89,17 @@ define float @matching_scalar_smallest_deref_or_null(<4 x float>* dereferenceabl ret float %r } +define float @matching_scalar_smallest_deref_addrspace(<4 x float> addrspace(4)* dereferenceable(1) %p) { +; CHECK-LABEL: @matching_scalar_smallest_deref_addrspace( +; CHECK-NEXT: [[BC:%.*]] = getelementptr inbounds <4 x float>, <4 x float> addrspace(4)* [[P:%.*]], i64 0, i64 0 +; CHECK-NEXT: [[R:%.*]] = load float, float addrspace(4)* [[BC]], align 16 +; CHECK-NEXT: ret float [[R]] +; + %bc = bitcast <4 x float> addrspace(4)* %p to float addrspace(4)* + %r = load float, float addrspace(4)* %bc, align 16 + ret float %r +} + ; TODO: Is a null pointer inbounds in any address space? define float @matching_scalar_smallest_deref_or_null_addrspace(<4 x float> addrspace(4)* dereferenceable_or_null(1) %p) { From 4c4df441860c9c119ad063bbdd6b5fc11c2dc1d8 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 9 Oct 2019 17:57:59 +0000 Subject: [PATCH 23/44] [ARM] Fix arm_neon.h with -flax-vector-conversions=none Really, we were already 99% of the way there; just needed a couple minor fixes that affected 64-bit-only builtins. Based on D61717. Note that the change to builtin_str changes the type of a few __builtin_neon_* intrinsics that had the "wrong" type. Fixes https://bugs.llvm.org/show_bug.cgi?id=43341 Differential Revision: https://reviews.llvm.org/D68683 llvm-svn: 374191 --- clang/test/CodeGen/aarch64-neon-2velem.c | 16 +- clang/test/CodeGen/aarch64-neon-intrinsics.c | 33 --- clang/test/CodeGen/aarch64-neon-scalar-copy.c | 72 ++----- .../aarch64-neon-scalar-x-indexed-elem.c | 188 +++++------------- clang/test/CodeGen/aarch64-neon-vget.c | 144 ++++---------- clang/test/CodeGen/aarch64-poly64.c | 40 +--- .../CodeGen/aarch64-v8.2a-neon-intrinsics.c | 24 +-- clang/test/CodeGen/arm64-lanes.c | 72 +++---- clang/test/CodeGen/arm64_vcopy.c | 64 ++---- clang/test/CodeGen/arm_neon_intrinsics.c | 144 ++++---------- clang/test/Headers/arm-neon-header.c | 3 + clang/utils/TableGen/NeonEmitter.cpp | 4 +- 12 files changed, 201 insertions(+), 603 deletions(-) diff --git a/clang/test/CodeGen/aarch64-neon-2velem.c b/clang/test/CodeGen/aarch64-neon-2velem.c index 320ce0286bed5..d8eae760b4a8a 100644 --- a/clang/test/CodeGen/aarch64-neon-2velem.c +++ b/clang/test/CodeGen/aarch64-neon-2velem.c @@ -451,9 +451,7 @@ float64x2_t test_vfmsq_laneq_f64(float64x2_t a, float64x2_t b, float64x2_t v) { } // CHECK-LABEL: @test_vfmas_laneq_f32( -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %v to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[EXTRACT:%.*]] = extractelement <4 x float> [[TMP1]], i32 3 +// CHECK: [[EXTRACT:%.*]] = extractelement <4 x float> %v, i32 3 // CHECK: [[TMP2:%.*]] = call float @llvm.fma.f32(float %b, float [[EXTRACT]], float %a) // CHECK: ret float [[TMP2]] float32_t test_vfmas_laneq_f32(float32_t a, float32_t b, float32x4_t v) { @@ -462,9 +460,7 @@ float32_t test_vfmas_laneq_f32(float32_t a, float32_t b, float32x4_t v) { // CHECK-LABEL: @test_vfmsd_lane_f64( // CHECK: [[SUB:%.*]] = fsub double -0.000000e+00, %b -// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %v to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double> -// CHECK: [[EXTRACT:%.*]] = extractelement <1 x double> [[TMP1]], i32 0 +// CHECK: [[EXTRACT:%.*]] = extractelement <1 x double> %v, i32 0 // CHECK: [[TMP2:%.*]] = call double @llvm.fma.f64(double [[SUB]], double [[EXTRACT]], double %a) // CHECK: ret double [[TMP2]] float64_t test_vfmsd_lane_f64(float64_t a, float64_t b, float64x1_t v) { @@ -473,9 +469,7 @@ float64_t test_vfmsd_lane_f64(float64_t a, float64_t b, float64x1_t v) { // CHECK-LABEL: @test_vfmss_laneq_f32( // CHECK: [[SUB:%.*]] = fsub float -0.000000e+00, %b -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %v to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[EXTRACT:%.*]] = extractelement <4 x float> [[TMP1]], i32 3 +// CHECK: [[EXTRACT:%.*]] = extractelement <4 x float> %v, i32 3 // CHECK: [[TMP2:%.*]] = call float @llvm.fma.f32(float [[SUB]], float [[EXTRACT]], float %a) // CHECK: ret float [[TMP2]] float32_t test_vfmss_laneq_f32(float32_t a, float32_t b, float32x4_t v) { @@ -484,9 +478,7 @@ float32_t test_vfmss_laneq_f32(float32_t a, float32_t b, float32x4_t v) { // CHECK-LABEL: @test_vfmsd_laneq_f64( // CHECK: [[SUB:%.*]] = fsub double -0.000000e+00, %b -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %v to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double> -// CHECK: [[EXTRACT:%.*]] = extractelement <2 x double> [[TMP1]], i32 1 +// CHECK: [[EXTRACT:%.*]] = extractelement <2 x double> %v, i32 1 // CHECK: [[TMP2:%.*]] = call double @llvm.fma.f64(double [[SUB]], double [[EXTRACT]], double %a) // CHECK: ret double [[TMP2]] float64_t test_vfmsd_laneq_f64(float64_t a, float64_t b, float64x2_t v) { diff --git a/clang/test/CodeGen/aarch64-neon-intrinsics.c b/clang/test/CodeGen/aarch64-neon-intrinsics.c index 37f2a1c153495..2eddd03786a52 100644 --- a/clang/test/CodeGen/aarch64-neon-intrinsics.c +++ b/clang/test/CodeGen/aarch64-neon-intrinsics.c @@ -8703,7 +8703,6 @@ uint64_t test_vqrshld_u64(uint64_t a, uint64_t b) { } // CHECK-LABEL: @test_vpaddd_s64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> // CHECK: [[VPADDD_S64_I:%.*]] = call i64 @llvm.aarch64.neon.uaddv.i64.v2i64(<2 x i64> %a) // CHECK: ret i64 [[VPADDD_S64_I]] int64_t test_vpaddd_s64(int64x2_t a) { @@ -8711,7 +8710,6 @@ int64_t test_vpaddd_s64(int64x2_t a) { } // CHECK-LABEL: @test_vpadds_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[LANE0_I:%.*]] = extractelement <2 x float> %a, i64 0 // CHECK: [[LANE1_I:%.*]] = extractelement <2 x float> %a, i64 1 // CHECK: [[VPADDD_I:%.*]] = fadd float [[LANE0_I]], [[LANE1_I]] @@ -8721,7 +8719,6 @@ float32_t test_vpadds_f32(float32x2_t a) { } // CHECK-LABEL: @test_vpaddd_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[LANE0_I:%.*]] = extractelement <2 x double> %a, i64 0 // CHECK: [[LANE1_I:%.*]] = extractelement <2 x double> %a, i64 1 // CHECK: [[VPADDD_I:%.*]] = fadd double [[LANE0_I]], [[LANE1_I]] @@ -8731,7 +8728,6 @@ float64_t test_vpaddd_f64(float64x2_t a) { } // CHECK-LABEL: @test_vpmaxnms_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[VPMAXNMS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxnmv.f32.v2f32(<2 x float> %a) // CHECK: ret float [[VPMAXNMS_F32_I]] float32_t test_vpmaxnms_f32(float32x2_t a) { @@ -8739,7 +8735,6 @@ float32_t test_vpmaxnms_f32(float32x2_t a) { } // CHECK-LABEL: @test_vpmaxnmqd_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[VPMAXNMQD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxnmv.f64.v2f64(<2 x double> %a) // CHECK: ret double [[VPMAXNMQD_F64_I]] float64_t test_vpmaxnmqd_f64(float64x2_t a) { @@ -8747,7 +8742,6 @@ float64_t test_vpmaxnmqd_f64(float64x2_t a) { } // CHECK-LABEL: @test_vpmaxs_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[VPMAXS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxv.f32.v2f32(<2 x float> %a) // CHECK: ret float [[VPMAXS_F32_I]] float32_t test_vpmaxs_f32(float32x2_t a) { @@ -8755,7 +8749,6 @@ float32_t test_vpmaxs_f32(float32x2_t a) { } // CHECK-LABEL: @test_vpmaxqd_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[VPMAXQD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxv.f64.v2f64(<2 x double> %a) // CHECK: ret double [[VPMAXQD_F64_I]] float64_t test_vpmaxqd_f64(float64x2_t a) { @@ -8763,7 +8756,6 @@ float64_t test_vpmaxqd_f64(float64x2_t a) { } // CHECK-LABEL: @test_vpminnms_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[VPMINNMS_F32_I:%.*]] = call float @llvm.aarch64.neon.fminnmv.f32.v2f32(<2 x float> %a) // CHECK: ret float [[VPMINNMS_F32_I]] float32_t test_vpminnms_f32(float32x2_t a) { @@ -8771,7 +8763,6 @@ float32_t test_vpminnms_f32(float32x2_t a) { } // CHECK-LABEL: @test_vpminnmqd_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[VPMINNMQD_F64_I:%.*]] = call double @llvm.aarch64.neon.fminnmv.f64.v2f64(<2 x double> %a) // CHECK: ret double [[VPMINNMQD_F64_I]] float64_t test_vpminnmqd_f64(float64x2_t a) { @@ -8779,7 +8770,6 @@ float64_t test_vpminnmqd_f64(float64x2_t a) { } // CHECK-LABEL: @test_vpmins_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[VPMINS_F32_I:%.*]] = call float @llvm.aarch64.neon.fminv.f32.v2f32(<2 x float> %a) // CHECK: ret float [[VPMINS_F32_I]] float32_t test_vpmins_f32(float32x2_t a) { @@ -8787,7 +8777,6 @@ float32_t test_vpmins_f32(float32x2_t a) { } // CHECK-LABEL: @test_vpminqd_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[VPMINQD_F64_I:%.*]] = call double @llvm.aarch64.neon.fminv.f64.v2f64(<2 x double> %a) // CHECK: ret double [[VPMINQD_F64_I]] float64_t test_vpminqd_f64(float64x2_t a) { @@ -17690,7 +17679,6 @@ int64x1_t test_vneg_s64(int64x1_t a) { } // CHECK-LABEL: @test_vaddv_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[VADDV_F32_I:%.*]] = call float @llvm.aarch64.neon.faddv.f32.v2f32(<2 x float> %a) // CHECK: ret float [[VADDV_F32_I]] float32_t test_vaddv_f32(float32x2_t a) { @@ -17698,7 +17686,6 @@ float32_t test_vaddv_f32(float32x2_t a) { } // CHECK-LABEL: @test_vaddvq_f32( -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8> // CHECK: [[VADDVQ_F32_I:%.*]] = call float @llvm.aarch64.neon.faddv.f32.v4f32(<4 x float> %a) // CHECK: ret float [[VADDVQ_F32_I]] float32_t test_vaddvq_f32(float32x4_t a) { @@ -17706,7 +17693,6 @@ float32_t test_vaddvq_f32(float32x4_t a) { } // CHECK-LABEL: @test_vaddvq_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[VADDVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.faddv.f64.v2f64(<2 x double> %a) // CHECK: ret double [[VADDVQ_F64_I]] float64_t test_vaddvq_f64(float64x2_t a) { @@ -17714,7 +17700,6 @@ float64_t test_vaddvq_f64(float64x2_t a) { } // CHECK-LABEL: @test_vmaxv_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[VMAXV_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxv.f32.v2f32(<2 x float> %a) // CHECK: ret float [[VMAXV_F32_I]] float32_t test_vmaxv_f32(float32x2_t a) { @@ -17722,7 +17707,6 @@ float32_t test_vmaxv_f32(float32x2_t a) { } // CHECK-LABEL: @test_vmaxvq_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[VMAXVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxv.f64.v2f64(<2 x double> %a) // CHECK: ret double [[VMAXVQ_F64_I]] float64_t test_vmaxvq_f64(float64x2_t a) { @@ -17730,7 +17714,6 @@ float64_t test_vmaxvq_f64(float64x2_t a) { } // CHECK-LABEL: @test_vminv_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[VMINV_F32_I:%.*]] = call float @llvm.aarch64.neon.fminv.f32.v2f32(<2 x float> %a) // CHECK: ret float [[VMINV_F32_I]] float32_t test_vminv_f32(float32x2_t a) { @@ -17738,7 +17721,6 @@ float32_t test_vminv_f32(float32x2_t a) { } // CHECK-LABEL: @test_vminvq_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[VMINVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fminv.f64.v2f64(<2 x double> %a) // CHECK: ret double [[VMINVQ_F64_I]] float64_t test_vminvq_f64(float64x2_t a) { @@ -17746,7 +17728,6 @@ float64_t test_vminvq_f64(float64x2_t a) { } // CHECK-LABEL: @test_vmaxnmvq_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[VMAXNMVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fmaxnmv.f64.v2f64(<2 x double> %a) // CHECK: ret double [[VMAXNMVQ_F64_I]] float64_t test_vmaxnmvq_f64(float64x2_t a) { @@ -17754,7 +17735,6 @@ float64_t test_vmaxnmvq_f64(float64x2_t a) { } // CHECK-LABEL: @test_vmaxnmv_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[VMAXNMV_F32_I:%.*]] = call float @llvm.aarch64.neon.fmaxnmv.f32.v2f32(<2 x float> %a) // CHECK: ret float [[VMAXNMV_F32_I]] float32_t test_vmaxnmv_f32(float32x2_t a) { @@ -17762,7 +17742,6 @@ float32_t test_vmaxnmv_f32(float32x2_t a) { } // CHECK-LABEL: @test_vminnmvq_f64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> // CHECK: [[VMINNMVQ_F64_I:%.*]] = call double @llvm.aarch64.neon.fminnmv.f64.v2f64(<2 x double> %a) // CHECK: ret double [[VMINNMVQ_F64_I]] float64_t test_vminnmvq_f64(float64x2_t a) { @@ -17770,7 +17749,6 @@ float64_t test_vminnmvq_f64(float64x2_t a) { } // CHECK-LABEL: @test_vminnmv_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> // CHECK: [[VMINNMV_F32_I:%.*]] = call float @llvm.aarch64.neon.fminnmv.f32.v2f32(<2 x float> %a) // CHECK: ret float [[VMINNMV_F32_I]] float32_t test_vminnmv_f32(float32x2_t a) { @@ -17798,7 +17776,6 @@ uint64x2_t test_vpaddq_u64(uint64x2_t a, uint64x2_t b) { } // CHECK-LABEL: @test_vpaddd_u64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> // CHECK: [[VPADDD_U64_I:%.*]] = call i64 @llvm.aarch64.neon.uaddv.i64.v2i64(<2 x i64> %a) // CHECK: ret i64 [[VPADDD_U64_I]] uint64_t test_vpaddd_u64(uint64x2_t a) { @@ -17806,7 +17783,6 @@ uint64_t test_vpaddd_u64(uint64x2_t a) { } // CHECK-LABEL: @test_vaddvq_s64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> // CHECK: [[VADDVQ_S64_I:%.*]] = call i64 @llvm.aarch64.neon.saddv.i64.v2i64(<2 x i64> %a) // CHECK: ret i64 [[VADDVQ_S64_I]] int64_t test_vaddvq_s64(int64x2_t a) { @@ -17814,7 +17790,6 @@ int64_t test_vaddvq_s64(int64x2_t a) { } // CHECK-LABEL: @test_vaddvq_u64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> // CHECK: [[VADDVQ_U64_I:%.*]] = call i64 @llvm.aarch64.neon.uaddv.i64.v2i64(<2 x i64> %a) // CHECK: ret i64 [[VADDVQ_U64_I]] uint64_t test_vaddvq_u64(uint64x2_t a) { @@ -18178,7 +18153,6 @@ float64x1_t test_vrsqrts_f64(float64x1_t a, float64x1_t b) { } // CHECK-LABEL: @test_vminv_s32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> // CHECK: [[VMINV_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sminv.i32.v2i32(<2 x i32> %a) // CHECK: ret i32 [[VMINV_S32_I]] int32_t test_vminv_s32(int32x2_t a) { @@ -18186,7 +18160,6 @@ int32_t test_vminv_s32(int32x2_t a) { } // CHECK-LABEL: @test_vminv_u32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> // CHECK: [[VMINV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uminv.i32.v2i32(<2 x i32> %a) // CHECK: ret i32 [[VMINV_U32_I]] uint32_t test_vminv_u32(uint32x2_t a) { @@ -18194,7 +18167,6 @@ uint32_t test_vminv_u32(uint32x2_t a) { } // CHECK-LABEL: @test_vmaxv_s32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> // CHECK: [[VMAXV_S32_I:%.*]] = call i32 @llvm.aarch64.neon.smaxv.i32.v2i32(<2 x i32> %a) // CHECK: ret i32 [[VMAXV_S32_I]] int32_t test_vmaxv_s32(int32x2_t a) { @@ -18202,7 +18174,6 @@ int32_t test_vmaxv_s32(int32x2_t a) { } // CHECK-LABEL: @test_vmaxv_u32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> // CHECK: [[VMAXV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.umaxv.i32.v2i32(<2 x i32> %a) // CHECK: ret i32 [[VMAXV_U32_I]] uint32_t test_vmaxv_u32(uint32x2_t a) { @@ -18210,7 +18181,6 @@ uint32_t test_vmaxv_u32(uint32x2_t a) { } // CHECK-LABEL: @test_vaddv_s32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> // CHECK: [[VADDV_S32_I:%.*]] = call i32 @llvm.aarch64.neon.saddv.i32.v2i32(<2 x i32> %a) // CHECK: ret i32 [[VADDV_S32_I]] int32_t test_vaddv_s32(int32x2_t a) { @@ -18218,7 +18188,6 @@ int32_t test_vaddv_s32(int32x2_t a) { } // CHECK-LABEL: @test_vaddv_u32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> // CHECK: [[VADDV_U32_I:%.*]] = call i32 @llvm.aarch64.neon.uaddv.i32.v2i32(<2 x i32> %a) // CHECK: ret i32 [[VADDV_U32_I]] uint32_t test_vaddv_u32(uint32x2_t a) { @@ -18226,7 +18195,6 @@ uint32_t test_vaddv_u32(uint32x2_t a) { } // CHECK-LABEL: @test_vaddlv_s32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> // CHECK: [[VADDLV_S32_I:%.*]] = call i64 @llvm.aarch64.neon.saddlv.i64.v2i32(<2 x i32> %a) // CHECK: ret i64 [[VADDLV_S32_I]] int64_t test_vaddlv_s32(int32x2_t a) { @@ -18234,7 +18202,6 @@ int64_t test_vaddlv_s32(int32x2_t a) { } // CHECK-LABEL: @test_vaddlv_u32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> // CHECK: [[VADDLV_U32_I:%.*]] = call i64 @llvm.aarch64.neon.uaddlv.i64.v2i32(<2 x i32> %a) // CHECK: ret i64 [[VADDLV_U32_I]] uint64_t test_vaddlv_u32(uint32x2_t a) { diff --git a/clang/test/CodeGen/aarch64-neon-scalar-copy.c b/clang/test/CodeGen/aarch64-neon-scalar-copy.c index d7daf82998e25..ef7ce9ca8ceea 100644 --- a/clang/test/CodeGen/aarch64-neon-scalar-copy.c +++ b/clang/test/CodeGen/aarch64-neon-scalar-copy.c @@ -4,9 +4,7 @@ #include // CHECK-LABEL: define float @test_vdups_lane_f32(<2 x float> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> -// CHECK: [[VDUPS_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1 +// CHECK: [[VDUPS_LANE:%.*]] = extractelement <2 x float> %a, i32 1 // CHECK: ret float [[VDUPS_LANE]] float32_t test_vdups_lane_f32(float32x2_t a) { return vdups_lane_f32(a, 1); @@ -14,9 +12,7 @@ float32_t test_vdups_lane_f32(float32x2_t a) { // CHECK-LABEL: define double @test_vdupd_lane_f64(<1 x double> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double> -// CHECK: [[VDUPD_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0 +// CHECK: [[VDUPD_LANE:%.*]] = extractelement <1 x double> %a, i32 0 // CHECK: ret double [[VDUPD_LANE]] float64_t test_vdupd_lane_f64(float64x1_t a) { return vdupd_lane_f64(a, 0); @@ -24,9 +20,7 @@ float64_t test_vdupd_lane_f64(float64x1_t a) { // CHECK-LABEL: define float @test_vdups_laneq_f32(<4 x float> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %a, i32 3 // CHECK: ret float [[VGETQ_LANE]] float32_t test_vdups_laneq_f32(float32x4_t a) { return vdups_laneq_f32(a, 3); @@ -34,9 +28,7 @@ float32_t test_vdups_laneq_f32(float32x4_t a) { // CHECK-LABEL: define double @test_vdupd_laneq_f64(<2 x double> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP1]], i32 1 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %a, i32 1 // CHECK: ret double [[VGETQ_LANE]] float64_t test_vdupd_laneq_f64(float64x2_t a) { return vdupd_laneq_f64(a, 1); @@ -52,9 +44,7 @@ int8_t test_vdupb_lane_s8(int8x8_t a) { // CHECK-LABEL: define i16 @test_vduph_lane_s16(<4 x i16> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3 // CHECK: ret i16 [[VGET_LANE]] int16_t test_vduph_lane_s16(int16x4_t a) { return vduph_lane_s16(a, 3); @@ -62,9 +52,7 @@ int16_t test_vduph_lane_s16(int16x4_t a) { // CHECK-LABEL: define i32 @test_vdups_lane_s32(<2 x i32> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1 // CHECK: ret i32 [[VGET_LANE]] int32_t test_vdups_lane_s32(int32x2_t a) { return vdups_lane_s32(a, 1); @@ -72,9 +60,7 @@ int32_t test_vdups_lane_s32(int32x2_t a) { // CHECK-LABEL: define i64 @test_vdupd_lane_s64(<1 x i64> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0 // CHECK: ret i64 [[VGET_LANE]] int64_t test_vdupd_lane_s64(int64x1_t a) { return vdupd_lane_s64(a, 0); @@ -90,9 +76,7 @@ uint8_t test_vdupb_lane_u8(uint8x8_t a) { // CHECK-LABEL: define i16 @test_vduph_lane_u16(<4 x i16> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3 // CHECK: ret i16 [[VGET_LANE]] uint16_t test_vduph_lane_u16(uint16x4_t a) { return vduph_lane_u16(a, 3); @@ -100,9 +84,7 @@ uint16_t test_vduph_lane_u16(uint16x4_t a) { // CHECK-LABEL: define i32 @test_vdups_lane_u32(<2 x i32> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1 // CHECK: ret i32 [[VGET_LANE]] uint32_t test_vdups_lane_u32(uint32x2_t a) { return vdups_lane_u32(a, 1); @@ -110,9 +92,7 @@ uint32_t test_vdups_lane_u32(uint32x2_t a) { // CHECK-LABEL: define i64 @test_vdupd_lane_u64(<1 x i64> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0 // CHECK: ret i64 [[VGET_LANE]] uint64_t test_vdupd_lane_u64(uint64x1_t a) { return vdupd_lane_u64(a, 0); @@ -127,9 +107,7 @@ int8_t test_vdupb_laneq_s8(int8x16_t a) { // CHECK-LABEL: define i16 @test_vduph_laneq_s16(<8 x i16> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7 // CHECK: ret i16 [[VGETQ_LANE]] int16_t test_vduph_laneq_s16(int16x8_t a) { return vduph_laneq_s16(a, 7); @@ -137,9 +115,7 @@ int16_t test_vduph_laneq_s16(int16x8_t a) { // CHECK-LABEL: define i32 @test_vdups_laneq_s32(<4 x i32> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a, i32 3 // CHECK: ret i32 [[VGETQ_LANE]] int32_t test_vdups_laneq_s32(int32x4_t a) { return vdups_laneq_s32(a, 3); @@ -147,9 +123,7 @@ int32_t test_vdups_laneq_s32(int32x4_t a) { // CHECK-LABEL: define i64 @test_vdupd_laneq_s64(<2 x i64> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a, i32 1 // CHECK: ret i64 [[VGETQ_LANE]] int64_t test_vdupd_laneq_s64(int64x2_t a) { return vdupd_laneq_s64(a, 1); @@ -165,9 +139,7 @@ uint8_t test_vdupb_laneq_u8(uint8x16_t a) { // CHECK-LABEL: define i16 @test_vduph_laneq_u16(<8 x i16> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7 // CHECK: ret i16 [[VGETQ_LANE]] uint16_t test_vduph_laneq_u16(uint16x8_t a) { return vduph_laneq_u16(a, 7); @@ -175,9 +147,7 @@ uint16_t test_vduph_laneq_u16(uint16x8_t a) { // CHECK-LABEL: define i32 @test_vdups_laneq_u32(<4 x i32> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a, i32 3 // CHECK: ret i32 [[VGETQ_LANE]] uint32_t test_vdups_laneq_u32(uint32x4_t a) { return vdups_laneq_u32(a, 3); @@ -185,9 +155,7 @@ uint32_t test_vdups_laneq_u32(uint32x4_t a) { // CHECK-LABEL: define i64 @test_vdupd_laneq_u64(<2 x i64> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a, i32 1 // CHECK: ret i64 [[VGETQ_LANE]] uint64_t test_vdupd_laneq_u64(uint64x2_t a) { return vdupd_laneq_u64(a, 1); @@ -201,9 +169,7 @@ poly8_t test_vdupb_lane_p8(poly8x8_t a) { } // CHECK-LABEL: define i16 @test_vduph_lane_p16(<4 x i16> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3 // CHECK: ret i16 [[VGET_LANE]] poly16_t test_vduph_lane_p16(poly16x4_t a) { return vduph_lane_p16(a, 3); @@ -217,9 +183,7 @@ poly8_t test_vdupb_laneq_p8(poly8x16_t a) { } // CHECK-LABEL: define i16 @test_vduph_laneq_p16(<8 x i16> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7 // CHECK: ret i16 [[VGETQ_LANE]] poly16_t test_vduph_laneq_p16(poly16x8_t a) { return vduph_laneq_p16(a, 7); diff --git a/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c b/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c index 88ab0c50ba2d9..5ec2555055b2f 100644 --- a/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c +++ b/clang/test/CodeGen/aarch64-neon-scalar-x-indexed-elem.c @@ -7,9 +7,7 @@ // CHECK-LABEL: define float @test_vmuls_lane_f32(float %a, <2 x float> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> %b, i32 1 // CHECK: [[MUL:%.*]] = fmul float %a, [[VGET_LANE]] // CHECK: ret float [[MUL]] float32_t test_vmuls_lane_f32(float32_t a, float32x2_t b) { @@ -17,9 +15,7 @@ float32_t test_vmuls_lane_f32(float32_t a, float32x2_t b) { } // CHECK-LABEL: define double @test_vmuld_lane_f64(double %a, <1 x double> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %b, i32 0 // CHECK: [[MUL:%.*]] = fmul double %a, [[VGET_LANE]] // CHECK: ret double [[MUL]] float64_t test_vmuld_lane_f64(float64_t a, float64x1_t b) { @@ -27,9 +23,7 @@ float64_t test_vmuld_lane_f64(float64_t a, float64x1_t b) { } // CHECK-LABEL: define float @test_vmuls_laneq_f32(float %a, <4 x float> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %b, i32 3 // CHECK: [[MUL:%.*]] = fmul float %a, [[VGETQ_LANE]] // CHECK: ret float [[MUL]] float32_t test_vmuls_laneq_f32(float32_t a, float32x4_t b) { @@ -37,9 +31,7 @@ float32_t test_vmuls_laneq_f32(float32_t a, float32x4_t b) { } // CHECK-LABEL: define double @test_vmuld_laneq_f64(double %a, <2 x double> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP1]], i32 1 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 1 // CHECK: [[MUL:%.*]] = fmul double %a, [[VGETQ_LANE]] // CHECK: ret double [[MUL]] float64_t test_vmuld_laneq_f64(float64_t a, float64x2_t b) { @@ -56,9 +48,7 @@ float64x1_t test_vmul_n_f64(float64x1_t a, float64_t b) { } // CHECK-LABEL: define float @test_vmulxs_lane_f32(float %a, <2 x float> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> %b, i32 1 // CHECK: [[VMULXS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmulx.f32(float %a, float [[VGET_LANE]]) // CHECK: ret float [[VMULXS_F32_I]] float32_t test_vmulxs_lane_f32(float32_t a, float32x2_t b) { @@ -66,9 +56,7 @@ float32_t test_vmulxs_lane_f32(float32_t a, float32x2_t b) { } // CHECK-LABEL: define float @test_vmulxs_laneq_f32(float %a, <4 x float> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %b, i32 3 // CHECK: [[VMULXS_F32_I:%.*]] = call float @llvm.aarch64.neon.fmulx.f32(float %a, float [[VGETQ_LANE]]) // CHECK: ret float [[VMULXS_F32_I]] float32_t test_vmulxs_laneq_f32(float32_t a, float32x4_t b) { @@ -76,9 +64,7 @@ float32_t test_vmulxs_laneq_f32(float32_t a, float32x4_t b) { } // CHECK-LABEL: define double @test_vmulxd_lane_f64(double %a, <1 x double> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %b, i32 0 // CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double %a, double [[VGET_LANE]]) // CHECK: ret double [[VMULXD_F64_I]] float64_t test_vmulxd_lane_f64(float64_t a, float64x1_t b) { @@ -86,9 +72,7 @@ float64_t test_vmulxd_lane_f64(float64_t a, float64x1_t b) { } // CHECK-LABEL: define double @test_vmulxd_laneq_f64(double %a, <2 x double> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP1]], i32 1 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 1 // CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double %a, double [[VGETQ_LANE]]) // CHECK: ret double [[VMULXD_F64_I]] float64_t test_vmulxd_laneq_f64(float64_t a, float64x2_t b) { @@ -96,16 +80,10 @@ float64_t test_vmulxd_laneq_f64(float64_t a, float64x2_t b) { } // CHECK-LABEL: define <1 x double> @test_vmulx_lane_f64(<1 x double> %a, <1 x double> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0 -// CHECK: [[TMP2:%.*]] = bitcast <1 x double> %b to <8 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x double> -// CHECK: [[VGET_LANE6:%.*]] = extractelement <1 x double> [[TMP3]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %a, i32 0 +// CHECK: [[VGET_LANE6:%.*]] = extractelement <1 x double> %b, i32 0 // CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGET_LANE6]]) -// CHECK: [[TMP4:%.*]] = bitcast <1 x double> %a to <8 x i8> -// CHECK: [[TMP5:%.*]] = bitcast <8 x i8> [[TMP4]] to <1 x double> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP5]], double [[VMULXD_F64_I]], i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> %a, double [[VMULXD_F64_I]], i32 0 // CHECK: ret <1 x double> [[VSET_LANE]] float64x1_t test_vmulx_lane_f64(float64x1_t a, float64x1_t b) { return vmulx_lane_f64(a, b, 0); @@ -113,32 +91,20 @@ float64x1_t test_vmulx_lane_f64(float64x1_t a, float64x1_t b) { // CHECK-LABEL: define <1 x double> @test_vmulx_laneq_f64_0(<1 x double> %a, <2 x double> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0 -// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %b to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP3]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %a, i32 0 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 0 // CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGETQ_LANE]]) -// CHECK: [[TMP4:%.*]] = bitcast <1 x double> %a to <8 x i8> -// CHECK: [[TMP5:%.*]] = bitcast <8 x i8> [[TMP4]] to <1 x double> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP5]], double [[VMULXD_F64_I]], i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> %a, double [[VMULXD_F64_I]], i32 0 // CHECK: ret <1 x double> [[VSET_LANE]] float64x1_t test_vmulx_laneq_f64_0(float64x1_t a, float64x2_t b) { return vmulx_laneq_f64(a, b, 0); } // CHECK-LABEL: define <1 x double> @test_vmulx_laneq_f64_1(<1 x double> %a, <2 x double> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP1]], i32 0 -// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %b to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP3]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> %a, i32 0 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %b, i32 1 // CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGETQ_LANE]]) -// CHECK: [[TMP4:%.*]] = bitcast <1 x double> %a to <8 x i8> -// CHECK: [[TMP5:%.*]] = bitcast <8 x i8> [[TMP4]] to <1 x double> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP5]], double [[VMULXD_F64_I]], i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> %a, double [[VMULXD_F64_I]], i32 0 // CHECK: ret <1 x double> [[VSET_LANE]] float64x1_t test_vmulx_laneq_f64_1(float64x1_t a, float64x2_t b) { return vmulx_laneq_f64(a, b, 1); @@ -146,9 +112,7 @@ float64x1_t test_vmulx_laneq_f64_1(float64x1_t a, float64x2_t b) { // CHECK-LABEL: define float @test_vfmas_lane_f32(float %a, float %b, <2 x float> %c) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %c to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> -// CHECK: [[EXTRACT:%.*]] = extractelement <2 x float> [[TMP1]], i32 1 +// CHECK: [[EXTRACT:%.*]] = extractelement <2 x float> %c, i32 1 // CHECK: [[TMP2:%.*]] = call float @llvm.fma.f32(float %b, float [[EXTRACT]], float %a) // CHECK: ret float [[TMP2]] float32_t test_vfmas_lane_f32(float32_t a, float32_t b, float32x2_t c) { @@ -156,9 +120,7 @@ float32_t test_vfmas_lane_f32(float32_t a, float32_t b, float32x2_t c) { } // CHECK-LABEL: define double @test_vfmad_lane_f64(double %a, double %b, <1 x double> %c) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x double> %c to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x double> -// CHECK: [[EXTRACT:%.*]] = extractelement <1 x double> [[TMP1]], i32 0 +// CHECK: [[EXTRACT:%.*]] = extractelement <1 x double> %c, i32 0 // CHECK: [[TMP2:%.*]] = call double @llvm.fma.f64(double %b, double [[EXTRACT]], double %a) // CHECK: ret double [[TMP2]] float64_t test_vfmad_lane_f64(float64_t a, float64_t b, float64x1_t c) { @@ -166,9 +128,7 @@ float64_t test_vfmad_lane_f64(float64_t a, float64_t b, float64x1_t c) { } // CHECK-LABEL: define double @test_vfmad_laneq_f64(double %a, double %b, <2 x double> %c) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %c to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double> -// CHECK: [[EXTRACT:%.*]] = extractelement <2 x double> [[TMP1]], i32 1 +// CHECK: [[EXTRACT:%.*]] = extractelement <2 x double> %c, i32 1 // CHECK: [[TMP2:%.*]] = call double @llvm.fma.f64(double %b, double [[EXTRACT]], double %a) // CHECK: ret double [[TMP2]] float64_t test_vfmad_laneq_f64(float64_t a, float64_t b, float64x2_t c) { @@ -177,9 +137,7 @@ float64_t test_vfmad_laneq_f64(float64_t a, float64_t b, float64x2_t c) { // CHECK-LABEL: define float @test_vfmss_lane_f32(float %a, float %b, <2 x float> %c) #0 { // CHECK: [[SUB:%.*]] = fsub float -0.000000e+00, %b -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %c to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> -// CHECK: [[EXTRACT:%.*]] = extractelement <2 x float> [[TMP1]], i32 1 +// CHECK: [[EXTRACT:%.*]] = extractelement <2 x float> %c, i32 1 // CHECK: [[TMP2:%.*]] = call float @llvm.fma.f32(float [[SUB]], float [[EXTRACT]], float %a) // CHECK: ret float [[TMP2]] float32_t test_vfmss_lane_f32(float32_t a, float32_t b, float32x2_t c) { @@ -247,9 +205,7 @@ float64x1_t test_vfms_laneq_f64(float64x1_t a, float64x1_t b, float64x2_t v) { } // CHECK-LABEL: define i32 @test_vqdmullh_lane_s16(i16 %a, <4 x i16> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %b, i32 3 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGET_LANE]], i64 0 // CHECK: [[VQDMULLH_S16_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -260,9 +216,7 @@ int32_t test_vqdmullh_lane_s16(int16_t a, int16x4_t b) { } // CHECK-LABEL: define i64 @test_vqdmulls_lane_s32(i32 %a, <2 x i32> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %b, i32 1 // CHECK: [[VQDMULLS_S32_I:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %a, i32 [[VGET_LANE]]) // CHECK: ret i64 [[VQDMULLS_S32_I]] int64_t test_vqdmulls_lane_s32(int32_t a, int32x2_t b) { @@ -270,9 +224,7 @@ int64_t test_vqdmulls_lane_s32(int32_t a, int32x2_t b) { } // CHECK-LABEL: define i32 @test_vqdmullh_laneq_s16(i16 %a, <8 x i16> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %b, i32 7 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGETQ_LANE]], i64 0 // CHECK: [[VQDMULLH_S16_I:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -283,9 +235,7 @@ int32_t test_vqdmullh_laneq_s16(int16_t a, int16x8_t b) { } // CHECK-LABEL: define i64 @test_vqdmulls_laneq_s32(i32 %a, <4 x i32> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %b, i32 3 // CHECK: [[VQDMULLS_S32_I:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %a, i32 [[VGETQ_LANE]]) // CHECK: ret i64 [[VQDMULLS_S32_I]] int64_t test_vqdmulls_laneq_s32(int32_t a, int32x4_t b) { @@ -293,9 +243,7 @@ int64_t test_vqdmulls_laneq_s32(int32_t a, int32x4_t b) { } // CHECK-LABEL: define i16 @test_vqdmulhh_lane_s16(i16 %a, <4 x i16> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %b, i32 3 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGET_LANE]], i64 0 // CHECK: [[VQDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -306,9 +254,7 @@ int16_t test_vqdmulhh_lane_s16(int16_t a, int16x4_t b) { } // CHECK-LABEL: define i32 @test_vqdmulhs_lane_s32(i32 %a, <2 x i32> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %b, i32 1 // CHECK: [[VQDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqdmulh.i32(i32 %a, i32 [[VGET_LANE]]) // CHECK: ret i32 [[VQDMULHS_S32_I]] int32_t test_vqdmulhs_lane_s32(int32_t a, int32x2_t b) { @@ -317,9 +263,7 @@ int32_t test_vqdmulhs_lane_s32(int32_t a, int32x2_t b) { // CHECK-LABEL: define i16 @test_vqdmulhh_laneq_s16(i16 %a, <8 x i16> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %b, i32 7 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGETQ_LANE]], i64 0 // CHECK: [[VQDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -331,9 +275,7 @@ int16_t test_vqdmulhh_laneq_s16(int16_t a, int16x8_t b) { // CHECK-LABEL: define i32 @test_vqdmulhs_laneq_s32(i32 %a, <4 x i32> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %b, i32 3 // CHECK: [[VQDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqdmulh.i32(i32 %a, i32 [[VGETQ_LANE]]) // CHECK: ret i32 [[VQDMULHS_S32_I]] int32_t test_vqdmulhs_laneq_s32(int32_t a, int32x4_t b) { @@ -341,9 +283,7 @@ int32_t test_vqdmulhs_laneq_s32(int32_t a, int32x4_t b) { } // CHECK-LABEL: define i16 @test_vqrdmulhh_lane_s16(i16 %a, <4 x i16> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %b, i32 3 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGET_LANE]], i64 0 // CHECK: [[VQRDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -354,9 +294,7 @@ int16_t test_vqrdmulhh_lane_s16(int16_t a, int16x4_t b) { } // CHECK-LABEL: define i32 @test_vqrdmulhs_lane_s32(i32 %a, <2 x i32> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %b, i32 1 // CHECK: [[VQRDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqrdmulh.i32(i32 %a, i32 [[VGET_LANE]]) // CHECK: ret i32 [[VQRDMULHS_S32_I]] int32_t test_vqrdmulhs_lane_s32(int32_t a, int32x2_t b) { @@ -365,9 +303,7 @@ int32_t test_vqrdmulhs_lane_s32(int32_t a, int32x2_t b) { // CHECK-LABEL: define i16 @test_vqrdmulhh_laneq_s16(i16 %a, <8 x i16> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %b, i32 7 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %a, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[VGETQ_LANE]], i64 0 // CHECK: [[VQRDMULHH_S16_I:%.*]] = call <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -379,9 +315,7 @@ int16_t test_vqrdmulhh_laneq_s16(int16_t a, int16x8_t b) { // CHECK-LABEL: define i32 @test_vqrdmulhs_laneq_s32(i32 %a, <4 x i32> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %b, i32 3 // CHECK: [[VQRDMULHS_S32_I:%.*]] = call i32 @llvm.aarch64.neon.sqrdmulh.i32(i32 %a, i32 [[VGETQ_LANE]]) // CHECK: ret i32 [[VQRDMULHS_S32_I]] int32_t test_vqrdmulhs_laneq_s32(int32_t a, int32x4_t b) { @@ -389,9 +323,7 @@ int32_t test_vqrdmulhs_laneq_s32(int32_t a, int32x4_t b) { } // CHECK-LABEL: define i32 @test_vqdmlalh_lane_s16(i32 %a, i16 %b, <4 x i16> %c) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %c to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[LANE:%.*]] = extractelement <4 x i16> %c, i32 3 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %b, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[LANE]], i64 0 // CHECK: [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -403,9 +335,7 @@ int32_t test_vqdmlalh_lane_s16(int32_t a, int16_t b, int16x4_t c) { } // CHECK-LABEL: define i64 @test_vqdmlals_lane_s32(i64 %a, i32 %b, <2 x i32> %c) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %c to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[LANE:%.*]] = extractelement <2 x i32> %c, i32 1 // CHECK: [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]]) // CHECK: [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqadd.i64(i64 %a, i64 [[VQDMLXL]]) // CHECK: ret i64 [[VQDMLXL1]] @@ -414,9 +344,7 @@ int64_t test_vqdmlals_lane_s32(int64_t a, int32_t b, int32x2_t c) { } // CHECK-LABEL: define i32 @test_vqdmlalh_laneq_s16(i32 %a, i16 %b, <8 x i16> %c) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %c to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[LANE:%.*]] = extractelement <8 x i16> %c, i32 7 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %b, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[LANE]], i64 0 // CHECK: [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -428,9 +356,7 @@ int32_t test_vqdmlalh_laneq_s16(int32_t a, int16_t b, int16x8_t c) { } // CHECK-LABEL: define i64 @test_vqdmlals_laneq_s32(i64 %a, i32 %b, <4 x i32> %c) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %c to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[LANE:%.*]] = extractelement <4 x i32> %c, i32 3 // CHECK: [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]]) // CHECK: [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqadd.i64(i64 %a, i64 [[VQDMLXL]]) // CHECK: ret i64 [[VQDMLXL1]] @@ -439,9 +365,7 @@ int64_t test_vqdmlals_laneq_s32(int64_t a, int32_t b, int32x4_t c) { } // CHECK-LABEL: define i32 @test_vqdmlslh_lane_s16(i32 %a, i16 %b, <4 x i16> %c) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %c to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[LANE:%.*]] = extractelement <4 x i16> %c, i32 3 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %b, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[LANE]], i64 0 // CHECK: [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -453,9 +377,7 @@ int32_t test_vqdmlslh_lane_s16(int32_t a, int16_t b, int16x4_t c) { } // CHECK-LABEL: define i64 @test_vqdmlsls_lane_s32(i64 %a, i32 %b, <2 x i32> %c) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %c to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[LANE:%.*]] = extractelement <2 x i32> %c, i32 1 // CHECK: [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]]) // CHECK: [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqsub.i64(i64 %a, i64 [[VQDMLXL]]) // CHECK: ret i64 [[VQDMLXL1]] @@ -464,9 +386,7 @@ int64_t test_vqdmlsls_lane_s32(int64_t a, int32_t b, int32x2_t c) { } // CHECK-LABEL: define i32 @test_vqdmlslh_laneq_s16(i32 %a, i16 %b, <8 x i16> %c) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %c to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[LANE:%.*]] = extractelement <8 x i16> %c, i32 7 // CHECK: [[TMP2:%.*]] = insertelement <4 x i16> undef, i16 %b, i64 0 // CHECK: [[TMP3:%.*]] = insertelement <4 x i16> undef, i16 [[LANE]], i64 0 // CHECK: [[VQDMLXL:%.*]] = call <4 x i32> @llvm.aarch64.neon.sqdmull.v4i32(<4 x i16> [[TMP2]], <4 x i16> [[TMP3]]) @@ -478,9 +398,7 @@ int32_t test_vqdmlslh_laneq_s16(int32_t a, int16_t b, int16x8_t c) { } // CHECK-LABEL: define i64 @test_vqdmlsls_laneq_s32(i64 %a, i32 %b, <4 x i32> %c) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %c to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[LANE:%.*]] = extractelement <4 x i32> %c, i32 3 // CHECK: [[VQDMLXL:%.*]] = call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %b, i32 [[LANE]]) // CHECK: [[VQDMLXL1:%.*]] = call i64 @llvm.aarch64.neon.sqsub.i64(i64 %a, i64 [[VQDMLXL]]) // CHECK: ret i64 [[VQDMLXL1]] @@ -491,16 +409,10 @@ int64_t test_vqdmlsls_laneq_s32(int64_t a, int32_t b, int32x4_t c) { // CHECK-LABEL: define <1 x double> @test_vmulx_lane_f64_0() #0 { // CHECK: [[TMP0:%.*]] = bitcast i64 4599917171378402754 to <1 x double> // CHECK: [[TMP1:%.*]] = bitcast i64 4606655882138939123 to <1 x double> -// CHECK: [[TMP2:%.*]] = bitcast <1 x double> [[TMP0]] to <8 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x double> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP3]], i32 0 -// CHECK: [[TMP4:%.*]] = bitcast <1 x double> [[TMP1]] to <8 x i8> -// CHECK: [[TMP5:%.*]] = bitcast <8 x i8> [[TMP4]] to <1 x double> -// CHECK: [[VGET_LANE7:%.*]] = extractelement <1 x double> [[TMP5]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP0]], i32 0 +// CHECK: [[VGET_LANE7:%.*]] = extractelement <1 x double> [[TMP1]], i32 0 // CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGET_LANE7]]) -// CHECK: [[TMP6:%.*]] = bitcast <1 x double> [[TMP0]] to <8 x i8> -// CHECK: [[TMP7:%.*]] = bitcast <8 x i8> [[TMP6]] to <1 x double> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP7]], double [[VMULXD_F64_I]], i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP0]], double [[VMULXD_F64_I]], i32 0 // CHECK: ret <1 x double> [[VSET_LANE]] float64x1_t test_vmulx_lane_f64_0() { float64x1_t arg1; @@ -517,16 +429,10 @@ float64x1_t test_vmulx_lane_f64_0() { // CHECK: [[TMP0:%.*]] = bitcast i64 4599917171378402754 to <1 x double> // CHECK: [[TMP1:%.*]] = bitcast i64 4606655882138939123 to <1 x double> // CHECK: [[SHUFFLE_I:%.*]] = shufflevector <1 x double> [[TMP0]], <1 x double> [[TMP1]], <2 x i32> -// CHECK: [[TMP2:%.*]] = bitcast <1 x double> [[TMP0]] to <8 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x double> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP3]], i32 0 -// CHECK: [[TMP4:%.*]] = bitcast <2 x double> [[SHUFFLE_I]] to <16 x i8> -// CHECK: [[TMP5:%.*]] = bitcast <16 x i8> [[TMP4]] to <2 x double> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP5]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x double> [[TMP0]], i32 0 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[SHUFFLE_I]], i32 1 // CHECK: [[VMULXD_F64_I:%.*]] = call double @llvm.aarch64.neon.fmulx.f64(double [[VGET_LANE]], double [[VGETQ_LANE]]) -// CHECK: [[TMP6:%.*]] = bitcast <1 x double> [[TMP0]] to <8 x i8> -// CHECK: [[TMP7:%.*]] = bitcast <8 x i8> [[TMP6]] to <1 x double> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP7]], double [[VMULXD_F64_I]], i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x double> [[TMP0]], double [[VMULXD_F64_I]], i32 0 // CHECK: ret <1 x double> [[VSET_LANE]] float64x1_t test_vmulx_laneq_f64_2() { float64x1_t arg1; diff --git a/clang/test/CodeGen/aarch64-neon-vget.c b/clang/test/CodeGen/aarch64-neon-vget.c index cd25ec3ee236d..cd918c77a4f79 100644 --- a/clang/test/CodeGen/aarch64-neon-vget.c +++ b/clang/test/CodeGen/aarch64-neon-vget.c @@ -12,18 +12,14 @@ uint8_t test_vget_lane_u8(uint8x8_t a) { } // CHECK-LABEL: define i16 @test_vget_lane_u16(<4 x i16> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3 // CHECK: ret i16 [[VGET_LANE]] uint16_t test_vget_lane_u16(uint16x4_t a) { return vget_lane_u16(a, 3); } // CHECK-LABEL: define i32 @test_vget_lane_u32(<2 x i32> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1 // CHECK: ret i32 [[VGET_LANE]] uint32_t test_vget_lane_u32(uint32x2_t a) { return vget_lane_u32(a, 1); @@ -37,18 +33,14 @@ int8_t test_vget_lane_s8(int8x8_t a) { } // CHECK-LABEL: define i16 @test_vget_lane_s16(<4 x i16> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3 // CHECK: ret i16 [[VGET_LANE]] int16_t test_vget_lane_s16(int16x4_t a) { return vget_lane_s16(a, 3); } // CHECK-LABEL: define i32 @test_vget_lane_s32(<2 x i32> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1 // CHECK: ret i32 [[VGET_LANE]] int32_t test_vget_lane_s32(int32x2_t a) { return vget_lane_s32(a, 1); @@ -62,18 +54,14 @@ poly8_t test_vget_lane_p8(poly8x8_t a) { } // CHECK-LABEL: define i16 @test_vget_lane_p16(<4 x i16> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3 // CHECK: ret i16 [[VGET_LANE]] poly16_t test_vget_lane_p16(poly16x4_t a) { return vget_lane_p16(a, 3); } // CHECK-LABEL: define float @test_vget_lane_f32(<2 x float> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> %a, i32 1 // CHECK: ret float [[VGET_LANE]] float32_t test_vget_lane_f32(float32x2_t a) { return vget_lane_f32(a, 1); @@ -85,9 +73,7 @@ float32_t test_vget_lane_f32(float32x2_t a) { // CHECK: store <4 x half> %a, <4 x half>* [[__REINT_242]], align 8 // CHECK: [[TMP0:%.*]] = bitcast <4 x half>* [[__REINT_242]] to <4 x i16>* // CHECK: [[TMP1:%.*]] = load <4 x i16>, <4 x i16>* [[TMP0]], align 8 -// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[TMP1]] to <8 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP3]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 1 // CHECK: store i16 [[VGET_LANE]], i16* [[__REINT1_242]], align 2 // CHECK: [[TMP4:%.*]] = bitcast i16* [[__REINT1_242]] to half* // CHECK: [[TMP5:%.*]] = load half, half* [[TMP4]], align 2 @@ -105,18 +91,14 @@ uint8_t test_vgetq_lane_u8(uint8x16_t a) { } // CHECK-LABEL: define i16 @test_vgetq_lane_u16(<8 x i16> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7 // CHECK: ret i16 [[VGETQ_LANE]] uint16_t test_vgetq_lane_u16(uint16x8_t a) { return vgetq_lane_u16(a, 7); } // CHECK-LABEL: define i32 @test_vgetq_lane_u32(<4 x i32> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a, i32 3 // CHECK: ret i32 [[VGETQ_LANE]] uint32_t test_vgetq_lane_u32(uint32x4_t a) { return vgetq_lane_u32(a, 3); @@ -130,18 +112,14 @@ int8_t test_vgetq_lane_s8(int8x16_t a) { } // CHECK-LABEL: define i16 @test_vgetq_lane_s16(<8 x i16> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7 // CHECK: ret i16 [[VGETQ_LANE]] int16_t test_vgetq_lane_s16(int16x8_t a) { return vgetq_lane_s16(a, 7); } // CHECK-LABEL: define i32 @test_vgetq_lane_s32(<4 x i32> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a, i32 3 // CHECK: ret i32 [[VGETQ_LANE]] int32_t test_vgetq_lane_s32(int32x4_t a) { return vgetq_lane_s32(a, 3); @@ -155,18 +133,14 @@ poly8_t test_vgetq_lane_p8(poly8x16_t a) { } // CHECK-LABEL: define i16 @test_vgetq_lane_p16(<8 x i16> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a, i32 7 // CHECK: ret i16 [[VGETQ_LANE]] poly16_t test_vgetq_lane_p16(poly16x8_t a) { return vgetq_lane_p16(a, 7); } // CHECK-LABEL: define float @test_vgetq_lane_f32(<4 x float> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %a, i32 3 // CHECK: ret float [[VGETQ_LANE]] float32_t test_vgetq_lane_f32(float32x4_t a) { return vgetq_lane_f32(a, 3); @@ -178,9 +152,7 @@ float32_t test_vgetq_lane_f32(float32x4_t a) { // CHECK: store <8 x half> %a, <8 x half>* [[__REINT_244]], align 16 // CHECK: [[TMP0:%.*]] = bitcast <8 x half>* [[__REINT_244]] to <8 x i16>* // CHECK: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 16 -// CHECK: [[TMP2:%.*]] = bitcast <8 x i16> [[TMP1]] to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP3]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 3 // CHECK: store i16 [[VGETQ_LANE]], i16* [[__REINT1_244]], align 2 // CHECK: [[TMP4:%.*]] = bitcast i16* [[__REINT1_244]] to half* // CHECK: [[TMP5:%.*]] = load half, half* [[TMP4]], align 2 @@ -191,36 +163,28 @@ float32_t test_vgetq_lane_f16(float16x8_t a) { } // CHECK-LABEL: define i64 @test_vget_lane_s64(<1 x i64> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0 // CHECK: ret i64 [[VGET_LANE]] int64_t test_vget_lane_s64(int64x1_t a) { return vget_lane_s64(a, 0); } // CHECK-LABEL: define i64 @test_vget_lane_u64(<1 x i64> %a) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0 // CHECK: ret i64 [[VGET_LANE]] uint64_t test_vget_lane_u64(uint64x1_t a) { return vget_lane_u64(a, 0); } // CHECK-LABEL: define i64 @test_vgetq_lane_s64(<2 x i64> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a, i32 1 // CHECK: ret i64 [[VGETQ_LANE]] int64_t test_vgetq_lane_s64(int64x2_t a) { return vgetq_lane_s64(a, 1); } // CHECK-LABEL: define i64 @test_vgetq_lane_u64(<2 x i64> %a) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a, i32 1 // CHECK: ret i64 [[VGETQ_LANE]] uint64_t test_vgetq_lane_u64(uint64x2_t a) { return vgetq_lane_u64(a, 1); @@ -235,18 +199,14 @@ uint8x8_t test_vset_lane_u8(uint8_t a, uint8x8_t b) { } // CHECK-LABEL: define <4 x i16> @test_vset_lane_u16(i16 %a, <4 x i16> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3 // CHECK: ret <4 x i16> [[VSET_LANE]] uint16x4_t test_vset_lane_u16(uint16_t a, uint16x4_t b) { return vset_lane_u16(a, b, 3); } // CHECK-LABEL: define <2 x i32> @test_vset_lane_u32(i32 %a, <2 x i32> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> [[TMP1]], i32 %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> %b, i32 %a, i32 1 // CHECK: ret <2 x i32> [[VSET_LANE]] uint32x2_t test_vset_lane_u32(uint32_t a, uint32x2_t b) { return vset_lane_u32(a, b, 1); @@ -260,18 +220,14 @@ int8x8_t test_vset_lane_s8(int8_t a, int8x8_t b) { } // CHECK-LABEL: define <4 x i16> @test_vset_lane_s16(i16 %a, <4 x i16> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3 // CHECK: ret <4 x i16> [[VSET_LANE]] int16x4_t test_vset_lane_s16(int16_t a, int16x4_t b) { return vset_lane_s16(a, b, 3); } // CHECK-LABEL: define <2 x i32> @test_vset_lane_s32(i32 %a, <2 x i32> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> [[TMP1]], i32 %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> %b, i32 %a, i32 1 // CHECK: ret <2 x i32> [[VSET_LANE]] int32x2_t test_vset_lane_s32(int32_t a, int32x2_t b) { return vset_lane_s32(a, b, 1); @@ -285,18 +241,14 @@ poly8x8_t test_vset_lane_p8(poly8_t a, poly8x8_t b) { } // CHECK-LABEL: define <4 x i16> @test_vset_lane_p16(i16 %a, <4 x i16> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3 // CHECK: ret <4 x i16> [[VSET_LANE]] poly16x4_t test_vset_lane_p16(poly16_t a, poly16x4_t b) { return vset_lane_p16(a, b, 3); } // CHECK-LABEL: define <2 x float> @test_vset_lane_f32(float %a, <2 x float> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x float> [[TMP1]], float %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x float> %b, float %a, i32 1 // CHECK: ret <2 x float> [[VSET_LANE]] float32x2_t test_vset_lane_f32(float32_t a, float32x2_t b) { return vset_lane_f32(a, b, 1); @@ -313,9 +265,7 @@ float32x2_t test_vset_lane_f32(float32_t a, float32x2_t b) { // CHECK: [[TMP2:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK: [[TMP3:%.*]] = bitcast <4 x half>* [[__REINT1_246]] to <4 x i16>* // CHECK: [[TMP4:%.*]] = load <4 x i16>, <4 x i16>* [[TMP3]], align 8 -// CHECK: [[TMP5:%.*]] = bitcast <4 x i16> [[TMP4]] to <8 x i8> -// CHECK: [[TMP6:%.*]] = bitcast <8 x i8> [[TMP5]] to <4 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP6]], i16 [[TMP2]], i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP4]], i16 [[TMP2]], i32 3 // CHECK: store <4 x i16> [[VSET_LANE]], <4 x i16>* [[__REINT2_246]], align 8 // CHECK: [[TMP7:%.*]] = bitcast <4 x i16>* [[__REINT2_246]] to <4 x half>* // CHECK: [[TMP8:%.*]] = load <4 x half>, <4 x half>* [[TMP7]], align 8 @@ -332,18 +282,14 @@ uint8x16_t test_vsetq_lane_u8(uint8_t a, uint8x16_t b) { } // CHECK-LABEL: define <8 x i16> @test_vsetq_lane_u16(i16 %a, <8 x i16> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7 // CHECK: ret <8 x i16> [[VSET_LANE]] uint16x8_t test_vsetq_lane_u16(uint16_t a, uint16x8_t b) { return vsetq_lane_u16(a, b, 7); } // CHECK-LABEL: define <4 x i32> @test_vsetq_lane_u32(i32 %a, <4 x i32> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP1]], i32 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %b, i32 %a, i32 3 // CHECK: ret <4 x i32> [[VSET_LANE]] uint32x4_t test_vsetq_lane_u32(uint32_t a, uint32x4_t b) { return vsetq_lane_u32(a, b, 3); @@ -357,18 +303,14 @@ int8x16_t test_vsetq_lane_s8(int8_t a, int8x16_t b) { } // CHECK-LABEL: define <8 x i16> @test_vsetq_lane_s16(i16 %a, <8 x i16> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7 // CHECK: ret <8 x i16> [[VSET_LANE]] int16x8_t test_vsetq_lane_s16(int16_t a, int16x8_t b) { return vsetq_lane_s16(a, b, 7); } // CHECK-LABEL: define <4 x i32> @test_vsetq_lane_s32(i32 %a, <4 x i32> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP1]], i32 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %b, i32 %a, i32 3 // CHECK: ret <4 x i32> [[VSET_LANE]] int32x4_t test_vsetq_lane_s32(int32_t a, int32x4_t b) { return vsetq_lane_s32(a, b, 3); @@ -382,18 +324,14 @@ poly8x16_t test_vsetq_lane_p8(poly8_t a, poly8x16_t b) { } // CHECK-LABEL: define <8 x i16> @test_vsetq_lane_p16(i16 %a, <8 x i16> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7 // CHECK: ret <8 x i16> [[VSET_LANE]] poly16x8_t test_vsetq_lane_p16(poly16_t a, poly16x8_t b) { return vsetq_lane_p16(a, b, 7); } // CHECK-LABEL: define <4 x float> @test_vsetq_lane_f32(float %a, <4 x float> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> [[TMP1]], float %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> %b, float %a, i32 3 // CHECK: ret <4 x float> [[VSET_LANE]] float32x4_t test_vsetq_lane_f32(float32_t a, float32x4_t b) { return vsetq_lane_f32(a, b, 3); @@ -410,9 +348,7 @@ float32x4_t test_vsetq_lane_f32(float32_t a, float32x4_t b) { // CHECK: [[TMP2:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK: [[TMP3:%.*]] = bitcast <8 x half>* [[__REINT1_248]] to <8 x i16>* // CHECK: [[TMP4:%.*]] = load <8 x i16>, <8 x i16>* [[TMP3]], align 16 -// CHECK: [[TMP5:%.*]] = bitcast <8 x i16> [[TMP4]] to <16 x i8> -// CHECK: [[TMP6:%.*]] = bitcast <16 x i8> [[TMP5]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP6]], i16 [[TMP2]], i32 7 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP4]], i16 [[TMP2]], i32 7 // CHECK: store <8 x i16> [[VSET_LANE]], <8 x i16>* [[__REINT2_248]], align 16 // CHECK: [[TMP7:%.*]] = bitcast <8 x i16>* [[__REINT2_248]] to <8 x half>* // CHECK: [[TMP8:%.*]] = load <8 x half>, <8 x half>* [[TMP7]], align 16 @@ -422,36 +358,28 @@ float16x8_t test_vsetq_lane_f16(float16_t *a, float16x8_t b) { } // CHECK-LABEL: define <1 x i64> @test_vset_lane_s64(i64 %a, <1 x i64> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %b, i64 %a, i32 0 // CHECK: ret <1 x i64> [[VSET_LANE]] int64x1_t test_vset_lane_s64(int64_t a, int64x1_t b) { return vset_lane_s64(a, b, 0); } // CHECK-LABEL: define <1 x i64> @test_vset_lane_u64(i64 %a, <1 x i64> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %b, i64 %a, i32 0 // CHECK: ret <1 x i64> [[VSET_LANE]] uint64x1_t test_vset_lane_u64(uint64_t a, uint64x1_t b) { return vset_lane_u64(a, b, 0); } // CHECK-LABEL: define <2 x i64> @test_vsetq_lane_s64(i64 %a, <2 x i64> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %b, i64 %a, i32 1 // CHECK: ret <2 x i64> [[VSET_LANE]] int64x2_t test_vsetq_lane_s64(int64_t a, int64x2_t b) { return vsetq_lane_s64(a, b, 1); } // CHECK-LABEL: define <2 x i64> @test_vsetq_lane_u64(i64 %a, <2 x i64> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %b, i64 %a, i32 1 // CHECK: ret <2 x i64> [[VSET_LANE]] uint64x2_t test_vsetq_lane_u64(uint64_t a, uint64x2_t b) { return vsetq_lane_u64(a, b, 1); diff --git a/clang/test/CodeGen/aarch64-poly64.c b/clang/test/CodeGen/aarch64-poly64.c index cdf91699c9b0c..8c4ef23bb7e14 100644 --- a/clang/test/CodeGen/aarch64-poly64.c +++ b/clang/test/CodeGen/aarch64-poly64.c @@ -61,48 +61,36 @@ poly64x2_t test_vbslq_p64(poly64x2_t a, poly64x2_t b, poly64x2_t c) { } // CHECK-LABEL: define i64 @test_vget_lane_p64(<1 x i64> %v) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %v to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %v, i32 0 // CHECK: ret i64 [[VGET_LANE]] poly64_t test_vget_lane_p64(poly64x1_t v) { return vget_lane_p64(v, 0); } // CHECK-LABEL: define i64 @test_vgetq_lane_p64(<2 x i64> %v) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %v to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %v, i32 1 // CHECK: ret i64 [[VGETQ_LANE]] poly64_t test_vgetq_lane_p64(poly64x2_t v) { return vgetq_lane_p64(v, 1); } // CHECK-LABEL: define <1 x i64> @test_vset_lane_p64(i64 %a, <1 x i64> %v) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %v to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %v, i64 %a, i32 0 // CHECK: ret <1 x i64> [[VSET_LANE]] poly64x1_t test_vset_lane_p64(poly64_t a, poly64x1_t v) { return vset_lane_p64(a, v, 0); } // CHECK-LABEL: define <2 x i64> @test_vsetq_lane_p64(i64 %a, <2 x i64> %v) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %v to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %v, i64 %a, i32 1 // CHECK: ret <2 x i64> [[VSET_LANE]] poly64x2_t test_vsetq_lane_p64(poly64_t a, poly64x2_t v) { return vsetq_lane_p64(a, v, 1); } // CHECK-LABEL: define <1 x i64> @test_vcopy_lane_p64(<1 x i64> %a, <1 x i64> %b) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0 -// CHECK: [[TMP2:%.*]] = bitcast <1 x i64> %a to <8 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <1 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP3]], i64 [[VGET_LANE]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %b, i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %a, i64 [[VGET_LANE]], i32 0 // CHECK: ret <1 x i64> [[VSET_LANE]] poly64x1_t test_vcopy_lane_p64(poly64x1_t a, poly64x1_t b) { return vcopy_lane_p64(a, 0, b, 0); @@ -110,24 +98,16 @@ poly64x1_t test_vcopy_lane_p64(poly64x1_t a, poly64x1_t b) { } // CHECK-LABEL: define <2 x i64> @test_vcopyq_lane_p64(<2 x i64> %a, <1 x i64> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0 -// CHECK: [[TMP2:%.*]] = bitcast <2 x i64> %a to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP3]], i64 [[VGET_LANE]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %b, i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %a, i64 [[VGET_LANE]], i32 1 // CHECK: ret <2 x i64> [[VSET_LANE]] poly64x2_t test_vcopyq_lane_p64(poly64x2_t a, poly64x1_t b) { return vcopyq_lane_p64(a, 1, b, 0); } // CHECK-LABEL: define <2 x i64> @test_vcopyq_laneq_p64(<2 x i64> %a, <2 x i64> %b) #1 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 -// CHECK: [[TMP2:%.*]] = bitcast <2 x i64> %a to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP3]], i64 [[VGETQ_LANE]], i32 1 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %b, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %a, i64 [[VGETQ_LANE]], i32 1 // CHECK: ret <2 x i64> [[VSET_LANE]] poly64x2_t test_vcopyq_laneq_p64(poly64x2_t a, poly64x2_t b) { return vcopyq_laneq_p64(a, 1, b, 1); diff --git a/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c b/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c index a84445b62a24e..de1dd4a059770 100644 --- a/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c +++ b/clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics.c @@ -960,9 +960,7 @@ float16x8_t test_vfmaq_n_f16(float16x8_t a, float16x8_t b, float16_t c) { } // CHECK-LABEL: test_vfmah_lane_f16 -// CHECK: [[TMP0:%.*]] = bitcast <4 x half> %c to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x half> -// CHECK: [[EXTR:%.*]] = extractelement <4 x half> [[TMP1]], i32 3 +// CHECK: [[EXTR:%.*]] = extractelement <4 x half> %c, i32 3 // CHECK: [[FMA:%.*]] = call half @llvm.fma.f16(half %b, half [[EXTR]], half %a) // CHECK: ret half [[FMA]] float16_t test_vfmah_lane_f16(float16_t a, float16_t b, float16x4_t c) { @@ -970,9 +968,7 @@ float16_t test_vfmah_lane_f16(float16_t a, float16_t b, float16x4_t c) { } // CHECK-LABEL: test_vfmah_laneq_f16 -// CHECK: [[TMP0:%.*]] = bitcast <8 x half> %c to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x half> -// CHECK: [[EXTR:%.*]] = extractelement <8 x half> [[TMP1]], i32 7 +// CHECK: [[EXTR:%.*]] = extractelement <8 x half> %c, i32 7 // CHECK: [[FMA:%.*]] = call half @llvm.fma.f16(half %b, half [[EXTR]], half %a) // CHECK: ret half [[FMA]] float16_t test_vfmah_laneq_f16(float16_t a, float16_t b, float16x8_t c) { @@ -1071,9 +1067,7 @@ float16x8_t test_vfmsq_n_f16(float16x8_t a, float16x8_t b, float16_t c) { // CHECK: [[TMP0:%.*]] = fpext half %b to float // CHECK: [[TMP1:%.*]] = fsub float -0.000000e+00, [[TMP0]] // CHECK: [[SUB:%.*]] = fptrunc float [[TMP1]] to half -// CHECK: [[TMP2:%.*]] = bitcast <4 x half> %c to <8 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <4 x half> -// CHECK: [[EXTR:%.*]] = extractelement <4 x half> [[TMP3]], i32 3 +// CHECK: [[EXTR:%.*]] = extractelement <4 x half> %c, i32 3 // CHECK: [[FMA:%.*]] = call half @llvm.fma.f16(half [[SUB]], half [[EXTR]], half %a) // CHECK: ret half [[FMA]] float16_t test_vfmsh_lane_f16(float16_t a, float16_t b, float16x4_t c) { @@ -1084,9 +1078,7 @@ float16_t test_vfmsh_lane_f16(float16_t a, float16_t b, float16x4_t c) { // CHECK: [[TMP0:%.*]] = fpext half %b to float // CHECK: [[TMP1:%.*]] = fsub float -0.000000e+00, [[TMP0]] // CHECK: [[SUB:%.*]] = fptrunc float [[TMP1]] to half -// CHECK: [[TMP2:%.*]] = bitcast <8 x half> %c to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x half> -// CHECK: [[EXTR:%.*]] = extractelement <8 x half> [[TMP3]], i32 7 +// CHECK: [[EXTR:%.*]] = extractelement <8 x half> %c, i32 7 // CHECK: [[FMA:%.*]] = call half @llvm.fma.f16(half [[SUB]], half [[EXTR]], half %a) // CHECK: ret half [[FMA]] float16_t test_vfmsh_laneq_f16(float16_t a, float16_t b, float16x8_t c) { @@ -1231,9 +1223,7 @@ float16x8_t test_vmulxq_n_f16(float16x8_t a, float16_t b) { } // CHECK-LABEL: test_vmulxh_lane_f16 -// CHECK: [[TMP0:%.*]] = bitcast <4 x half> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x half> -// CHECK: [[EXTR:%.*]] = extractelement <4 x half> [[TMP1]], i32 3 +// CHECK: [[EXTR:%.*]] = extractelement <4 x half> %b, i32 3 // CHECK: [[MULX:%.*]] = call half @llvm.aarch64.neon.fmulx.f16(half %a, half [[EXTR]] // CHECK: ret half [[MULX]] float16_t test_vmulxh_lane_f16(float16_t a, float16x4_t b) { @@ -1241,9 +1231,7 @@ float16_t test_vmulxh_lane_f16(float16_t a, float16x4_t b) { } // CHECK-LABEL: test_vmulxh_laneq_f16 -// CHECK: [[TMP0:%.*]] = bitcast <8 x half> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x half> -// CHECK: [[EXTR:%.*]] = extractelement <8 x half> [[TMP1]], i32 7 +// CHECK: [[EXTR:%.*]] = extractelement <8 x half> %b, i32 7 // CHECK: [[MULX:%.*]] = call half @llvm.aarch64.neon.fmulx.f16(half %a, half [[EXTR]]) // CHECK: ret half [[MULX]] float16_t test_vmulxh_laneq_f16(float16_t a, float16x8_t b) { diff --git a/clang/test/CodeGen/arm64-lanes.c b/clang/test/CodeGen/arm64-lanes.c index fde5f848b9ee2..3d765bf777b7b 100644 --- a/clang/test/CodeGen/arm64-lanes.c +++ b/clang/test/CodeGen/arm64-lanes.c @@ -9,7 +9,7 @@ int8_t test_vdupb_lane_s8(int8x8_t src) { // CHECK: extractelement <8 x i8> %src, i32 2 // CHECK-BE-LABEL: @test_vdupb_lane_s8 - // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> {{.*}}, <8 x i32> + // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> %src, <8 x i8> %src, <8 x i32> // CHECK-BE: extractelement <8 x i8> [[REV]], i32 2 } @@ -19,109 +19,83 @@ uint8_t test_vdupb_lane_u8(uint8x8_t src) { // CHECK: extractelement <8 x i8> %src, i32 2 // CHECK-BE-LABEL: @test_vdupb_lane_u8 - // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> {{.*}}, <8 x i32> + // CHECK-BE: [[REV:%.*]] = shufflevector <8 x i8> %src, <8 x i8> %src, <8 x i32> // CHECK-BE: extractelement <8 x i8> [[REV]], i32 2 } int16_t test_vduph_lane_s16(int16x4_t src) { return vduph_lane_s16(src, 2); // CHECK-LABEL: @test_vduph_lane_s16 - // CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %src to [[TYPE:.*]] - // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <4 x i16> - // CHECK: extractelement <4 x i16> [[TMP2]], i32 2 + // CHECK: extractelement <4 x i16> %src, i32 2 // CHECK-BE-LABEL: @test_vduph_lane_s16 - // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> {{.*}}, <4 x i32> - // CHECK-BE: [[TMP1:%.*]] = bitcast <4 x i16> [[REV]] to [[TYPE:.*]] - // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <4 x i16> - // CHECK-BE: extractelement <4 x i16> [[TMP2]], i32 2 + // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> %src, <4 x i16> %src, <4 x i32> + // CHECK-BE: extractelement <4 x i16> [[REV]], i32 2 } uint16_t test_vduph_lane_u16(uint16x4_t src) { return vduph_lane_u16(src, 2); // CHECK-LABEL: @test_vduph_lane_u16 - // CHECK: [[TMP1:%.*]] = bitcast <4 x i16> %src to [[TYPE:.*]] - // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <4 x i16> - // CHECK: extractelement <4 x i16> [[TMP2]], i32 2 + // CHECK: extractelement <4 x i16> %src, i32 2 // CHECK-BE-LABEL: @test_vduph_lane_u16 - // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> {{.*}}, <4 x i32> - // CHECK-BE: [[TMP1:%.*]] = bitcast <4 x i16> [[REV]] to [[TYPE:.*]] - // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <4 x i16> - // CHECK-BE: extractelement <4 x i16> [[TMP2]], i32 2 + // CHECK-BE: [[REV:%.*]] = shufflevector <4 x i16> %src, <4 x i16> %src, <4 x i32> + // CHECK-BE: extractelement <4 x i16> [[REV]], i32 2 } int32_t test_vdups_lane_s32(int32x2_t src) { return vdups_lane_s32(src, 0); // CHECK-LABEL: @test_vdups_lane_s32 - // CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %src to [[TYPE:.*]] - // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x i32> - // CHECK: extractelement <2 x i32> [[TMP2]], i32 0 + // CHECK: extractelement <2 x i32> %src, i32 0 // CHECK-BE-LABEL: @test_vdups_lane_s32 - // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> {{.*}}, <2 x i32> - // CHECK-BE: [[TMP1:%.*]] = bitcast <2 x i32> [[REV]] to [[TYPE:.*]] - // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x i32> - // CHECK-BE: extractelement <2 x i32> [[TMP2]], i32 0 + // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> %src, <2 x i32> %src, <2 x i32> + // CHECK-BE: extractelement <2 x i32> [[REV]], i32 0 } uint32_t test_vdups_lane_u32(uint32x2_t src) { return vdups_lane_u32(src, 0); // CHECK-LABEL: @test_vdups_lane_u32 - // CHECK: [[TMP1:%.*]] = bitcast <2 x i32> %src to [[TYPE:.*]] - // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x i32> - // CHECK: extractelement <2 x i32> [[TMP2]], i32 0 + // CHECK: extractelement <2 x i32> %src, i32 0 // CHECK-BE-LABEL: @test_vdups_lane_u32 - // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> {{.*}}, <2 x i32> - // CHECK-BE: [[TMP1:%.*]] = bitcast <2 x i32> [[REV]] to [[TYPE:.*]] - // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x i32> - // CHECK-BE: extractelement <2 x i32> [[TMP2]], i32 0 + // CHECK-BE: [[REV:%.*]] = shufflevector <2 x i32> %src, <2 x i32> %src, <2 x i32> + // CHECK-BE: extractelement <2 x i32> [[REV]], i32 0 } float32_t test_vdups_lane_f32(float32x2_t src) { return vdups_lane_f32(src, 0); // CHECK-LABEL: @test_vdups_lane_f32 - // CHECK: [[TMP1:%.*]] = bitcast <2 x float> %src to [[TYPE:.*]] - // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x float> - // CHECK: extractelement <2 x float> [[TMP2]], i32 0 + // CHECK: extractelement <2 x float> %src, i32 0 // CHECK-BE-LABEL: @test_vdups_lane_f32 - // CHECK-BE: [[REV:%.*]] = shufflevector <2 x float> {{.*}}, <2 x i32> - // CHECK-BE: [[TMP1:%.*]] = bitcast <2 x float> [[REV]] to [[TYPE:.*]] - // CHECK-BE: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <2 x float> - // CHECK-BE: extractelement <2 x float> [[TMP2]], i32 0 + // CHECK-BE: [[REV:%.*]] = shufflevector <2 x float> %src, <2 x float> %src, <2 x i32> + // CHECK-BE: extractelement <2 x float> [[REV]], i32 0 } int64_t test_vdupd_lane_s64(int64x1_t src) { return vdupd_lane_s64(src, 0); // CHECK-LABEL: @test_vdupd_lane_s64 - // CHECK: [[TMP1:%.*]] = bitcast <1 x i64> %src to [[TYPE:.*]] - // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <1 x i64> - // CHECK: extractelement <1 x i64> [[TMP2]], i32 0 + // CHECK: extractelement <1 x i64> %src, i32 0 // CHECK-BE-LABEL: @test_vdupd_lane_s64 - // CHECK-BE: extractelement <1 x i64> {{.*}}, i32 0 + // CHECK-BE: extractelement <1 x i64> %src, i32 0 } uint64_t test_vdupd_lane_u64(uint64x1_t src) { return vdupd_lane_u64(src, 0); // CHECK-LABEL: @test_vdupd_lane_u64 - // CHECK: [[TMP1:%.*]] = bitcast <1 x i64> %src to [[TYPE:.*]] - // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <1 x i64> - // CHECK: extractelement <1 x i64> [[TMP2]], i32 0 + // CHECK: extractelement <1 x i64> %src, i32 0 // CHECK-BE-LABEL: @test_vdupd_lane_u64 - // CHECK-BE: extractelement <1 x i64> {{.*}}, i32 0 + // CHECK-BE: extractelement <1 x i64> %src, i32 0 } float64_t test_vdupd_lane_f64(float64x1_t src) { return vdupd_lane_f64(src, 0); // CHECK-LABEL: @test_vdupd_lane_f64 - // CHECK: [[TMP1:%.*]] = bitcast <1 x double> %src to [[TYPE:.*]] - // CHECK: [[TMP2:%.*]] = bitcast [[TYPE]] [[TMP1]] to <1 x double> - // CHECK: extractelement <1 x double> [[TMP2]], i32 0 + // CHECK: extractelement <1 x double> %src, i32 0 // CHECK-BE-LABEL: @test_vdupd_lane_f64 - // CHECK-BE: extractelement <1 x double> {{.*}}, i32 0 + // CHECK-BE: extractelement <1 x double> %src, i32 0 } diff --git a/clang/test/CodeGen/arm64_vcopy.c b/clang/test/CodeGen/arm64_vcopy.c index fc2ad3746ba95..ecf1386384a7e 100644 --- a/clang/test/CodeGen/arm64_vcopy.c +++ b/clang/test/CodeGen/arm64_vcopy.c @@ -22,12 +22,8 @@ uint8x16_t test_vcopyq_laneq_u8(uint8x16_t a1, uint8x16_t a2) { } // CHECK-LABEL: define <8 x i16> @test_vcopyq_laneq_s16(<8 x i16> %a1, <8 x i16> %a2) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a2 to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 -// CHECK: [[TMP2:%.*]] = bitcast <8 x i16> %a1 to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP3]], i16 [[VGETQ_LANE]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a2, i32 7 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %a1, i16 [[VGETQ_LANE]], i32 3 // CHECK: ret <8 x i16> [[VSET_LANE]] int16x8_t test_vcopyq_laneq_s16(int16x8_t a1, int16x8_t a2) { return vcopyq_laneq_s16(a1, (int64_t) 3, a2, (int64_t) 7); @@ -35,12 +31,8 @@ int16x8_t test_vcopyq_laneq_s16(int16x8_t a1, int16x8_t a2) { } // CHECK-LABEL: define <8 x i16> @test_vcopyq_laneq_u16(<8 x i16> %a1, <8 x i16> %a2) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a2 to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 -// CHECK: [[TMP2:%.*]] = bitcast <8 x i16> %a1 to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP3]], i16 [[VGETQ_LANE]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <8 x i16> %a2, i32 7 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %a1, i16 [[VGETQ_LANE]], i32 3 // CHECK: ret <8 x i16> [[VSET_LANE]] uint16x8_t test_vcopyq_laneq_u16(uint16x8_t a1, uint16x8_t a2) { return vcopyq_laneq_u16(a1, (int64_t) 3, a2, (int64_t) 7); @@ -48,72 +40,48 @@ uint16x8_t test_vcopyq_laneq_u16(uint16x8_t a1, uint16x8_t a2) { } // CHECK-LABEL: define <4 x i32> @test_vcopyq_laneq_s32(<4 x i32> %a1, <4 x i32> %a2) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a2 to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 -// CHECK: [[TMP2:%.*]] = bitcast <4 x i32> %a1 to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP3]], i32 [[VGETQ_LANE]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a2, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %a1, i32 [[VGETQ_LANE]], i32 3 // CHECK: ret <4 x i32> [[VSET_LANE]] int32x4_t test_vcopyq_laneq_s32(int32x4_t a1, int32x4_t a2) { return vcopyq_laneq_s32(a1, (int64_t) 3, a2, (int64_t) 3); } // CHECK-LABEL: define <4 x i32> @test_vcopyq_laneq_u32(<4 x i32> %a1, <4 x i32> %a2) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a2 to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 -// CHECK: [[TMP2:%.*]] = bitcast <4 x i32> %a1 to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP3]], i32 [[VGETQ_LANE]], i32 3 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x i32> %a2, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %a1, i32 [[VGETQ_LANE]], i32 3 // CHECK: ret <4 x i32> [[VSET_LANE]] uint32x4_t test_vcopyq_laneq_u32(uint32x4_t a1, uint32x4_t a2) { return vcopyq_laneq_u32(a1, (int64_t) 3, a2, (int64_t) 3); } // CHECK-LABEL: define <2 x i64> @test_vcopyq_laneq_s64(<2 x i64> %a1, <2 x i64> %a2) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a2 to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 -// CHECK: [[TMP2:%.*]] = bitcast <2 x i64> %a1 to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP3]], i64 [[VGETQ_LANE]], i32 0 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a2, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %a1, i64 [[VGETQ_LANE]], i32 0 // CHECK: ret <2 x i64> [[VSET_LANE]] int64x2_t test_vcopyq_laneq_s64(int64x2_t a1, int64x2_t a2) { return vcopyq_laneq_s64(a1, (int64_t) 0, a2, (int64_t) 1); } // CHECK-LABEL: define <2 x i64> @test_vcopyq_laneq_u64(<2 x i64> %a1, <2 x i64> %a2) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a2 to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 -// CHECK: [[TMP2:%.*]] = bitcast <2 x i64> %a1 to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP3]], i64 [[VGETQ_LANE]], i32 0 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x i64> %a2, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %a1, i64 [[VGETQ_LANE]], i32 0 // CHECK: ret <2 x i64> [[VSET_LANE]] uint64x2_t test_vcopyq_laneq_u64(uint64x2_t a1, uint64x2_t a2) { return vcopyq_laneq_u64(a1, (int64_t) 0, a2, (int64_t) 1); } // CHECK-LABEL: define <4 x float> @test_vcopyq_laneq_f32(<4 x float> %a1, <4 x float> %a2) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a2 to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3 -// CHECK: [[TMP2:%.*]] = bitcast <4 x float> %a1 to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <4 x float> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> [[TMP3]], float [[VGETQ_LANE]], i32 0 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <4 x float> %a2, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> %a1, float [[VGETQ_LANE]], i32 0 // CHECK: ret <4 x float> [[VSET_LANE]] float32x4_t test_vcopyq_laneq_f32(float32x4_t a1, float32x4_t a2) { return vcopyq_laneq_f32(a1, 0, a2, 3); } // CHECK-LABEL: define <2 x double> @test_vcopyq_laneq_f64(<2 x double> %a1, <2 x double> %a2) #0 { -// CHECK: [[TMP0:%.*]] = bitcast <2 x double> %a2 to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x double> -// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> [[TMP1]], i32 1 -// CHECK: [[TMP2:%.*]] = bitcast <2 x double> %a1 to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <2 x double> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x double> [[TMP3]], double [[VGETQ_LANE]], i32 0 +// CHECK: [[VGETQ_LANE:%.*]] = extractelement <2 x double> %a2, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x double> %a1, double [[VGETQ_LANE]], i32 0 // CHECK: ret <2 x double> [[VSET_LANE]] float64x2_t test_vcopyq_laneq_f64(float64x2_t a1, float64x2_t a2) { return vcopyq_laneq_f64(a1, 0, a2, 1); diff --git a/clang/test/CodeGen/arm_neon_intrinsics.c b/clang/test/CodeGen/arm_neon_intrinsics.c index c0e0dee0d32e5..b09e63883e260 100644 --- a/clang/test/CodeGen/arm_neon_intrinsics.c +++ b/clang/test/CodeGen/arm_neon_intrinsics.c @@ -3319,18 +3319,14 @@ uint8_t test_vget_lane_u8(uint8x8_t a) { } // CHECK-LABEL: @test_vget_lane_u16( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3 // CHECK: ret i16 [[VGET_LANE]] uint16_t test_vget_lane_u16(uint16x4_t a) { return vget_lane_u16(a, 3); } // CHECK-LABEL: @test_vget_lane_u32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1 // CHECK: ret i32 [[VGET_LANE]] uint32_t test_vget_lane_u32(uint32x2_t a) { return vget_lane_u32(a, 1); @@ -3344,18 +3340,14 @@ int8_t test_vget_lane_s8(int8x8_t a) { } // CHECK-LABEL: @test_vget_lane_s16( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3 // CHECK: ret i16 [[VGET_LANE]] int16_t test_vget_lane_s16(int16x4_t a) { return vget_lane_s16(a, 3); } // CHECK-LABEL: @test_vget_lane_s32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i32> %a, i32 1 // CHECK: ret i32 [[VGET_LANE]] int32_t test_vget_lane_s32(int32x2_t a) { return vget_lane_s32(a, 1); @@ -3369,18 +3361,14 @@ poly8_t test_vget_lane_p8(poly8x8_t a) { } // CHECK-LABEL: @test_vget_lane_p16( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> %a, i32 3 // CHECK: ret i16 [[VGET_LANE]] poly16_t test_vget_lane_p16(poly16x4_t a) { return vget_lane_p16(a, 3); } // CHECK-LABEL: @test_vget_lane_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x float> %a, i32 1 // CHECK: ret float [[VGET_LANE]] float32_t test_vget_lane_f32(float32x2_t a) { return vget_lane_f32(a, 1); @@ -3392,9 +3380,7 @@ float32_t test_vget_lane_f32(float32x2_t a) { // CHECK: store <4 x half> %a, <4 x half>* [[__REINT_242]], align 8 // CHECK: [[TMP0:%.*]] = bitcast <4 x half>* [[__REINT_242]] to <4 x i16>* // CHECK: [[TMP1:%.*]] = load <4 x i16>, <4 x i16>* [[TMP0]], align 8 -// CHECK: [[TMP2:%.*]] = bitcast <4 x i16> [[TMP1]] to <8 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <8 x i8> [[TMP2]] to <4 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP3]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i16> [[TMP1]], i32 1 // CHECK: store i16 [[VGET_LANE]], i16* [[__REINT1_242]], align 2 // CHECK: [[TMP4:%.*]] = bitcast i16* [[__REINT1_242]] to half* // CHECK: [[TMP5:%.*]] = load half, half* [[TMP4]], align 2 @@ -3412,18 +3398,14 @@ uint8_t test_vgetq_lane_u8(uint8x16_t a) { } // CHECK-LABEL: @test_vgetq_lane_u16( -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> %a, i32 7 // CHECK: ret i16 [[VGET_LANE]] uint16_t test_vgetq_lane_u16(uint16x8_t a) { return vgetq_lane_u16(a, 7); } // CHECK-LABEL: @test_vgetq_lane_u32( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i32> %a, i32 3 // CHECK: ret i32 [[VGET_LANE]] uint32_t test_vgetq_lane_u32(uint32x4_t a) { return vgetq_lane_u32(a, 3); @@ -3437,18 +3419,14 @@ int8_t test_vgetq_lane_s8(int8x16_t a) { } // CHECK-LABEL: @test_vgetq_lane_s16( -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> %a, i32 7 // CHECK: ret i16 [[VGET_LANE]] int16_t test_vgetq_lane_s16(int16x8_t a) { return vgetq_lane_s16(a, 7); } // CHECK-LABEL: @test_vgetq_lane_s32( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i32> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x i32> %a, i32 3 // CHECK: ret i32 [[VGET_LANE]] int32_t test_vgetq_lane_s32(int32x4_t a) { return vgetq_lane_s32(a, 3); @@ -3462,18 +3440,14 @@ poly8_t test_vgetq_lane_p8(poly8x16_t a) { } // CHECK-LABEL: @test_vgetq_lane_p16( -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 7 +// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> %a, i32 7 // CHECK: ret i16 [[VGET_LANE]] poly16_t test_vgetq_lane_p16(poly16x8_t a) { return vgetq_lane_p16(a, 7); } // CHECK-LABEL: @test_vgetq_lane_f32( -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x float> [[TMP1]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <4 x float> %a, i32 3 // CHECK: ret float [[VGET_LANE]] float32_t test_vgetq_lane_f32(float32x4_t a) { return vgetq_lane_f32(a, 3); @@ -3485,9 +3459,7 @@ float32_t test_vgetq_lane_f32(float32x4_t a) { // CHECK: store <8 x half> %a, <8 x half>* [[__REINT_244]], align 16 // CHECK: [[TMP0:%.*]] = bitcast <8 x half>* [[__REINT_244]] to <8 x i16>* // CHECK: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 16 -// CHECK: [[TMP2:%.*]] = bitcast <8 x i16> [[TMP1]] to <16 x i8> -// CHECK: [[TMP3:%.*]] = bitcast <16 x i8> [[TMP2]] to <8 x i16> -// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP3]], i32 3 +// CHECK: [[VGET_LANE:%.*]] = extractelement <8 x i16> [[TMP1]], i32 3 // CHECK: store i16 [[VGET_LANE]], i16* [[__REINT1_244]], align 2 // CHECK: [[TMP4:%.*]] = bitcast i16* [[__REINT1_244]] to half* // CHECK: [[TMP5:%.*]] = load half, half* [[TMP4]], align 2 @@ -3498,36 +3470,28 @@ float32_t test_vgetq_lane_f16(float16x8_t a) { } // CHECK-LABEL: @test_vget_lane_s64( -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0 // CHECK: ret i64 [[VGET_LANE]] int64_t test_vget_lane_s64(int64x1_t a) { return vget_lane_s64(a, 0); } // CHECK-LABEL: @test_vget_lane_u64( -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %a to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> [[TMP1]], i32 0 +// CHECK: [[VGET_LANE:%.*]] = extractelement <1 x i64> %a, i32 0 // CHECK: ret i64 [[VGET_LANE]] uint64_t test_vget_lane_u64(uint64x1_t a) { return vget_lane_u64(a, 0); } // CHECK-LABEL: @test_vgetq_lane_s64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i64> %a, i32 1 // CHECK: ret i64 [[VGET_LANE]] int64_t test_vgetq_lane_s64(int64x2_t a) { return vgetq_lane_s64(a, 1); } // CHECK-LABEL: @test_vgetq_lane_u64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %a to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1 +// CHECK: [[VGET_LANE:%.*]] = extractelement <2 x i64> %a, i32 1 // CHECK: ret i64 [[VGET_LANE]] uint64_t test_vgetq_lane_u64(uint64x2_t a) { return vgetq_lane_u64(a, 1); @@ -14061,18 +14025,14 @@ uint8x8_t test_vset_lane_u8(uint8_t a, uint8x8_t b) { } // CHECK-LABEL: @test_vset_lane_u16( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3 // CHECK: ret <4 x i16> [[VSET_LANE]] uint16x4_t test_vset_lane_u16(uint16_t a, uint16x4_t b) { return vset_lane_u16(a, b, 3); } // CHECK-LABEL: @test_vset_lane_u32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> [[TMP1]], i32 %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> %b, i32 %a, i32 1 // CHECK: ret <2 x i32> [[VSET_LANE]] uint32x2_t test_vset_lane_u32(uint32_t a, uint32x2_t b) { return vset_lane_u32(a, b, 1); @@ -14086,18 +14046,14 @@ int8x8_t test_vset_lane_s8(int8_t a, int8x8_t b) { } // CHECK-LABEL: @test_vset_lane_s16( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3 // CHECK: ret <4 x i16> [[VSET_LANE]] int16x4_t test_vset_lane_s16(int16_t a, int16x4_t b) { return vset_lane_s16(a, b, 3); } // CHECK-LABEL: @test_vset_lane_s32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i32> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> [[TMP1]], i32 %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i32> %b, i32 %a, i32 1 // CHECK: ret <2 x i32> [[VSET_LANE]] int32x2_t test_vset_lane_s32(int32_t a, int32x2_t b) { return vset_lane_s32(a, b, 1); @@ -14111,18 +14067,14 @@ poly8x8_t test_vset_lane_p8(poly8_t a, poly8x8_t b) { } // CHECK-LABEL: @test_vset_lane_p16( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i16> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <4 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP1]], i16 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> %b, i16 %a, i32 3 // CHECK: ret <4 x i16> [[VSET_LANE]] poly16x4_t test_vset_lane_p16(poly16_t a, poly16x4_t b) { return vset_lane_p16(a, b, 3); } // CHECK-LABEL: @test_vset_lane_f32( -// CHECK: [[TMP0:%.*]] = bitcast <2 x float> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <2 x float> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x float> [[TMP1]], float %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x float> %b, float %a, i32 1 // CHECK: ret <2 x float> [[VSET_LANE]] float32x2_t test_vset_lane_f32(float32_t a, float32x2_t b) { return vset_lane_f32(a, b, 1); @@ -14139,9 +14091,7 @@ float32x2_t test_vset_lane_f32(float32_t a, float32x2_t b) { // CHECK: [[TMP2:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK: [[TMP3:%.*]] = bitcast <4 x half>* [[__REINT1_246]] to <4 x i16>* // CHECK: [[TMP4:%.*]] = load <4 x i16>, <4 x i16>* [[TMP3]], align 8 -// CHECK: [[TMP5:%.*]] = bitcast <4 x i16> [[TMP4]] to <8 x i8> -// CHECK: [[TMP6:%.*]] = bitcast <8 x i8> [[TMP5]] to <4 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP6]], i16 [[TMP2]], i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i16> [[TMP4]], i16 [[TMP2]], i32 1 // CHECK: store <4 x i16> [[VSET_LANE]], <4 x i16>* [[__REINT2_246]], align 8 // CHECK: [[TMP7:%.*]] = bitcast <4 x i16>* [[__REINT2_246]] to <4 x half>* // CHECK: [[TMP8:%.*]] = load <4 x half>, <4 x half>* [[TMP7]], align 8 @@ -14158,18 +14108,14 @@ uint8x16_t test_vsetq_lane_u8(uint8_t a, uint8x16_t b) { } // CHECK-LABEL: @test_vsetq_lane_u16( -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7 // CHECK: ret <8 x i16> [[VSET_LANE]] uint16x8_t test_vsetq_lane_u16(uint16_t a, uint16x8_t b) { return vsetq_lane_u16(a, b, 7); } // CHECK-LABEL: @test_vsetq_lane_u32( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP1]], i32 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %b, i32 %a, i32 3 // CHECK: ret <4 x i32> [[VSET_LANE]] uint32x4_t test_vsetq_lane_u32(uint32_t a, uint32x4_t b) { return vsetq_lane_u32(a, b, 3); @@ -14183,18 +14129,14 @@ int8x16_t test_vsetq_lane_s8(int8_t a, int8x16_t b) { } // CHECK-LABEL: @test_vsetq_lane_s16( -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7 // CHECK: ret <8 x i16> [[VSET_LANE]] int16x8_t test_vsetq_lane_s16(int16_t a, int16x8_t b) { return vsetq_lane_s16(a, b, 7); } // CHECK-LABEL: @test_vsetq_lane_s32( -// CHECK: [[TMP0:%.*]] = bitcast <4 x i32> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x i32> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> [[TMP1]], i32 %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x i32> %b, i32 %a, i32 3 // CHECK: ret <4 x i32> [[VSET_LANE]] int32x4_t test_vsetq_lane_s32(int32_t a, int32x4_t b) { return vsetq_lane_s32(a, b, 3); @@ -14208,18 +14150,14 @@ poly8x16_t test_vsetq_lane_p8(poly8_t a, poly8x16_t b) { } // CHECK-LABEL: @test_vsetq_lane_p16( -// CHECK: [[TMP0:%.*]] = bitcast <8 x i16> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP1]], i16 %a, i32 7 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> %b, i16 %a, i32 7 // CHECK: ret <8 x i16> [[VSET_LANE]] poly16x8_t test_vsetq_lane_p16(poly16_t a, poly16x8_t b) { return vsetq_lane_p16(a, b, 7); } // CHECK-LABEL: @test_vsetq_lane_f32( -// CHECK: [[TMP0:%.*]] = bitcast <4 x float> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <4 x float> -// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> [[TMP1]], float %a, i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <4 x float> %b, float %a, i32 3 // CHECK: ret <4 x float> [[VSET_LANE]] float32x4_t test_vsetq_lane_f32(float32_t a, float32x4_t b) { return vsetq_lane_f32(a, b, 3); @@ -14236,9 +14174,7 @@ float32x4_t test_vsetq_lane_f32(float32_t a, float32x4_t b) { // CHECK: [[TMP2:%.*]] = load i16, i16* [[TMP1]], align 2 // CHECK: [[TMP3:%.*]] = bitcast <8 x half>* [[__REINT1_248]] to <8 x i16>* // CHECK: [[TMP4:%.*]] = load <8 x i16>, <8 x i16>* [[TMP3]], align 16 -// CHECK: [[TMP5:%.*]] = bitcast <8 x i16> [[TMP4]] to <16 x i8> -// CHECK: [[TMP6:%.*]] = bitcast <16 x i8> [[TMP5]] to <8 x i16> -// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP6]], i16 [[TMP2]], i32 3 +// CHECK: [[VSET_LANE:%.*]] = insertelement <8 x i16> [[TMP4]], i16 [[TMP2]], i32 3 // CHECK: store <8 x i16> [[VSET_LANE]], <8 x i16>* [[__REINT2_248]], align 16 // CHECK: [[TMP7:%.*]] = bitcast <8 x i16>* [[__REINT2_248]] to <8 x half>* // CHECK: [[TMP8:%.*]] = load <8 x half>, <8 x half>* [[TMP7]], align 16 @@ -14248,36 +14184,28 @@ float16x8_t test_vsetq_lane_f16(float16_t *a, float16x8_t b) { } // CHECK-LABEL: @test_vset_lane_s64( -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %b, i64 %a, i32 0 // CHECK: ret <1 x i64> [[VSET_LANE]] int64x1_t test_vset_lane_s64(int64_t a, int64x1_t b) { return vset_lane_s64(a, b, 0); } // CHECK-LABEL: @test_vset_lane_u64( -// CHECK: [[TMP0:%.*]] = bitcast <1 x i64> %b to <8 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <8 x i8> [[TMP0]] to <1 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> [[TMP1]], i64 %a, i32 0 +// CHECK: [[VSET_LANE:%.*]] = insertelement <1 x i64> %b, i64 %a, i32 0 // CHECK: ret <1 x i64> [[VSET_LANE]] uint64x1_t test_vset_lane_u64(uint64_t a, uint64x1_t b) { return vset_lane_u64(a, b, 0); } // CHECK-LABEL: @test_vsetq_lane_s64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %b, i64 %a, i32 1 // CHECK: ret <2 x i64> [[VSET_LANE]] int64x2_t test_vsetq_lane_s64(int64_t a, int64x2_t b) { return vsetq_lane_s64(a, b, 1); } // CHECK-LABEL: @test_vsetq_lane_u64( -// CHECK: [[TMP0:%.*]] = bitcast <2 x i64> %b to <16 x i8> -// CHECK: [[TMP1:%.*]] = bitcast <16 x i8> [[TMP0]] to <2 x i64> -// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> [[TMP1]], i64 %a, i32 1 +// CHECK: [[VSET_LANE:%.*]] = insertelement <2 x i64> %b, i64 %a, i32 1 // CHECK: ret <2 x i64> [[VSET_LANE]] uint64x2_t test_vsetq_lane_u64(uint64_t a, uint64x2_t b) { return vsetq_lane_u64(a, b, 1); diff --git a/clang/test/Headers/arm-neon-header.c b/clang/test/Headers/arm-neon-header.c index e8ab33d7702c9..251075ff354f7 100644 --- a/clang/test/Headers/arm-neon-header.c +++ b/clang/test/Headers/arm-neon-header.c @@ -20,4 +20,7 @@ // RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s // RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s +// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c11 -xc -flax-vector-conversions=none %s +// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding --target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c11 -xc -flax-vector-conversions=none %s + #include diff --git a/clang/utils/TableGen/NeonEmitter.cpp b/clang/utils/TableGen/NeonEmitter.cpp index f420fa6a8c893..283747dd3b68c 100644 --- a/clang/utils/TableGen/NeonEmitter.cpp +++ b/clang/utils/TableGen/NeonEmitter.cpp @@ -636,7 +636,7 @@ std::string Type::builtin_str() const { default: llvm_unreachable("Unhandled case!"); } - if (isChar() && !Pointer) + if (isChar() && !Pointer && Signed) // Make chars explicitly signed. S = "S" + S; else if (isInteger() && !Pointer && !Signed) @@ -1442,7 +1442,7 @@ void Intrinsic::emitBodyAsBuiltinCall() { } // Check if an explicit cast is needed. - if (CastToType.isVector()) { + if (CastToType.isVector() && LocalCK == ClassB) { CastToType.makeInteger(8, true); Arg = "(" + CastToType.str() + ")" + Arg; } From 70aa6fb6e301c40c5d0c88ee56f275e3a183b575 Mon Sep 17 00:00:00 2001 From: Antonio Afonso Date: Wed, 9 Oct 2019 18:02:59 +0000 Subject: [PATCH 24/44] Update breakpad lit test to be independent of the unnamed symbol number llvm-svn: 374192 --- lldb/lit/SymbolFile/Breakpad/symtab.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/lit/SymbolFile/Breakpad/symtab.test b/lldb/lit/SymbolFile/Breakpad/symtab.test index caeaa87ca3818..65bf9517461f9 100644 --- a/lldb/lit/SymbolFile/Breakpad/symtab.test +++ b/lldb/lit/SymbolFile/Breakpad/symtab.test @@ -5,7 +5,7 @@ # CHECK-LABEL: (lldb) image dump symtab symtab.out # CHECK: Symtab, file = {{.*}}symtab.out, num_symbols = 5: # CHECK: Index UserID DSX Type File Address/Value Load Address Size Flags Name -# CHECK: [ 0] 0 SX Code 0x0000000000400000 0x00000000000000b0 0x00000000 ___lldb_unnamed_symbol1$$symtab.out +# CHECK: [ 0] 0 SX Code 0x0000000000400000 0x00000000000000b0 0x00000000 ___lldb_unnamed_symbol{{[0-9]*}}$$symtab.out # CHECK: [ 1] 0 X Code 0x00000000004000c0 0x0000000000000010 0x00000000 f2 # CHECK: [ 2] 0 X Code 0x00000000004000d0 0x0000000000000022 0x00000000 _start # CHECK: [ 3] 0 X Code 0x00000000004000a0 0x000000000000000d 0x00000000 func_only From 72c7c21dda99bf2a388255ea167914771704a6f9 Mon Sep 17 00:00:00 2001 From: Julian Lettner Date: Wed, 9 Oct 2019 18:23:30 +0000 Subject: [PATCH 25/44] [lit] Refactor ProgressDisplay Move progress display to separate file. Simplify some code paths. Decouple from other components via progress callback. Remove unused `_Display` class. Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D68525 llvm-svn: 374194 --- llvm/utils/lit/lit/ProgressBar.py | 4 +- llvm/utils/lit/lit/display.py | 98 +++++++++++++++++++++++++ llvm/utils/lit/lit/main.py | 103 ++++----------------------- llvm/utils/lit/lit/run.py | 29 ++------ llvm/utils/lit/tests/progress-bar.py | 9 +-- 5 files changed, 124 insertions(+), 119 deletions(-) create mode 100644 llvm/utils/lit/lit/display.py diff --git a/llvm/utils/lit/lit/ProgressBar.py b/llvm/utils/lit/lit/ProgressBar.py index 3ad704d16c920..cfe6d70ff2fde 100644 --- a/llvm/utils/lit/lit/ProgressBar.py +++ b/llvm/utils/lit/lit/ProgressBar.py @@ -172,7 +172,7 @@ class SimpleProgressBar: A simple progress bar which doesn't need any terminal support. This prints out a progress bar like: - 'Header: 0 .. 10.. 20.. ...' + 'Header: 0.. 10.. 20.. ...' """ def __init__(self, header): @@ -191,7 +191,7 @@ def update(self, percent, message): for i in range(self.atIndex, next): idx = i % 5 if idx == 0: - sys.stdout.write('%-2d' % (i*2)) + sys.stdout.write('%2d' % (i*2)) elif idx == 1: pass # Skip second char elif idx < 4: diff --git a/llvm/utils/lit/lit/display.py b/llvm/utils/lit/lit/display.py new file mode 100644 index 0000000000000..5c6d6b6e08e4f --- /dev/null +++ b/llvm/utils/lit/lit/display.py @@ -0,0 +1,98 @@ +import sys + +import lit.ProgressBar + +def create_display(opts, tests, total_tests, workers): + if opts.quiet: + return NopProgressDisplay() + + of_total = (' of %d' % total_tests) if (tests != total_tests) else '' + header = '-- Testing: %d%s tests, %d workers --' % (tests, of_total, workers) + + progress_bar = None + if opts.succinct and opts.useProgressBar: + try: + tc = lit.ProgressBar.TerminalController() + progress_bar = lit.ProgressBar.ProgressBar(tc, header) + except ValueError: + print(header) + progress_bar = lit.ProgressBar.SimpleProgressBar('Testing: ') + else: + print(header) + + if progress_bar: + progress_bar.update(0, '') + + return ProgressDisplay(opts, tests, progress_bar) + +class NopProgressDisplay(object): + def update(self, test): pass + def finish(self): pass + +class ProgressDisplay(object): + def __init__(self, opts, numTests, progressBar): + self.opts = opts + self.numTests = numTests + self.progressBar = progressBar + self.completed = 0 + + def finish(self): + if self.progressBar: + self.progressBar.clear() + elif self.opts.succinct: + sys.stdout.write('\n') + + def update(self, test): + self.completed += 1 + + show_result = test.result.code.isFailure or \ + self.opts.showAllOutput or \ + (not self.opts.quiet and not self.opts.succinct) + if show_result: + self.print_result(test) + + if self.progressBar: + percent = float(self.completed) / self.numTests + self.progressBar.update(percent, test.getFullName()) + + def print_result(self, test): + if self.progressBar: + self.progressBar.clear() + + # Show the test result line. + test_name = test.getFullName() + print('%s: %s (%d of %d)' % (test.result.code.name, test_name, + self.completed, self.numTests)) + + # Show the test failure output, if requested. + if (test.result.code.isFailure and self.opts.showOutput) or \ + self.opts.showAllOutput: + if test.result.code.isFailure: + print("%s TEST '%s' FAILED %s" % ('*'*20, test.getFullName(), + '*'*20)) + print(test.result.output) + print("*" * 20) + + # Report test metrics, if present. + if test.result.metrics: + print("%s TEST '%s' RESULTS %s" % ('*'*10, test.getFullName(), + '*'*10)) + items = sorted(test.result.metrics.items()) + for metric_name, value in items: + print('%s: %s ' % (metric_name, value.format())) + print("*" * 10) + + # Report micro-tests, if present + if test.result.microResults: + items = sorted(test.result.microResults.items()) + for micro_test_name, micro_test in items: + print("%s MICRO-TEST: %s" % + ('*'*3, micro_test_name)) + + if micro_test.metrics: + sorted_metrics = sorted(micro_test.metrics.items()) + for metric_name, value in sorted_metrics: + print(' %s: %s ' % (metric_name, value.format())) + + # Ensure the output is flushed. + sys.stdout.flush() diff --git a/llvm/utils/lit/lit/main.py b/llvm/utils/lit/lit/main.py index fc9c0b406c64e..53e3a88b7b33c 100755 --- a/llvm/utils/lit/lit/main.py +++ b/llvm/utils/lit/lit/main.py @@ -19,84 +19,12 @@ import shutil from xml.sax.saxutils import quoteattr -import lit.ProgressBar +import lit.discovery +import lit.display import lit.LitConfig -import lit.Test import lit.run +import lit.Test import lit.util -import lit.discovery - -class TestingProgressDisplay(object): - def __init__(self, opts, numTests, progressBar=None): - self.opts = opts - self.numTests = numTests - self.progressBar = progressBar - self.completed = 0 - - def finish(self): - if self.progressBar: - self.progressBar.clear() - elif self.opts.quiet: - pass - elif self.opts.succinct: - sys.stdout.write('\n') - - def update(self, test): - self.completed += 1 - - if self.opts.incremental: - update_incremental_cache(test) - - if self.progressBar: - self.progressBar.update(float(self.completed)/self.numTests, - test.getFullName()) - - shouldShow = test.result.code.isFailure or \ - self.opts.showAllOutput or \ - (not self.opts.quiet and not self.opts.succinct) - if not shouldShow: - return - - if self.progressBar: - self.progressBar.clear() - - # Show the test result line. - test_name = test.getFullName() - print('%s: %s (%d of %d)' % (test.result.code.name, test_name, - self.completed, self.numTests)) - - # Show the test failure output, if requested. - if (test.result.code.isFailure and self.opts.showOutput) or \ - self.opts.showAllOutput: - if test.result.code.isFailure: - print("%s TEST '%s' FAILED %s" % ('*'*20, test.getFullName(), - '*'*20)) - print(test.result.output) - print("*" * 20) - - # Report test metrics, if present. - if test.result.metrics: - print("%s TEST '%s' RESULTS %s" % ('*'*10, test.getFullName(), - '*'*10)) - items = sorted(test.result.metrics.items()) - for metric_name, value in items: - print('%s: %s ' % (metric_name, value.format())) - print("*" * 10) - - # Report micro-tests, if present - if test.result.microResults: - items = sorted(test.result.microResults.items()) - for micro_test_name, micro_test in items: - print("%s MICRO-TEST: %s" % - ('*'*3, micro_test_name)) - - if micro_test.metrics: - sorted_metrics = sorted(micro_test.metrics.items()) - for metric_name, value in sorted_metrics: - print(' %s: %s ' % (metric_name, value.format())) - - # Ensure the output is flushed. - sys.stdout.flush() def write_test_results(run, lit_config, testing_time, output_path): try: @@ -505,29 +433,22 @@ def main_with_tmp(builtinParameters): except: pass - extra = (' of %d' % numTotalTests) if (len(run.tests) != numTotalTests) else '' - header = '-- Testing: %d%s tests, %d workers --' % (len(run.tests), extra, opts.numWorkers) - progressBar = None - if not opts.quiet: - if opts.succinct and opts.useProgressBar: - try: - tc = lit.ProgressBar.TerminalController() - progressBar = lit.ProgressBar.ProgressBar(tc, header) - except ValueError: - print(header) - progressBar = lit.ProgressBar.SimpleProgressBar('Testing: ') - else: - print(header) + display = lit.display.create_display(opts, len(run.tests), + numTotalTests, opts.numWorkers) + def progress_callback(test): + display.update(test) + if opts.incremental: + update_incremental_cache(test) startTime = time.time() - display = TestingProgressDisplay(opts, len(run.tests), progressBar) try: - run.execute_tests(display, opts.numWorkers, opts.maxTime) + run.execute_tests(progress_callback, opts.numWorkers, opts.maxTime) except KeyboardInterrupt: sys.exit(2) + testing_time = time.time() - startTime + display.finish() - testing_time = time.time() - startTime if not opts.quiet: print('Testing Time: %.2fs' % (testing_time,)) diff --git a/llvm/utils/lit/lit/run.py b/llvm/utils/lit/lit/run.py index dbd0822b695e2..ecd6bbec6824c 100644 --- a/llvm/utils/lit/lit/run.py +++ b/llvm/utils/lit/lit/run.py @@ -5,18 +5,6 @@ import lit.util import lit.worker -class _Display(object): - def __init__(self, display, provider, maxFailures): - self.display = display - self.provider = provider - self.maxFailures = maxFailures or object() - self.failedCount = 0 - def update(self, test): - self.display.update(test) - self.failedCount += (test.result.code == lit.Test.FAIL) - if self.failedCount == self.maxFailures: - self.provider.cancel() - # No-operation semaphore for supporting `None` for parallelism_groups. # lit_config.parallelism_groups['my_group'] = None class NopSemaphore(object): @@ -93,21 +81,20 @@ def console_ctrl_handler(type): finally: pool.join() - def execute_tests(self, display, workers, max_time=None): + def execute_tests(self, progress_callback, workers, max_time): """ - execute_tests(display, workers, [max_time]) + execute_tests(progress_callback, workers, max_time) Execute the tests in the run using up to the specified number of - parallel tasks, and inform the display of each individual result. The + parallel tasks, and inform the caller of each individual result. The provided tests should be a subset of the tests available in this run object. + The progress_callback will be invoked for each completed test. + If max_time is non-None, it should be a time in seconds after which to stop executing tests. - The display object will have its update method called for each completed - test. - Upon completion, each test in the run will have its result computed. Tests which were not actually executed (for any reason) will be given an UNRESOLVED result. @@ -116,9 +103,7 @@ def execute_tests(self, display, workers, max_time=None): if not self.tests: return - # Save the display object on the runner so that we can update it from - # our task completion callback. - self.display = display + self.progress_callback = progress_callback self.failure_count = 0 self.hit_max_failures = False @@ -156,7 +141,7 @@ def consume_test_result(self, pool_result): assert self.tests[test_index].file_path == test_with_result.file_path, \ "parent and child disagree on test path" self.tests[test_index] = test_with_result - self.display.update(test_with_result) + self.progress_callback(test_with_result) # If we've finished all the tests or too many tests have failed, notify # the main thread that we've stopped testing. diff --git a/llvm/utils/lit/tests/progress-bar.py b/llvm/utils/lit/tests/progress-bar.py index e9429d907cac8..ceeca68712bff 100644 --- a/llvm/utils/lit/tests/progress-bar.py +++ b/llvm/utils/lit/tests/progress-bar.py @@ -3,11 +3,12 @@ # RUN: not %{lit} -j 1 -s %{inputs}/progress-bar > %t.out # RUN: FileCheck < %t.out %s # -# CHECK: Testing: 0 .. 10.. 20 +# CHECK: Testing: # CHECK: FAIL: progress-bar :: test-1.txt (1 of 4) -# CHECK: Testing: 0 .. 10.. 20.. 30.. 40.. +# CHECK: Testing: 0.. 10.. 20 # CHECK: FAIL: progress-bar :: test-2.txt (2 of 4) -# CHECK: Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70 +# CHECK: Testing: 0.. 10.. 20.. 30.. 40.. # CHECK: FAIL: progress-bar :: test-3.txt (3 of 4) -# CHECK: Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. +# CHECK: Testing: 0.. 10.. 20.. 30.. 40.. 50.. 60.. 70 # CHECK: FAIL: progress-bar :: test-4.txt (4 of 4) +# CHECK: Testing: 0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. From 89386daa9571add3bc30311dc0902f82a1148a4c Mon Sep 17 00:00:00 2001 From: Cameron Desrochers Date: Wed, 9 Oct 2019 18:27:33 +0000 Subject: [PATCH 26/44] [LLDB] Fix for synthetic children memory leak The lifetime of a ValueObject and all its derivative ValueObjects (children, clones, etc.) is managed by a ClusterManager. These objects are only destroyed when every shared pointer to any of the managed objects in the cluster is destroyed. This means that no object in the cluster can store a shared pointer to another object in the cluster without creating a memory leak of the entire cluster. However, some of the synthetic children front-end implementations do exactly this; this patch fixes that. Differential Revision: https://reviews.llvm.org/D68641 llvm-svn: 374195 --- .../Language/CPlusPlus/LibCxxBitset.cpp | 15 ++++++-- .../Language/CPlusPlus/LibCxxOptional.cpp | 1 - .../Language/CPlusPlus/LibCxxQueue.cpp | 11 ++++-- .../Language/CPlusPlus/LibCxxTuple.cpp | 37 ++++++++++++------- .../Language/CPlusPlus/LibCxxVariant.cpp | 1 - .../Language/CPlusPlus/LibStdcppTuple.cpp | 11 ++++-- .../CPlusPlus/LibStdcppUniquePointer.cpp | 23 +++++++----- 7 files changed, 64 insertions(+), 35 deletions(-) diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp index 815dafb6c7242..78c453cd1b3c7 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxBitset.cpp @@ -30,8 +30,15 @@ class BitsetFrontEnd : public SyntheticChildrenFrontEnd { ValueObjectSP GetChildAtIndex(size_t idx) override; private: + // The lifetime of a ValueObject and all its derivative ValueObjects + // (children, clones, etc.) is managed by a ClusterManager. These + // objects are only destroyed when every shared pointer to any of them + // is destroyed, so we must not store a shared pointer to any ValueObject + // derived from our backend ValueObject (since we're in the same cluster). + // Value objects created from raw data (i.e. in a different cluster) must + // be referenced via shared pointer to keep them alive, however. std::vector m_elements; - ValueObjectSP m_first; + ValueObject* m_first = nullptr; CompilerType m_bool_type; ByteOrder m_byte_order = eByteOrderInvalid; uint8_t m_byte_size = 0; @@ -50,7 +57,7 @@ BitsetFrontEnd::BitsetFrontEnd(ValueObject &valobj) bool BitsetFrontEnd::Update() { m_elements.clear(); - m_first.reset(); + m_first = nullptr; TargetSP target_sp = m_backend.GetTargetSP(); if (!target_sp) @@ -63,7 +70,7 @@ bool BitsetFrontEnd::Update() { m_elements.assign(size, ValueObjectSP()); - m_first = m_backend.GetChildMemberWithName(ConstString("__first_"), true); + m_first = m_backend.GetChildMemberWithName(ConstString("__first_"), true).get(); return false; } @@ -86,7 +93,7 @@ ValueObjectSP BitsetFrontEnd::GetChildAtIndex(size_t idx) { chunk = m_first->GetChildAtIndex(idx / *bit_size, true); } else { type = m_first->GetCompilerType(); - chunk = m_first; + chunk = m_first->GetSP(); } if (!type || !chunk) return {}; diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp index 116021588848c..b1ad171d0b0c6 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxOptional.cpp @@ -31,7 +31,6 @@ class OptionalFrontEnd : public SyntheticChildrenFrontEnd { private: size_t m_size = 0; - ValueObjectSP m_base_sp; }; } // namespace diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp index 4b72089c6ba2e..2f06d684f953c 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp @@ -38,16 +38,21 @@ class QueueFrontEnd : public SyntheticChildrenFrontEnd { } private: - ValueObjectSP m_container_sp; + // The lifetime of a ValueObject and all its derivative ValueObjects + // (children, clones, etc.) is managed by a ClusterManager. These + // objects are only destroyed when every shared pointer to any of them + // is destroyed, so we must not store a shared pointer to any ValueObject + // derived from our backend ValueObject (since we're in the same cluster). + ValueObject* m_container_sp = nullptr; }; } // namespace bool QueueFrontEnd::Update() { - m_container_sp.reset(); + m_container_sp = nullptr; ValueObjectSP c_sp = m_backend.GetChildMemberWithName(ConstString("c"), true); if (!c_sp) return false; - m_container_sp = c_sp->GetSyntheticValue(); + m_container_sp = c_sp->GetSyntheticValue().get(); return false; } diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp index 8da7460f2275f..c86ab6be64449 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp @@ -30,47 +30,56 @@ class TupleFrontEnd: public SyntheticChildrenFrontEnd { ValueObjectSP GetChildAtIndex(size_t idx) override; private: - std::vector m_elements; - ValueObjectSP m_base_sp; + // The lifetime of a ValueObject and all its derivative ValueObjects + // (children, clones, etc.) is managed by a ClusterManager. These + // objects are only destroyed when every shared pointer to any of them + // is destroyed, so we must not store a shared pointer to any ValueObject + // derived from our backend ValueObject (since we're in the same cluster). + std::vector m_elements; + ValueObject* m_base = nullptr; }; } bool TupleFrontEnd::Update() { m_elements.clear(); - m_base_sp = m_backend.GetChildMemberWithName(ConstString("__base_"), true); - if (! m_base_sp) { + m_base = nullptr; + + ValueObjectSP base_sp; + base_sp = m_backend.GetChildMemberWithName(ConstString("__base_"), true); + if (!base_sp) { // Pre r304382 name of the base element. - m_base_sp = m_backend.GetChildMemberWithName(ConstString("base_"), true); + base_sp = m_backend.GetChildMemberWithName(ConstString("base_"), true); } - if (! m_base_sp) + if (!base_sp) return false; - m_elements.assign(m_base_sp->GetCompilerType().GetNumDirectBaseClasses(), - ValueObjectSP()); + m_base = base_sp.get(); + m_elements.assign(base_sp->GetCompilerType().GetNumDirectBaseClasses(), + nullptr); return false; } ValueObjectSP TupleFrontEnd::GetChildAtIndex(size_t idx) { if (idx >= m_elements.size()) return ValueObjectSP(); - if (!m_base_sp) + if (!m_base) return ValueObjectSP(); if (m_elements[idx]) - return m_elements[idx]; + return m_elements[idx]->GetSP(); CompilerType holder_type = - m_base_sp->GetCompilerType().GetDirectBaseClassAtIndex(idx, nullptr); + m_base->GetCompilerType().GetDirectBaseClassAtIndex(idx, nullptr); if (!holder_type) return ValueObjectSP(); - ValueObjectSP holder_sp = m_base_sp->GetChildAtIndex(idx, true); + ValueObjectSP holder_sp = m_base->GetChildAtIndex(idx, true); if (!holder_sp) return ValueObjectSP(); ValueObjectSP elem_sp = holder_sp->GetChildAtIndex(0, true); if (elem_sp) m_elements[idx] = - elem_sp->Clone(ConstString(llvm::formatv("[{0}]", idx).str())); + elem_sp->Clone(ConstString(llvm::formatv("[{0}]", idx).str())).get(); - return m_elements[idx]; + return m_elements[idx]->GetSP(); } SyntheticChildrenFrontEnd * diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp index 491cf048e4592..62945bd3ce80b 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxVariant.cpp @@ -184,7 +184,6 @@ class VariantFrontEnd : public SyntheticChildrenFrontEnd { private: size_t m_size = 0; - ValueObjectSP m_base_sp; }; } // namespace diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp index 66624e5beb6dc..15bf7f8cf1dcd 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp @@ -37,7 +37,12 @@ class LibStdcppTupleSyntheticFrontEnd : public SyntheticChildrenFrontEnd { size_t GetIndexOfChildWithName(ConstString name) override; private: - std::vector m_members; + // The lifetime of a ValueObject and all its derivative ValueObjects + // (children, clones, etc.) is managed by a ClusterManager. These + // objects are only destroyed when every shared pointer to any of them + // is destroyed, so we must not store a shared pointer to any ValueObject + // derived from our backend ValueObject (since we're in the same cluster). + std::vector m_members; }; } // end of anonymous namespace @@ -72,7 +77,7 @@ bool LibStdcppTupleSyntheticFrontEnd::Update() { if (value_sp) { StreamString name; name.Printf("[%zd]", m_members.size()); - m_members.push_back(value_sp->Clone(ConstString(name.GetString()))); + m_members.push_back(value_sp->Clone(ConstString(name.GetString())).get()); } } } @@ -86,7 +91,7 @@ bool LibStdcppTupleSyntheticFrontEnd::MightHaveChildren() { return true; } lldb::ValueObjectSP LibStdcppTupleSyntheticFrontEnd::GetChildAtIndex(size_t idx) { if (idx < m_members.size()) - return m_members[idx]; + return m_members[idx]->GetSP(); return lldb::ValueObjectSP(); } diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp index 3860f960cb3de..84f9e57015f81 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp @@ -39,9 +39,14 @@ class LibStdcppUniquePtrSyntheticFrontEnd : public SyntheticChildrenFrontEnd { bool GetSummary(Stream &stream, const TypeSummaryOptions &options); private: - ValueObjectSP m_ptr_obj; - ValueObjectSP m_obj_obj; - ValueObjectSP m_del_obj; + // The lifetime of a ValueObject and all its derivative ValueObjects + // (children, clones, etc.) is managed by a ClusterManager. These + // objects are only destroyed when every shared pointer to any of them + // is destroyed, so we must not store a shared pointer to any ValueObject + // derived from our backend ValueObject (since we're in the same cluster). + ValueObject* m_ptr_obj = nullptr; + ValueObject* m_obj_obj = nullptr; + ValueObject* m_del_obj = nullptr; ValueObjectSP GetTuple(); }; @@ -92,17 +97,17 @@ bool LibStdcppUniquePtrSyntheticFrontEnd::Update() { ValueObjectSP ptr_obj = tuple_frontend->GetChildAtIndex(0); if (ptr_obj) - m_ptr_obj = ptr_obj->Clone(ConstString("pointer")); + m_ptr_obj = ptr_obj->Clone(ConstString("pointer")).get(); ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1); if (del_obj) - m_del_obj = del_obj->Clone(ConstString("deleter")); + m_del_obj = del_obj->Clone(ConstString("deleter")).get(); if (m_ptr_obj) { Status error; ValueObjectSP obj_obj = m_ptr_obj->Dereference(error); if (error.Success()) { - m_obj_obj = obj_obj->Clone(ConstString("object")); + m_obj_obj = obj_obj->Clone(ConstString("object")).get(); } } @@ -114,11 +119,11 @@ bool LibStdcppUniquePtrSyntheticFrontEnd::MightHaveChildren() { return true; } lldb::ValueObjectSP LibStdcppUniquePtrSyntheticFrontEnd::GetChildAtIndex(size_t idx) { if (idx == 0) - return m_ptr_obj; + return m_ptr_obj->GetSP(); if (idx == 1) - return m_del_obj; + return m_del_obj->GetSP(); if (idx == 2) - return m_obj_obj; + return m_obj_obj->GetSP(); return lldb::ValueObjectSP(); } From 746174706b22a506e6baac339c3fcce0cce24063 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 9 Oct 2019 18:37:13 +0000 Subject: [PATCH 27/44] DebugInfo: Shot in the dark attempt to fix ubsan error from r374122 (specifying an underlying type for the enum might also be suitable - but this seems better/as good, since there's a clear expectation this can contain values other than the actual enumerators of this enum) llvm-svn: 374196 --- llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp index a5f79f86852ff..a243ed3a80bea 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp @@ -143,7 +143,7 @@ DWARFDebugLoclists::parseOneLocationList(const DataExtractor &Data, DataExtractor::Cursor C(*Offset); // dwarf::DW_LLE_end_of_list_entry is 0 and indicates the end of the list. - while (auto Kind = static_cast(Data.getU8(C))) { + while (auto Kind = Data.getU8(C)) { Entry E; E.Kind = Kind; switch (Kind) { From 609010d0631a9329b6b0a68cb8a5e0dcb28797f8 Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Wed, 9 Oct 2019 18:43:03 +0000 Subject: [PATCH 28/44] protect libedit and LLDB gui from receiving null FILE* streams Summary: We now have valid files that will return NULL from GetStream(). libedit and the LLDB gui are the only places left that need FILE* streams. Both are doing curses-like user interaction that only make sense with a real terminal anyway, so there is no need to convert them off of their use of FILE*. But we should check for null streams before enabling these features. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: JDevlieghere, labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68677 llvm-svn: 374197 --- lldb/source/Commands/CommandObjectGUI.cpp | 4 +++- lldb/source/Core/IOHandler.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lldb/source/Commands/CommandObjectGUI.cpp b/lldb/source/Commands/CommandObjectGUI.cpp index 09cb685a42f28..fac2e96277839 100644 --- a/lldb/source/Commands/CommandObjectGUI.cpp +++ b/lldb/source/Commands/CommandObjectGUI.cpp @@ -29,7 +29,9 @@ bool CommandObjectGUI::DoExecute(Args &args, CommandReturnObject &result) { Debugger &debugger = GetDebugger(); File &input = debugger.GetInputFile(); - if (input.GetIsRealTerminal() && input.GetIsInteractive()) { + File &output = debugger.GetOutputFile(); + if (input.GetStream() && output.GetStream() && input.GetIsRealTerminal() && + input.GetIsInteractive()) { IOHandlerSP io_handler_sp(new IOHandlerCursesGUI(debugger)); if (io_handler_sp) debugger.PushIOHandler(io_handler_sp); diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp index 6f4b1df6ad4c2..350a538350777 100644 --- a/lldb/source/Core/IOHandler.cpp +++ b/lldb/source/Core/IOHandler.cpp @@ -266,7 +266,8 @@ IOHandlerEditline::IOHandlerEditline( #ifndef LLDB_DISABLE_LIBEDIT bool use_editline = false; - use_editline = m_input_sp && m_input_sp->GetIsRealTerminal(); + use_editline = GetInputFILE() && GetOutputFILE() && GetErrorFILE() && + m_input_sp && m_input_sp->GetIsRealTerminal(); if (use_editline) { m_editline_up.reset(new Editline(editline_name, GetInputFILE(), From bc2350a3412676977ec2ffc801e661aa0cec9de6 Mon Sep 17 00:00:00 2001 From: Yaxun Liu Date: Wed, 9 Oct 2019 18:46:43 +0000 Subject: [PATCH 29/44] [HIP] Fix -save-temps Currently clang does not save some of the intermediate file generated during device compilation for HIP when -save-temps is specified. This patch fixes that. Differential Revision: https://reviews.llvm.org/D68665 llvm-svn: 374198 --- clang/lib/Driver/Driver.cpp | 11 +++++ clang/lib/Driver/ToolChains/CommonArgs.cpp | 26 ++++++------ clang/lib/Driver/ToolChains/HIP.cpp | 49 ++++++++++++++-------- clang/lib/Driver/ToolChains/HIP.h | 3 +- clang/test/Driver/hip-save-temps.hip | 41 ++++++++++++++++++ 5 files changed, 98 insertions(+), 32 deletions(-) create mode 100644 clang/test/Driver/hip-save-temps.hip diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index df3e82b85e5c0..a095274298271 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -4419,11 +4419,22 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA, MakeCLOutputFilename(C.getArgs(), "", BaseName, types::TY_Image); } else { SmallString<128> Output(getDefaultImageName()); + // HIP image for device compilation with -fno-gpu-rdc is per compilation + // unit. + bool IsHIPNoRDC = JA.getOffloadingDeviceKind() == Action::OFK_HIP && + !C.getArgs().hasFlag(options::OPT_fgpu_rdc, + options::OPT_fno_gpu_rdc, false); + if (IsHIPNoRDC) { + Output = BaseName; + llvm::sys::path::replace_extension(Output, ""); + } Output += OffloadingPrefix; if (MultipleArchs && !BoundArch.empty()) { Output += "-"; Output.append(BoundArch); } + if (IsHIPNoRDC) + Output += ".out"; NamedOutput = C.getArgs().MakeArgString(Output.c_str()); } } else if (JA.getType() == types::TY_PCH && IsCLMode()) { diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp index 18b182424095f..47964099bd9c4 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -1387,14 +1387,12 @@ void tools::AddHIPLinkerScript(const ToolChain &TC, Compilation &C, // Create temporary linker script. Keep it if save-temps is enabled. const char *LKS; - SmallString<256> Name = llvm::sys::path::filename(Output.getFilename()); + std::string Name = llvm::sys::path::filename(Output.getFilename()); if (C.getDriver().isSaveTempsEnabled()) { - llvm::sys::path::replace_extension(Name, "lk"); - LKS = C.getArgs().MakeArgString(Name.c_str()); + LKS = C.getArgs().MakeArgString(Name + ".lk"); } else { - llvm::sys::path::replace_extension(Name, ""); - Name = C.getDriver().GetTemporaryPath(Name, "lk"); - LKS = C.addTempFile(C.getArgs().MakeArgString(Name.c_str())); + auto TmpName = C.getDriver().GetTemporaryPath(Name, "lk"); + LKS = C.addTempFile(C.getArgs().MakeArgString(TmpName)); } // Add linker script option to the command. @@ -1412,11 +1410,13 @@ void tools::AddHIPLinkerScript(const ToolChain &TC, Compilation &C, "Wrong platform"); (void)HIPTC; - // The output file name needs to persist through the compilation, therefore - // it needs to be created through MakeArgString. - std::string BundleFileName = C.getDriver().GetTemporaryPath("BUNDLE", "hipfb"); - const char *BundleFile = - C.addTempFile(C.getArgs().MakeArgString(BundleFileName.c_str())); + const char *BundleFile; + if (C.getDriver().isSaveTempsEnabled()) { + BundleFile = C.getArgs().MakeArgString(Name + ".hipfb"); + } else { + auto TmpName = C.getDriver().GetTemporaryPath(Name, "hipfb"); + BundleFile = C.addTempFile(C.getArgs().MakeArgString(TmpName)); + } AMDGCN::constructHIPFatbinCommand(C, JA, BundleFile, DeviceInputs, Args, T); // Add commands to embed target binaries. We ensure that each section and @@ -1428,14 +1428,14 @@ void tools::AddHIPLinkerScript(const ToolChain &TC, Compilation &C, LksStream << " *** Automatically generated by Clang ***\n"; LksStream << "*/\n"; LksStream << "TARGET(binary)\n"; - LksStream << "INPUT(" << BundleFileName << ")\n"; + LksStream << "INPUT(" << BundleFile << ")\n"; LksStream << "SECTIONS\n"; LksStream << "{\n"; LksStream << " .hip_fatbin :\n"; LksStream << " ALIGN(0x10)\n"; LksStream << " {\n"; LksStream << " PROVIDE_HIDDEN(__hip_fatbin = .);\n"; - LksStream << " " << BundleFileName << "\n"; + LksStream << " " << BundleFile << "\n"; LksStream << " }\n"; LksStream << " /DISCARD/ :\n"; LksStream << " {\n"; diff --git a/clang/lib/Driver/ToolChains/HIP.cpp b/clang/lib/Driver/ToolChains/HIP.cpp index f3e58cbeb4d76..ad9384df6a242 100644 --- a/clang/lib/Driver/ToolChains/HIP.cpp +++ b/clang/lib/Driver/ToolChains/HIP.cpp @@ -48,6 +48,20 @@ static void addBCLib(const Driver &D, const ArgList &Args, D.Diag(diag::err_drv_no_such_file) << BCName; } +static const char *getOutputFileName(Compilation &C, StringRef Base, + const char *Postfix, + const char *Extension) { + const char *OutputFileName; + if (C.getDriver().isSaveTempsEnabled()) { + OutputFileName = + C.getArgs().MakeArgString(Base.str() + Postfix + "." + Extension); + } else { + std::string TmpName = + C.getDriver().GetTemporaryPath(Base.str() + Postfix, Extension); + OutputFileName = C.addTempFile(C.getArgs().MakeArgString(TmpName)); + } + return OutputFileName; +} } // namespace const char *AMDGCN::Linker::constructLLVMLinkCommand( @@ -61,10 +75,7 @@ const char *AMDGCN::Linker::constructLLVMLinkCommand( // Add an intermediate output file. CmdArgs.push_back("-o"); - std::string TmpName = - C.getDriver().GetTemporaryPath(OutputFilePrefix.str() + "-linked", "bc"); - const char *OutputFileName = - C.addTempFile(C.getArgs().MakeArgString(TmpName)); + auto OutputFileName = getOutputFileName(C, OutputFilePrefix, "-linked", "bc"); CmdArgs.push_back(OutputFileName); SmallString<128> ExecPath(C.getDriver().Dir); llvm::sys::path::append(ExecPath, "llvm-link"); @@ -109,10 +120,8 @@ const char *AMDGCN::Linker::constructOptCommand( } OptArgs.push_back("-o"); - std::string TmpFileName = C.getDriver().GetTemporaryPath( - OutputFilePrefix.str() + "-optimized", "bc"); - const char *OutputFileName = - C.addTempFile(C.getArgs().MakeArgString(TmpFileName)); + auto OutputFileName = + getOutputFileName(C, OutputFilePrefix, "-optimized", "bc"); OptArgs.push_back(OutputFileName); SmallString<128> OptPath(C.getDriver().Dir); llvm::sys::path::append(OptPath, "opt"); @@ -124,11 +133,13 @@ const char *AMDGCN::Linker::constructOptCommand( const char *AMDGCN::Linker::constructLlcCommand( Compilation &C, const JobAction &JA, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::StringRef SubArchName, - llvm::StringRef OutputFilePrefix, const char *InputFileName) const { + llvm::StringRef OutputFilePrefix, const char *InputFileName, + bool OutputIsAsm) const { // Construct llc command. - ArgStringList LlcArgs{InputFileName, "-mtriple=amdgcn-amd-amdhsa", - "-filetype=obj", - Args.MakeArgString("-mcpu=" + SubArchName)}; + ArgStringList LlcArgs{ + InputFileName, "-mtriple=amdgcn-amd-amdhsa", + Args.MakeArgString(Twine("-filetype=") + (OutputIsAsm ? "asm" : "obj")), + Args.MakeArgString("-mcpu=" + SubArchName)}; // Extract all the -m options std::vector Features; @@ -151,10 +162,8 @@ const char *AMDGCN::Linker::constructLlcCommand( // Add output filename LlcArgs.push_back("-o"); - std::string LlcOutputFileName = - C.getDriver().GetTemporaryPath(OutputFilePrefix, "o"); - const char *LlcOutputFile = - C.addTempFile(C.getArgs().MakeArgString(LlcOutputFileName)); + auto LlcOutputFile = + getOutputFileName(C, OutputFilePrefix, "", OutputIsAsm ? "s" : "o"); LlcArgs.push_back(LlcOutputFile); SmallString<128> LlcPath(C.getDriver().Dir); llvm::sys::path::append(LlcPath, "llc"); @@ -230,14 +239,18 @@ void AMDGCN::Linker::ConstructJob(Compilation &C, const JobAction &JA, assert(StringRef(SubArchName).startswith("gfx") && "Unsupported sub arch"); // Prefix for temporary file name. - std::string Prefix = - llvm::sys::path::stem(Inputs[0].getFilename()).str() + "-" + SubArchName; + std::string Prefix = llvm::sys::path::stem(Inputs[0].getFilename()).str(); + if (!C.getDriver().isSaveTempsEnabled()) + Prefix += "-" + SubArchName; // Each command outputs different files. const char *LLVMLinkCommand = constructLLVMLinkCommand(C, JA, Inputs, Args, SubArchName, Prefix); const char *OptCommand = constructOptCommand(C, JA, Inputs, Args, SubArchName, Prefix, LLVMLinkCommand); + if (C.getDriver().isSaveTempsEnabled()) + constructLlcCommand(C, JA, Inputs, Args, SubArchName, Prefix, OptCommand, + /*OutputIsAsm=*/true); const char *LlcCommand = constructLlcCommand(C, JA, Inputs, Args, SubArchName, Prefix, OptCommand); constructLldCommand(C, JA, Inputs, Output, Args, LlcCommand); diff --git a/clang/lib/Driver/ToolChains/HIP.h b/clang/lib/Driver/ToolChains/HIP.h index a650095d054d7..2d146ce5cc6fd 100644 --- a/clang/lib/Driver/ToolChains/HIP.h +++ b/clang/lib/Driver/ToolChains/HIP.h @@ -58,7 +58,8 @@ class LLVM_LIBRARY_VISIBILITY Linker : public Tool { const llvm::opt::ArgList &Args, llvm::StringRef SubArchName, llvm::StringRef OutputFilePrefix, - const char *InputFileName) const; + const char *InputFileName, + bool OutputIsAsm = false) const; void constructLldCommand(Compilation &C, const JobAction &JA, const InputInfoList &Inputs, const InputInfo &Output, diff --git a/clang/test/Driver/hip-save-temps.hip b/clang/test/Driver/hip-save-temps.hip new file mode 100644 index 0000000000000..f7f2c6ef57ff5 --- /dev/null +++ b/clang/test/Driver/hip-save-temps.hip @@ -0,0 +1,41 @@ +// REQUIRES: clang-driver +// REQUIRES: x86-registered-target +// REQUIRES: amdgpu-registered-target + +// -fno-gpu-rdc without -o +// RUN: %clang -### -target x86_64-linux-gnu -nogpulib -save-temps \ +// RUN: -x hip --cuda-gpu-arch=gfx900 %s 2>&1 | \ +// RUN: FileCheck -check-prefixes=CHECK,NORDC,NOUT %s + +// -fno-gpu-rdc with -o +// RUN: %clang -### -target x86_64-linux-gnu -nogpulib -save-temps \ +// RUN: -o executable -x hip --cuda-gpu-arch=gfx900 %s 2>&1 | \ +// RUN: FileCheck -check-prefixes=CHECK,NORDC,WOUT %s + +// -fgpu-rdc without -o +// RUN: %clang -### -target x86_64-linux-gnu -nogpulib -save-temps \ +// RUN: -fgpu-rdc -x hip --cuda-gpu-arch=gfx900 %s 2>&1 | \ +// RUN: FileCheck -check-prefixes=CHECK,RDC,RDC-NOUT,NOUT %s + +// -fgpu-rdc with -o +// RUN: %clang -### -target x86_64-linux-gnu -nogpulib -save-temps \ +// RUN: -o executable -fgpu-rdc -x hip --cuda-gpu-arch=gfx900 %s 2>&1 | \ +// RUN: FileCheck -check-prefixes=CHECK,RDC,RDC-WOUT,WOUT %s + +// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.cui" +// CHECK: {{.*}}llvm-link{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900-linked.bc" +// CHECK: {{.*}}opt{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900-optimized.bc" +// CHECK: {{.*}}llc{{.*}}"-filetype=asm"{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.s" +// CHECK: {{.*}}llc{{.*}}"-filetype=obj"{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.o" +// NORDC: {{.*}}lld{{.*}}"-o" "hip-save-temps-hip-amdgcn-amd-amdhsa-gfx900.out" +// RDC: {{.*}}lld{{.*}}"-o" "a.out-hip-amdgcn-amd-amdhsa-gfx900" +// NORDC: {{.*}}clang-offload-bundler{{.*}}"-outputs=hip-save-temps.hip-hip-amdgcn-amd-amdhsa.hipfb" +// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.cui" +// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.bc" +// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps-host-x86_64-unknown-linux-gnu.s" +// CHECK: {{.*}}clang{{.*}}"-o" "hip-save-temps{{.*}}.o" +// RDC-NOUT: {{.*}}clang-offload-bundler{{.*}}"-outputs=a.out.hipfb" +// RDC-WOUT: {{.*}}clang-offload-bundler{{.*}}"-outputs=executable.hipfb" +// NOUT: {{.*}}ld{{.*}}"-o" "a.out" +// WOUT: {{.*}}ld{{.*}}"-o" "executable" + From fd18e94697c987d5f24e25aa4e27adaffff3cce4 Mon Sep 17 00:00:00 2001 From: Michael Liao Date: Wed, 9 Oct 2019 19:08:52 +0000 Subject: [PATCH 30/44] [mangle] Fix mangling where an extra mangle context is required. Summary: - [Itanium C++ ABI][1], for certain contexts like default parameter and etc., mangling numbering will be local to the particular argument in which it appears. - However, for these cases, the mangle numbering context is allocated per expression evaluation stack entry. That causes, for example, two lambdas defined/used understand the same default parameter are numbered as the same value and, in turn, one of them is not generated at all. - In this patch, an extra mangle numbering context map is maintained in the AST context to map taht extra declaration context to its numbering context. So that, 2 different lambdas defined/used in the same default parameter are numbered differently. [1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html Reviewers: rsmith, eli.friedman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68715 llvm-svn: 374200 --- clang/include/clang/AST/ASTContext.h | 5 +++++ clang/include/clang/Sema/Sema.h | 14 +------------- clang/lib/AST/ASTContext.cpp | 10 ++++++++++ clang/lib/Sema/SemaLambda.cpp | 12 ++---------- clang/test/CodeGenCXX/mangle-lambdas.cpp | 10 ++++++++-- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 5105b9c35cda4..7547960b0928a 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -514,6 +514,8 @@ class ASTContext : public RefCountedBase { /// need to be consistently numbered for the mangler). llvm::DenseMap> MangleNumberingContexts; + llvm::DenseMap> + ExtraMangleNumberingContexts; /// Side-table of mangling numbers for declarations which rarely /// need them (like static local vars). @@ -2812,6 +2814,9 @@ class ASTContext : public RefCountedBase { /// Retrieve the context for computing mangling numbers in the given /// DeclContext. MangleNumberingContext &getManglingNumberContext(const DeclContext *DC); + enum NeedExtraManglingDecl_t { NeedExtraManglingDecl }; + MangleNumberingContext &getManglingNumberContext(NeedExtraManglingDecl_t, + const Decl *D); std::unique_ptr createMangleNumberingContext() const; diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index c9211eb7001f5..2fb3e32e1b367 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -1045,13 +1045,6 @@ class Sema { /// suffice, e.g., in a default function argument. Decl *ManglingContextDecl; - /// The context information used to mangle lambda expressions - /// and block literals within this context. - /// - /// This mangling information is allocated lazily, since most contexts - /// do not have lambda expressions or block literals. - std::unique_ptr MangleNumbering; - /// If we are processing a decltype type, a set of call expressions /// for which we have deferred checking the completeness of the return type. SmallVector DelayedDecltypeCalls; @@ -1080,12 +1073,7 @@ class Sema { ExpressionKind ExprContext) : Context(Context), ParentCleanup(ParentCleanup), NumCleanupObjects(NumCleanupObjects), NumTypos(0), - ManglingContextDecl(ManglingContextDecl), MangleNumbering(), - ExprContext(ExprContext) {} - - /// Retrieve the mangling numbering context, used to consistently - /// number constructs like lambdas for mangling. - MangleNumberingContext &getMangleNumberingContext(ASTContext &Ctx); + ManglingContextDecl(ManglingContextDecl), ExprContext(ExprContext) {} bool isUnevaluated() const { return Context == ExpressionEvaluationContext::Unevaluated || diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index a41b64ffcc81f..8dd57f2bd2854 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -10261,6 +10261,16 @@ ASTContext::getManglingNumberContext(const DeclContext *DC) { return *MCtx; } +MangleNumberingContext & +ASTContext::getManglingNumberContext(NeedExtraManglingDecl_t, const Decl *D) { + assert(LangOpts.CPlusPlus); // We don't need mangling numbers for plain C. + std::unique_ptr &MCtx = + ExtraMangleNumberingContexts[D]; + if (!MCtx) + MCtx = createMangleNumberingContext(); + return *MCtx; +} + std::unique_ptr ASTContext::createMangleNumberingContext() const { return ABI->createMangleNumberingContext(); diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index a76a840f26ee5..b05ed75e8791a 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -352,21 +352,13 @@ Sema::getCurrentMangleNumberContext(const DeclContext *DC, // -- the initializers of inline variables case VariableTemplate: // -- the initializers of templated variables - return &ExprEvalContexts.back().getMangleNumberingContext(Context); + return &Context.getManglingNumberContext(ASTContext::NeedExtraManglingDecl, + ManglingContextDecl); } llvm_unreachable("unexpected context"); } -MangleNumberingContext & -Sema::ExpressionEvaluationContextRecord::getMangleNumberingContext( - ASTContext &Ctx) { - assert(ManglingContextDecl && "Need to have a context declaration"); - if (!MangleNumbering) - MangleNumbering = Ctx.createMangleNumberingContext(); - return *MangleNumbering; -} - CXXMethodDecl *Sema::startLambdaDefinition( CXXRecordDecl *Class, SourceRange IntroducerRange, TypeSourceInfo *MethodTypeInfo, SourceLocation EndLoc, diff --git a/clang/test/CodeGenCXX/mangle-lambdas.cpp b/clang/test/CodeGenCXX/mangle-lambdas.cpp index d49ed4b2a5e16..fcca878e387e7 100644 --- a/clang/test/CodeGenCXX/mangle-lambdas.cpp +++ b/clang/test/CodeGenCXX/mangle-lambdas.cpp @@ -178,18 +178,24 @@ void use_func_template() { } namespace std { - struct type_info; + struct type_info { + bool before(const type_info &) const noexcept; + }; } namespace PR12123 { struct A { virtual ~A(); } g; + struct C { virtual ~C(); } k; struct B { void f(const std::type_info& x = typeid([]()->A& { return g; }())); void h(); + void j(bool cond = typeid([]() -> A & { return g; }()).before(typeid([]() -> C & { return k; }()))); }; - void B::h() { f(); } + void B::h() { f(); j(); } } // CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %"struct.PR12123::A"* @_ZZN7PR121231B1fERKSt9type_infoEd_NKUlvE_clEv +// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %"struct.PR12123::A"* @_ZZN7PR121231B1jEbEd_NKUlvE_clEv +// CHECK-LABEL: define linkonce_odr dereferenceable({{[0-9]+}}) %"struct.PR12123::C"* @_ZZN7PR121231B1jEbEd_NKUlvE0_clEv // CHECK-LABEL: define {{.*}} @_Z{{[0-9]*}}testVarargsLambdaNumberingv( inline int testVarargsLambdaNumbering() { From 87aa9c9e4d41ed881453e2fab85b3d25f648bb55 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 9 Oct 2019 19:22:02 +0000 Subject: [PATCH 31/44] Re-land "[test] Split LLDB tests into API, Shell & Unit" The original patch got reverted because it broke `check-lldb` on a clean build. This fixes that. llvm-svn: 374201 --- lldb/CMakeLists.txt | 1 - lldb/lit/CMakeLists.txt | 115 --------- lldb/test/API/CMakeLists.txt | 133 ++++++++++ lldb/test/API/README.md | 4 + lldb/test/{ => API}/dotest.py | 0 lldb/{lit/Suite => test/API}/lit.cfg | 4 +- lldb/{lit/Suite => test/API}/lit.site.cfg.in | 4 +- lldb/{lit/Suite => test/API}/lldbtest.py | 0 lldb/test/{ => API}/testcases | 0 lldb/test/{ => API}/use_lldb_suite.py | 0 lldb/test/CMakeLists.txt | 238 ++++++++---------- .../Shell}/Breakpoint/Inputs/case-sensitive.c | 0 .../Shell}/Breakpoint/Inputs/debug_addrx.yaml | 0 .../Inputs/debug_rnglist_basic.yaml | 0 .../Inputs/debug_rnglist_offset_pair.yaml | 0 .../Inputs/debug_rnglist_rlestartend.yaml | 0 .../Inputs/debug_rnglistx_rlex.yaml | 0 .../Inputs/implicit_const_form_support.yaml | 0 .../Shell}/Breakpoint/Inputs/jitbp.cpp | 0 .../Breakpoint/Inputs/ppc64-localentry.s | 0 .../Inputs/single-file-split-dwarf.o.yaml | 0 .../Inputs/single-file-split-dwarf.yaml | 0 .../Inputs/split-dwarf-5-addrbase.dwo.yaml | 0 .../Inputs/split-dwarf-5-addrbase.yaml | 0 ...lit-dwarf5-debug-stroffsets-file1.dwo.yaml | 0 ...lit-dwarf5-debug-stroffsets-file2.dwo.yaml | 0 .../split-dwarf5-debug-stroffsets-main.yaml | 0 .../Shell}/Breakpoint/case-insensitive.test | 0 .../Shell}/Breakpoint/case-sensitive.test | 0 .../Shell}/Breakpoint/debug_addrx.test | 0 .../Breakpoint/debug_rnglist_basic.test | 0 .../Breakpoint/debug_rnglist_offset_pair.test | 0 .../Breakpoint/debug_rnglist_rlestartend.test | 0 .../Breakpoint/debug_rnglistx_rlex.test | 0 .../implicit_const_form_support.test | 0 .../Shell}/Breakpoint/jitbp_elf.test | 0 .../Shell}/Breakpoint/ppc64-localentry.test | 0 .../Breakpoint/single-file-split-dwarf.test | 0 .../Breakpoint/split-dwarf-5-addrbase.test | 0 .../split-dwarf5-debug-stroffsets.test | 0 .../BuildScript/compiler-full-path.test | 0 .../Shell}/BuildScript/modes.test | 0 .../Shell}/BuildScript/script-args.test | 0 .../BuildScript/toolchain-clang-cl.test | 0 .../Shell}/BuildScript/toolchain-clang.test | 0 .../Shell}/BuildScript/toolchain-msvc.test | 0 .../CommandScriptImmediateOutputConsole.test | 0 .../CommandScriptImmediateOutputFile.test | 0 .../Inputs/custom_command.py | 0 .../lit.local.cfg | 0 .../Shell}/Commands/Inputs/frame.py | 0 .../Shell}/Commands/Inputs/main.c | 0 .../Shell}/Commands/command-backtrace.test | 0 .../Shell}/Commands/command-regex-delete.test | 0 .../Commands/command-regex-unalias.test | 0 .../Commands/command-script-import.test | 0 .../Shell}/Commands/command-source.test | 0 .../Shell}/Driver/Inputs/.lldbinit | 0 .../Shell}/Driver/Inputs/Print0.in | 0 .../Shell}/Driver/Inputs/Print2.in | 0 .../Shell}/Driver/Inputs/Print4.in | 0 .../Shell}/Driver/Inputs/Print6.in | 0 .../Shell}/Driver/Inputs/convenience.in | 0 .../{lit => test/Shell}/Driver/Inputs/hello.c | 0 .../Shell}/Driver/Inputs/hello.cpp | 0 .../Driver/Inputs/process_attach_pid.in | 0 .../Shell}/Driver/Inputs/syntax_error.py | 0 .../Shell}/Driver/LocalLLDBInit.test | 0 .../Shell}/Driver/TestCommands.test | 0 .../Driver/TestConvenienceVariables.test | 0 lldb/{lit => test/Shell}/Driver/TestCore.test | 0 lldb/{lit => test/Shell}/Driver/TestFile.test | 0 .../Shell}/Driver/TestNoUseColor.test | 0 .../Shell}/Driver/TestProcessAttach.test | 0 lldb/{lit => test/Shell}/Driver/TestRepl.test | 0 .../Shell}/Driver/TestSingleQuote.test | 0 .../Shell}/Driver/TestTarget.test | 0 .../StopHook/Inputs/stop-hook-1.lldbinit | 0 .../StopHook/Inputs/stop-hook-2.lldbinit | 0 .../StopHook/Inputs/stop-hook-3.lldbinit | 0 .../Inputs/stop-hook-threads-1.lldbinit | 0 .../Inputs/stop-hook-threads-2.lldbinit | 0 .../StopHook/Inputs/stop-hook-threads.cpp | 0 .../ExecControl/StopHook/Inputs/stop-hook.c | 0 .../StopHook/stop-hook-threads.test | 0 .../ExecControl/StopHook/stop-hook.test | 0 .../Shell}/Expr/Inputs/call-function.cpp | 0 .../Shell}/Expr/Inputs/ir-memory-map-basic | 0 .../Expr/Inputs/ir-memory-map-mix-malloc-free | 0 .../Shell}/Expr/Inputs/ir-memory-map-overlap1 | 0 .../Shell}/Expr/TestIRMemoryMap.test | 0 .../Shell}/Expr/TestIRMemoryMapWindows.test | 0 .../Shell}/Expr/TestMultilineExpr.test | 0 .../Shell}/Expr/TestTypeOfDeclTypeExpr.test | 0 lldb/{lit => test/Shell}/Heap/Inputs/cstr.c | 0 lldb/{lit => test/Shell}/Heap/heap-cstr.test | 0 lldb/{lit => test/Shell}/Host/Inputs/simple.c | 0 .../Shell}/Host/TestCustomShell.test | 0 .../Shell}/Minidump/Inputs/linux-x86_64.syms | 0 .../Shell}/Minidump/Inputs/linux-x86_64.yaml | 0 .../Windows/Inputs/find-module.dmp.yaml | 0 .../Windows/Inputs/find-module.exe.yaml | 0 .../Windows/Sigsegv/Inputs/sigsegv.cpp | 0 .../Windows/Sigsegv/Inputs/sigsegv.dmp | Bin .../Windows/Sigsegv/Inputs/sigsegv.lldbinit | 0 .../Windows/Sigsegv/Inputs/sigsegv.pdb | Bin .../Minidump/Windows/Sigsegv/sigsegv.test | 0 .../Shell}/Minidump/Windows/find-module.test | 0 .../Shell}/Minidump/breakpad-symbols.test | 0 .../Minidump/disassemble-no-module.yaml | 0 .../Shell}/Minidump/dump-all.test | 0 .../{lit => test/Shell}/Minidump/fb-dump.test | 0 .../Shell}/Minidump/lit.local.cfg | 0 .../Breakpad/Inputs/bad-module-id-1.syms | 0 .../Breakpad/Inputs/bad-module-id-2.syms | 0 .../Breakpad/Inputs/bad-module-id-3.syms | 0 .../Inputs/discontiguous-sections.syms | 0 .../Breakpad/Inputs/identification-linux.syms | 0 .../Inputs/identification-macosx-arm64e.syms | 0 .../Inputs/identification-macosx.syms | 0 .../Inputs/identification-windows.syms | 0 .../Inputs/sections-trailing-func.syms | 0 .../ObjectFile/Breakpad/Inputs/sections.syms | 0 .../Breakpad/Inputs/uuid-matching-mac.syms | 0 .../Breakpad/Inputs/uuid-matching-mac.yaml | 0 .../Breakpad/breakpad-identification.test | 0 .../Breakpad/discontiguous-sections.test | 0 .../Shell}/ObjectFile/Breakpad/lit.local.cfg | 0 .../Breakpad/sections-trailing-func.test | 0 .../Shell}/ObjectFile/Breakpad/sections.test | 0 .../Breakpad/uuid-matching-mac.test | 0 .../ELF/Inputs/PT_LOAD-overlap-section.elf | Bin .../ELF/Inputs/minidebuginfo-main.c | 0 .../ObjectFile/ELF/Inputs/netbsd-amd64.core | Bin .../Shell}/ObjectFile/ELF/PT_LOAD-empty.yaml | 0 .../ELF/PT_LOAD-overlap-PT_INTERP.yaml | 0 .../ELF/PT_LOAD-overlap-PT_TLS.yaml | 0 .../ELF/PT_LOAD-overlap-section.yaml | 0 .../ObjectFile/ELF/PT_LOAD-overlap.yaml | 0 .../Shell}/ObjectFile/ELF/PT_LOAD.yaml | 0 .../ELF/PT_TLS-overlap-PT_LOAD.yaml | 0 .../ObjectFile/ELF/aarch64-relocations.yaml | 0 .../Shell}/ObjectFile/ELF/base-address.yaml | 0 .../Shell}/ObjectFile/ELF/basic-info.yaml | 0 .../Shell}/ObjectFile/ELF/build-id-case.yaml | 0 .../ObjectFile/ELF/compressed-sections.yaml | 0 .../ObjectFile/ELF/duplicate-section.yaml | 0 .../Shell}/ObjectFile/ELF/gnu-debuglink.yaml | 0 .../Shell}/ObjectFile/ELF/many-sections.s | 0 .../ELF/minidebuginfo-corrupt-xz.yaml | 0 .../ELF/minidebuginfo-find-symbols.yaml | 0 .../ObjectFile/ELF/minidebuginfo-no-lzma.yaml | 0 .../minidebuginfo-set-and-hit-breakpoint.test | 0 .../ObjectFile/ELF/netbsd-core-amd64.test | 0 .../ELF/netbsd-exec-8.99.30-amd64.yaml | 0 .../ObjectFile/ELF/section-addresses.yaml | 0 .../ObjectFile/ELF/section-overlap.yaml | 0 .../ObjectFile/ELF/section-permissions.yaml | 0 .../ELF/section-types-edgecases.yaml | 0 .../Shell}/ObjectFile/ELF/section-types.yaml | 0 .../Shell}/ObjectFile/ELF/short-build-id.yaml | 0 .../ObjectFile/MachO/lc_build_version.yaml | 0 .../MachO/lc_build_version_notools.yaml | 0 .../ObjectFile/MachO/lc_version_min.yaml | 0 .../Shell}/ObjectFile/MachO/subsections.yaml | 0 .../Shell}/ObjectFile/MachO/symtab.yaml | 0 .../ObjectFile/PECOFF/basic-info-arm.yaml | 0 .../ObjectFile/PECOFF/basic-info-arm64.yaml | 0 .../Shell}/ObjectFile/PECOFF/basic-info.yaml | 0 .../Shell}/ObjectFile/PECOFF/dep-modules.yaml | 0 .../ObjectFile/PECOFF/export-dllfunc.yaml | 0 .../Shell}/ObjectFile/PECOFF/lit.local.cfg | 0 .../ObjectFile/PECOFF/sections-names.yaml | 0 .../Shell}/ObjectFile/PECOFF/subsections.yaml | 0 .../Shell}/ObjectFile/PECOFF/uuid.yaml | 0 .../Shell}/ObjectFile/lit.local.cfg | 0 .../Shell}/Process/Inputs/env.cpp | 0 .../Shell}/Process/TestEnvironment.test | 0 .../Windows/exception_access_violation.cpp | 0 lldb/{lit => test/Shell}/Python/crashlog.test | 4 +- .../Shell}/Quit/TestQuitExitCode-30.test | 0 .../Shell}/Quit/TestQuitExitCode0.test | 0 .../Shell}/Quit/TestQuitExitCode30.test | 0 .../Shell}/Quit/TestQuitExitCodeHex0.test | 0 .../Shell}/Quit/TestQuitExitCodeHexA.test | 0 .../Quit/TestQuitExitCodeImplicit0.test | 0 .../Shell}/Quit/TestQuitExitCodeNonInt.test | 0 .../Quit/TestQuitExitCodeTooManyArgs.test | 0 .../Shell}/Quit/expect_exit_code.py | 0 .../Shell}/Register/Inputs/x86-64-gp-read.cpp | 0 .../Register/Inputs/x86-64-gp-write.cpp | 0 .../Shell}/Register/Inputs/x86-64-read.cpp | 0 .../Shell}/Register/Inputs/x86-64-write.cpp | 0 .../Shell}/Register/Inputs/x86-gp-read.cpp | 0 .../Shell}/Register/Inputs/x86-gp-write.cpp | 0 .../Register/Inputs/x86-mm-xmm-read.cpp | 0 .../Register/Inputs/x86-mm-xmm-write.cpp | 0 .../Shell}/Register/Inputs/x86-ymm-read.cpp | 0 .../Shell}/Register/Inputs/x86-ymm-write.cpp | 0 .../Shell}/Register/Inputs/x86-zmm-read.cpp | 0 .../Shell}/Register/Inputs/x86-zmm-write.cpp | 0 .../Shell}/Register/x86-64-gp-read.test | 0 .../Shell}/Register/x86-64-gp-write.test | 0 .../Shell}/Register/x86-64-read.test | 0 .../Shell}/Register/x86-64-write.test | 0 .../Shell}/Register/x86-64-xmm16-read.test | 0 .../Shell}/Register/x86-64-xmm16-write.test | 0 .../Shell}/Register/x86-64-ymm-read.test | 0 .../Shell}/Register/x86-64-ymm-write.test | 0 .../Shell}/Register/x86-64-ymm16-read.test | 0 .../Shell}/Register/x86-64-ymm16-write.test | 0 .../Shell}/Register/x86-64-zmm-read.test | 0 .../Shell}/Register/x86-64-zmm-write.test | 0 .../Shell}/Register/x86-gp-read.test | 0 .../Shell}/Register/x86-gp-write.test | 0 .../Shell}/Register/x86-mm-xmm-read.test | 0 .../Shell}/Register/x86-mm-xmm-write.test | 0 .../Shell}/Register/x86-ymm-read.test | 0 .../Shell}/Register/x86-ymm-write.test | 0 .../Shell}/Register/x86-zmm-read.test | 0 .../Shell}/Register/x86-zmm-write.test | 0 .../Functionalities/Inputs/DataFormatter.in | 0 .../Reproducer/Functionalities/Inputs/foo.cpp | 0 .../Functionalities/Inputs/stepping.c | 0 .../Functionalities/TestDataFormatter.test | 0 .../Functionalities/TestImageList.test | 0 .../Functionalities/TestStepping.test | 0 .../Shell}/Reproducer/Inputs/FileCapture.in | 0 .../Reproducer/Inputs/GDBRemoteCapture.in | 0 .../Shell}/Reproducer/Inputs/simple.c | 0 .../Shell}/Reproducer/Modules/Inputs/Bar.h | 0 .../Shell}/Reproducer/Modules/Inputs/Foo.h | 0 .../Reproducer/Modules/Inputs/ModuleCXX.in | 0 .../Shell}/Reproducer/Modules/Inputs/main.cpp | 0 .../Modules/Inputs/module.modulemap | 0 .../Reproducer/Modules/TestModuleCXX.test | 0 .../Shell}/Reproducer/TestDriverOptions.test | 0 .../Shell}/Reproducer/TestDump.test | 0 .../Shell}/Reproducer/TestFileRepro.test | 0 .../Shell}/Reproducer/TestGDBRemoteRepro.test | 0 .../Shell}/Reproducer/TestRelativePath.test | 0 .../Shell}/Reproducer/TestReuseDirectory.test | 0 .../Shell}/Reproducer/TestSynchronous.test | 0 .../Settings/Inputs/DontStopCommandSource.in | 0 .../Settings/Inputs/EchoCommandsAll.out | 0 .../Inputs/EchoCommandsNoComments.out | 0 .../Settings/Inputs/EchoCommandsNone.out | 0 .../Settings/Inputs/EchoCommandsQuiet.out | 0 .../Settings/Inputs/EchoCommandsTest.in | 0 .../Settings/Inputs/StopCommandSource.in | 0 .../Shell}/Settings/Inputs/main.c | 0 .../Shell}/Settings/TestDisableColor.test | 0 .../Settings/TestDisassemblyFormat.test | 0 .../Shell}/Settings/TestEchoCommands.test | 0 .../Shell}/Settings/TestFrameFormatColor.test | 0 .../Settings/TestFrameFormatNoColor.test | 0 .../Settings/TestModuleCacheSanity.test | 0 .../Shell}/Settings/TestSettingsSet.test | 0 .../Shell}/Settings/TestSettingsWrite.test | 0 .../TestStopCommandSourceOnError.test | 0 .../SymbolFile/Breakpad/Inputs/basic-elf.yaml | 0 .../Breakpad/Inputs/basic-macho.yaml | 0 .../line-table-discontinuous-file-ids.syms | 0 .../Breakpad/Inputs/line-table-edgecases.syms | 0 .../Inputs/line-table-missing-file.syms | 0 .../Inputs/line-table-mixed-path-styles.syms | 0 .../Breakpad/Inputs/line-table.syms | 0 .../Breakpad/Inputs/stack-cfi-parsing.syms | 0 .../Breakpad/Inputs/stack-cfi-parsing.yaml | 0 .../Breakpad/Inputs/symtab-macho.syms | 0 .../SymbolFile/Breakpad/Inputs/symtab.syms | 0 .../Breakpad/Inputs/unwind-via-raSearch.syms | 0 .../Breakpad/Inputs/unwind-via-stack-cfi.syms | 0 .../Breakpad/Inputs/unwind-via-stack-cfi.yaml | 0 .../Breakpad/Inputs/unwind-via-stack-win.syms | 0 .../Breakpad/Inputs/unwind-via-stack-win.yaml | 0 .../line-table-discontinuous-file-ids.test | 0 .../Breakpad/line-table-edgecases.test | 0 .../Breakpad/line-table-missing-file.test | 0 .../line-table-mixed-path-styles.test | 0 .../SymbolFile/Breakpad/line-table.test | 0 .../Breakpad/stack-cfi-parsing.test | 0 .../SymbolFile/Breakpad/symtab-macho.test | 0 .../Shell}/SymbolFile/Breakpad/symtab.test | 0 .../Breakpad/unwind-via-raSearch.test | 0 .../Breakpad/unwind-via-stack-cfi.test | 0 .../Breakpad/unwind-via-stack-win.test | 0 .../DWARF/Inputs/debug-line-basic.script | 0 .../DWARF/Inputs/debug-types-basic.cpp | 0 .../DWARF/Inputs/debug-types-expressions.cpp | 0 ...parator-no-comp-dir-relative-name.lldbinit | 0 .../DWARF/Inputs/dir-separator-posix.lldbinit | 0 .../Inputs/dir-separator-windows.lldbinit | 0 .../DWARF/Inputs/find-variable-file-2.cpp | 0 .../SymbolFile/DWARF/apple-index-is-used.cpp | 0 .../Shell}/SymbolFile/DWARF/array-sizes.s | 0 .../SymbolFile/DWARF/childless-compile-unit.s | 0 .../SymbolFile/DWARF/compilercontext.ll | 0 .../SymbolFile/DWARF/debug-line-basic.s | 0 .../DWARF/debug-names-compressed.cpp | 0 .../DWARF/debug-types-address-ranges.s | 0 .../SymbolFile/DWARF/debug-types-basic.test | 0 .../SymbolFile/DWARF/debug-types-dwarf5.s | 0 .../DWARF/debug-types-dwo-cross-reference.cpp | 0 .../DWARF/debug-types-expressions.test | 0 .../DWARF/debug-types-line-tables.s | 0 .../DWARF/debug-types-missing-signature.test | 0 .../DWARF/debug-types-signature-loop.s | 0 .../DWARF/debug_aranges-empty-section.s | 0 .../Shell}/SymbolFile/DWARF/debug_loc.s | 0 .../DWARF/debug_ranges-missing-section.s | 0 .../Shell}/SymbolFile/DWARF/debug_ranges.s | 0 .../DWARF/debug_ranges_and_rnglists.test | 0 .../Shell}/SymbolFile/DWARF/debug_rnglists.s | 0 .../SymbolFile/DWARF/deterministic-build.cpp | 0 .../dir-separator-no-comp-dir-relative-name.s | 0 .../DWARF/dir-separator-no-comp-dir.s | 0 .../SymbolFile/DWARF/dir-separator-posix.s | 0 .../SymbolFile/DWARF/dir-separator-windows.s | 0 .../SymbolFile/DWARF/dwarf5-index-is-used.cpp | 0 .../SymbolFile/DWARF/dwarf5-partial-index.cpp | 0 .../SymbolFile/DWARF/dwarf5_locations.s | 0 .../SymbolFile/DWARF/find-basic-function.cpp | 0 .../SymbolFile/DWARF/find-basic-namespace.cpp | 0 .../SymbolFile/DWARF/find-basic-type.cpp | 0 .../SymbolFile/DWARF/find-basic-variable.cpp | 0 .../SymbolFile/DWARF/find-function-regex.cpp | 0 .../SymbolFile/DWARF/find-inline-method.s | 0 .../DWARF/find-method-local-struct.cpp | 0 .../Shell}/SymbolFile/DWARF/find-method.cpp | 0 .../DWARF/find-qualified-variable.cpp | 0 .../DWARF/find-type-in-function.cpp | 0 .../SymbolFile/DWARF/find-variable-dwo.cpp | 0 .../SymbolFile/DWARF/find-variable-file.cpp | 0 .../SymbolFile/DWARF/forward-declarations.s | 0 .../DWARF/gnu-style-compression.cpp | 0 .../Shell}/SymbolFile/DWARF/lit.local.cfg | 0 .../DWARF/parallel-indexing-stress.s | 0 .../SymbolFile/DWARF/split-dwarf-inlining.cpp | 0 .../DWARF/split-dwarf-multiple-cu.ll | 0 .../SymbolFile/Inputs/sizeless-symbol.s | 0 .../Inputs/target-symbols-add-unwind.c | 0 .../NativePDB/Inputs/ast-functions.lldbinit | 0 .../NativePDB/Inputs/ast-methods.lldbinit | 0 .../NativePDB/Inputs/ast-types.lldbinit | 0 .../NativePDB/Inputs/bitfields.lldbinit | 0 .../Inputs/break-by-function.lldbinit | 0 .../NativePDB/Inputs/break-by-line.lldbinit | 0 .../NativePDB/Inputs/disassembly.lldbinit | 0 .../Inputs/function-types-builtins.lldbinit | 0 .../function-types-calling-conv.lldbinit | 0 .../Inputs/function-types-classes.lldbinit | 0 .../NativePDB/Inputs/globals-bss.lldbinit | 0 .../NativePDB/Inputs/globals-classes.lldbinit | 0 .../Inputs/globals-fundamental.lldbinit | 0 .../NativePDB/Inputs/local-variables.lldbinit | 0 .../NativePDB/Inputs/nested-types.lldbinit | 0 .../NativePDB/Inputs/s_constant.lldbinit | 0 .../SymbolFile/NativePDB/Inputs/s_constant.s | 0 .../NativePDB/Inputs/source-list.lldbinit | 0 .../Inputs/stack_unwinding01.lldbinit | 0 .../NativePDB/Inputs/tag-types.lldbinit | 0 .../NativePDB/ast-functions-msvc.cpp | 0 .../SymbolFile/NativePDB/ast-functions.cpp | 0 .../SymbolFile/NativePDB/ast-methods.cpp | 0 .../Shell}/SymbolFile/NativePDB/ast-types.cpp | 0 .../Shell}/SymbolFile/NativePDB/bitfields.cpp | 0 .../NativePDB/break-by-function.cpp | 0 .../SymbolFile/NativePDB/break-by-line.cpp | 0 .../SymbolFile/NativePDB/disassembly.cpp | 0 .../NativePDB/function-types-builtins.cpp | 0 .../NativePDB/function-types-calling-conv.cpp | 0 .../NativePDB/function-types-classes.cpp | 0 .../SymbolFile/NativePDB/global-classes.cpp | 0 .../SymbolFile/NativePDB/globals-bss.cpp | 0 .../NativePDB/globals-fundamental.cpp | 0 .../SymbolFile/NativePDB/local-variables.cpp | 0 .../SymbolFile/NativePDB/nested-types.cpp | 0 .../SymbolFile/NativePDB/s_constant.cpp | 0 .../SymbolFile/NativePDB/source-list.cpp | 0 .../NativePDB/stack_unwinding01.cpp | 0 .../Shell}/SymbolFile/NativePDB/tag-types.cpp | 0 .../Shell}/SymbolFile/NativePDB/typedefs.cpp | 0 .../SymbolFile/PDB/Inputs/AstRestoreTest.cpp | 0 .../PDB/Inputs/CallingConventionsTest.cpp | 0 .../SymbolFile/PDB/Inputs/ClassLayoutTest.cpp | 0 .../SymbolFile/PDB/Inputs/CompilandsTest.cpp | 0 .../SymbolFile/PDB/Inputs/ExpressionsTest.cpp | 0 .../PDB/Inputs/ExpressionsTest0.script | 0 .../PDB/Inputs/ExpressionsTest1.script | 0 .../PDB/Inputs/ExpressionsTest2.script | 0 .../SymbolFile/PDB/Inputs/FuncSymbols.cpp | 0 .../PDB/Inputs/FuncSymbolsTestMain.cpp | 0 .../PDB/Inputs/FunctionLevelLinkingTest.cpp | 0 .../PDB/Inputs/FunctionLevelLinkingTest.h | 0 .../PDB/Inputs/FunctionLevelLinkingTest.ord | 0 .../PDB/Inputs/FunctionNestedBlockTest.cpp | 0 .../SymbolFile/PDB/Inputs/PointerTypeTest.cpp | 0 .../SymbolFile/PDB/Inputs/SimpleTypesTest.cpp | 0 .../SymbolFile/PDB/Inputs/TypeQualsTest.cpp | 0 .../SymbolFile/PDB/Inputs/UdtLayoutTest.cpp | 0 .../PDB/Inputs/UdtLayoutTest.script | 0 .../Shell}/SymbolFile/PDB/Inputs/VBases.cpp | 0 .../SymbolFile/PDB/Inputs/VBases.script | 0 .../PDB/Inputs/VariablesLocationsTest.cpp | 0 .../PDB/Inputs/VariablesLocationsTest.script | 0 .../SymbolFile/PDB/Inputs/VariablesTest.cpp | 0 .../Shell}/SymbolFile/PDB/ast-restore.test | 0 .../SymbolFile/PDB/calling-conventions.test | 0 .../Shell}/SymbolFile/PDB/class-layout.test | 0 .../Shell}/SymbolFile/PDB/compilands.test | 0 .../Shell}/SymbolFile/PDB/enums-layout.test | 0 .../Shell}/SymbolFile/PDB/expressions.test | 0 .../Shell}/SymbolFile/PDB/func-symbols.test | 0 .../PDB/function-level-linking.test | 0 .../SymbolFile/PDB/function-nested-block.test | 0 .../Shell}/SymbolFile/PDB/pointers.test | 0 .../Shell}/SymbolFile/PDB/type-quals.test | 0 .../Shell}/SymbolFile/PDB/typedefs.test | 0 .../Shell}/SymbolFile/PDB/udt-layout.test | 0 .../SymbolFile/PDB/variables-locations.test | 0 .../Shell}/SymbolFile/PDB/variables.test | 0 .../Shell}/SymbolFile/PDB/vbases.test | 0 .../SymbolFile/dissassemble-entry-point.s | 0 .../Shell}/SymbolFile/sizeless-symbol.test | 0 .../SymbolFile/target-symbols-add-unwind.test | 0 .../Shell}/Unwind/Inputs/call-asm.c | 0 .../Unwind/Inputs/eh-frame-dwarf-unwind.s | 0 .../Shell}/Unwind/Inputs/eh-frame-small-fde.s | 0 .../Inputs/prefer-debug-over-eh-frame.s | 0 .../Shell}/Unwind/Inputs/trap_frame_sym_ctx.s | 0 .../Unwind/Inputs/unwind-plan-dwarf-dump.s | 0 .../Shell}/Unwind/eh-frame-dwarf-unwind.test | 0 .../Shell}/Unwind/eh-frame-small-fde.test | 0 .../Unwind/prefer-debug-over-eh-frame.test | 0 .../Shell}/Unwind/trap_frame_sym_ctx.test | 0 .../Shell}/Unwind/unwind-plan-dwarf-dump.test | 0 .../Shell}/Watchpoint/Inputs/main.cpp | 0 .../Shell}/Watchpoint/SetErrorCases.test | 0 lldb/{lit => test/Shell}/helper/__init__.py | 0 lldb/{lit => test/Shell}/helper/build.py | 0 lldb/{lit => test/Shell}/helper/toolchain.py | 2 +- lldb/{lit => test/Shell}/lit-lldb-init.in | 0 lldb/{lit => test/Shell}/lit.cfg.py | 4 +- lldb/{lit => test/Shell}/lit.site.cfg.py.in | 2 +- lldb/test/Unit/README.md | 4 + lldb/{lit => test}/Unit/lit.cfg.py | 2 +- lldb/test/Unit/lit.site.cfg.py.in | 29 +++ lldb/test/lit.cfg.py | 41 +++ lldb/{lit/Unit => test}/lit.site.cfg.py.in | 2 +- 450 files changed, 331 insertions(+), 258 deletions(-) delete mode 100644 lldb/lit/CMakeLists.txt create mode 100644 lldb/test/API/CMakeLists.txt create mode 100644 lldb/test/API/README.md rename lldb/test/{ => API}/dotest.py (100%) rename lldb/{lit/Suite => test/API}/lit.cfg (96%) rename lldb/{lit/Suite => test/API}/lit.site.cfg.in (93%) rename lldb/{lit/Suite => test/API}/lldbtest.py (100%) rename lldb/test/{ => API}/testcases (100%) rename lldb/test/{ => API}/use_lldb_suite.py (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/case-sensitive.c (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_addrx.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_rnglist_basic.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/debug_rnglistx_rlex.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/implicit_const_form_support.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/jitbp.cpp (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/ppc64-localentry.s (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/single-file-split-dwarf.o.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/single-file-split-dwarf.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml (100%) rename lldb/{lit => test/Shell}/Breakpoint/case-insensitive.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/case-sensitive.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_addrx.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_rnglist_basic.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_rnglist_offset_pair.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_rnglist_rlestartend.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/debug_rnglistx_rlex.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/implicit_const_form_support.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/jitbp_elf.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/ppc64-localentry.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/single-file-split-dwarf.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/split-dwarf-5-addrbase.test (100%) rename lldb/{lit => test/Shell}/Breakpoint/split-dwarf5-debug-stroffsets.test (100%) rename lldb/{lit => test/Shell}/BuildScript/compiler-full-path.test (100%) rename lldb/{lit => test/Shell}/BuildScript/modes.test (100%) rename lldb/{lit => test/Shell}/BuildScript/script-args.test (100%) rename lldb/{lit => test/Shell}/BuildScript/toolchain-clang-cl.test (100%) rename lldb/{lit => test/Shell}/BuildScript/toolchain-clang.test (100%) rename lldb/{lit => test/Shell}/BuildScript/toolchain-msvc.test (100%) rename lldb/{lit => test/Shell}/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test (100%) rename lldb/{lit => test/Shell}/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test (100%) rename lldb/{lit => test/Shell}/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py (100%) rename lldb/{lit => test/Shell}/Commands/CommandScriptImmediateOutput/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/Commands/Inputs/frame.py (100%) rename lldb/{lit => test/Shell}/Commands/Inputs/main.c (100%) rename lldb/{lit => test/Shell}/Commands/command-backtrace.test (100%) rename lldb/{lit => test/Shell}/Commands/command-regex-delete.test (100%) rename lldb/{lit => test/Shell}/Commands/command-regex-unalias.test (100%) rename lldb/{lit => test/Shell}/Commands/command-script-import.test (100%) rename lldb/{lit => test/Shell}/Commands/command-source.test (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/.lldbinit (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/Print0.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/Print2.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/Print4.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/Print6.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/convenience.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/hello.c (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/hello.cpp (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/process_attach_pid.in (100%) rename lldb/{lit => test/Shell}/Driver/Inputs/syntax_error.py (100%) rename lldb/{lit => test/Shell}/Driver/LocalLLDBInit.test (100%) rename lldb/{lit => test/Shell}/Driver/TestCommands.test (100%) rename lldb/{lit => test/Shell}/Driver/TestConvenienceVariables.test (100%) rename lldb/{lit => test/Shell}/Driver/TestCore.test (100%) rename lldb/{lit => test/Shell}/Driver/TestFile.test (100%) rename lldb/{lit => test/Shell}/Driver/TestNoUseColor.test (100%) rename lldb/{lit => test/Shell}/Driver/TestProcessAttach.test (100%) rename lldb/{lit => test/Shell}/Driver/TestRepl.test (100%) rename lldb/{lit => test/Shell}/Driver/TestSingleQuote.test (100%) rename lldb/{lit => test/Shell}/Driver/TestTarget.test (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook-threads.cpp (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/Inputs/stop-hook.c (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/stop-hook-threads.test (100%) rename lldb/{lit => test/Shell}/ExecControl/StopHook/stop-hook.test (100%) rename lldb/{lit => test/Shell}/Expr/Inputs/call-function.cpp (100%) rename lldb/{lit => test/Shell}/Expr/Inputs/ir-memory-map-basic (100%) rename lldb/{lit => test/Shell}/Expr/Inputs/ir-memory-map-mix-malloc-free (100%) rename lldb/{lit => test/Shell}/Expr/Inputs/ir-memory-map-overlap1 (100%) rename lldb/{lit => test/Shell}/Expr/TestIRMemoryMap.test (100%) rename lldb/{lit => test/Shell}/Expr/TestIRMemoryMapWindows.test (100%) rename lldb/{lit => test/Shell}/Expr/TestMultilineExpr.test (100%) rename lldb/{lit => test/Shell}/Expr/TestTypeOfDeclTypeExpr.test (100%) rename lldb/{lit => test/Shell}/Heap/Inputs/cstr.c (100%) rename lldb/{lit => test/Shell}/Heap/heap-cstr.test (100%) rename lldb/{lit => test/Shell}/Host/Inputs/simple.c (100%) rename lldb/{lit => test/Shell}/Host/TestCustomShell.test (100%) rename lldb/{lit => test/Shell}/Minidump/Inputs/linux-x86_64.syms (100%) rename lldb/{lit => test/Shell}/Minidump/Inputs/linux-x86_64.yaml (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Inputs/find-module.dmp.yaml (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Inputs/find-module.exe.yaml (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/Sigsegv/sigsegv.test (100%) rename lldb/{lit => test/Shell}/Minidump/Windows/find-module.test (100%) rename lldb/{lit => test/Shell}/Minidump/breakpad-symbols.test (100%) rename lldb/{lit => test/Shell}/Minidump/disassemble-no-module.yaml (100%) rename lldb/{lit => test/Shell}/Minidump/dump-all.test (100%) rename lldb/{lit => test/Shell}/Minidump/fb-dump.test (100%) rename lldb/{lit => test/Shell}/Minidump/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/identification-linux.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/identification-macosx.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/identification-windows.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/sections.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/breakpad-identification.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/discontiguous-sections.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/sections-trailing-func.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/sections.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/Breakpad/uuid-matching-mac.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/Inputs/minidebuginfo-main.c (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/Inputs/netbsd-amd64.core (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-empty.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-overlap-section.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD-overlap.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_LOAD.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/aarch64-relocations.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/base-address.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/basic-info.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/build-id-case.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/compressed-sections.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/duplicate-section.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/gnu-debuglink.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/many-sections.s (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/minidebuginfo-find-symbols.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/minidebuginfo-no-lzma.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/netbsd-core-amd64.test (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-addresses.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-overlap.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-permissions.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-types-edgecases.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/section-types.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/ELF/short-build-id.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/lc_build_version.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/lc_build_version_notools.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/lc_version_min.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/subsections.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/MachO/symtab.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/basic-info-arm.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/basic-info-arm64.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/basic-info.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/dep-modules.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/export-dllfunc.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/sections-names.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/subsections.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/PECOFF/uuid.yaml (100%) rename lldb/{lit => test/Shell}/ObjectFile/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/Process/Inputs/env.cpp (100%) rename lldb/{lit => test/Shell}/Process/TestEnvironment.test (100%) rename lldb/{lit => test/Shell}/Process/Windows/exception_access_violation.cpp (100%) rename lldb/{lit => test/Shell}/Python/crashlog.test (97%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCode-30.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCode0.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCode30.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeHex0.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeHexA.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeImplicit0.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeNonInt.test (100%) rename lldb/{lit => test/Shell}/Quit/TestQuitExitCodeTooManyArgs.test (100%) rename lldb/{lit => test/Shell}/Quit/expect_exit_code.py (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-64-gp-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-64-gp-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-64-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-64-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-gp-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-gp-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-mm-xmm-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-mm-xmm-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-ymm-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-ymm-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-zmm-read.cpp (100%) rename lldb/{lit => test/Shell}/Register/Inputs/x86-zmm-write.cpp (100%) rename lldb/{lit => test/Shell}/Register/x86-64-gp-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-gp-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-xmm16-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-xmm16-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-ymm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-ymm-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-ymm16-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-ymm16-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-zmm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-64-zmm-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-gp-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-gp-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-mm-xmm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-mm-xmm-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-ymm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-ymm-write.test (100%) rename lldb/{lit => test/Shell}/Register/x86-zmm-read.test (100%) rename lldb/{lit => test/Shell}/Register/x86-zmm-write.test (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/Inputs/DataFormatter.in (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/Inputs/foo.cpp (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/Inputs/stepping.c (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/TestDataFormatter.test (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/TestImageList.test (100%) rename lldb/{lit => test/Shell}/Reproducer/Functionalities/TestStepping.test (100%) rename lldb/{lit => test/Shell}/Reproducer/Inputs/FileCapture.in (100%) rename lldb/{lit => test/Shell}/Reproducer/Inputs/GDBRemoteCapture.in (100%) rename lldb/{lit => test/Shell}/Reproducer/Inputs/simple.c (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/Bar.h (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/Foo.h (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/ModuleCXX.in (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/main.cpp (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/Inputs/module.modulemap (100%) rename lldb/{lit => test/Shell}/Reproducer/Modules/TestModuleCXX.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestDriverOptions.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestDump.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestFileRepro.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestGDBRemoteRepro.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestRelativePath.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestReuseDirectory.test (100%) rename lldb/{lit => test/Shell}/Reproducer/TestSynchronous.test (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/DontStopCommandSource.in (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsAll.out (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsNoComments.out (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsNone.out (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsQuiet.out (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/EchoCommandsTest.in (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/StopCommandSource.in (100%) rename lldb/{lit => test/Shell}/Settings/Inputs/main.c (100%) rename lldb/{lit => test/Shell}/Settings/TestDisableColor.test (100%) rename lldb/{lit => test/Shell}/Settings/TestDisassemblyFormat.test (100%) rename lldb/{lit => test/Shell}/Settings/TestEchoCommands.test (100%) rename lldb/{lit => test/Shell}/Settings/TestFrameFormatColor.test (100%) rename lldb/{lit => test/Shell}/Settings/TestFrameFormatNoColor.test (100%) rename lldb/{lit => test/Shell}/Settings/TestModuleCacheSanity.test (100%) rename lldb/{lit => test/Shell}/Settings/TestSettingsSet.test (100%) rename lldb/{lit => test/Shell}/Settings/TestSettingsWrite.test (100%) rename lldb/{lit => test/Shell}/Settings/TestStopCommandSourceOnError.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/basic-elf.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/basic-macho.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/line-table.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/symtab-macho.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/symtab.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table-edgecases.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table-missing-file.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table-mixed-path-styles.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/line-table.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/stack-cfi-parsing.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/symtab-macho.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/symtab.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/unwind-via-raSearch.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/unwind-via-stack-cfi.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/Breakpad/unwind-via-stack-win.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/debug-line-basic.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/debug-types-basic.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/apple-index-is-used.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/array-sizes.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/childless-compile-unit.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/compilercontext.ll (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-line-basic.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-names-compressed.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-address-ranges.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-basic.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-dwarf5.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-expressions.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-line-tables.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-missing-signature.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug-types-signature-loop.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_aranges-empty-section.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_loc.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_ranges-missing-section.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_ranges.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_ranges_and_rnglists.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/debug_rnglists.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/deterministic-build.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dir-separator-no-comp-dir.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dir-separator-posix.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dir-separator-windows.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dwarf5-index-is-used.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dwarf5-partial-index.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/dwarf5_locations.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-basic-function.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-basic-namespace.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-basic-type.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-basic-variable.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-function-regex.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-inline-method.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-method-local-struct.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-method.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-qualified-variable.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-type-in-function.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-variable-dwo.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/find-variable-file.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/forward-declarations.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/gnu-style-compression.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/lit.local.cfg (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/parallel-indexing-stress.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/split-dwarf-inlining.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/DWARF/split-dwarf-multiple-cu.ll (100%) rename lldb/{lit => test/Shell}/SymbolFile/Inputs/sizeless-symbol.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/Inputs/target-symbols-add-unwind.c (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/ast-types.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/bitfields.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/disassembly.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/local-variables.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/nested-types.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/s_constant.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/s_constant.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/source-list.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/Inputs/tag-types.lldbinit (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/ast-functions-msvc.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/ast-functions.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/ast-methods.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/ast-types.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/bitfields.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/break-by-function.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/break-by-line.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/disassembly.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/function-types-builtins.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/function-types-calling-conv.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/function-types-classes.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/global-classes.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/globals-bss.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/globals-fundamental.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/local-variables.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/nested-types.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/s_constant.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/source-list.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/stack_unwinding01.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/tag-types.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/NativePDB/typedefs.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/AstRestoreTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/CompilandsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ExpressionsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ExpressionsTest0.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ExpressionsTest1.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/ExpressionsTest2.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FuncSymbols.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/PointerTypeTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/TypeQualsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/UdtLayoutTest.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VBases.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VBases.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VariablesLocationsTest.script (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/Inputs/VariablesTest.cpp (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/ast-restore.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/calling-conventions.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/class-layout.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/compilands.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/enums-layout.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/expressions.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/func-symbols.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/function-level-linking.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/function-nested-block.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/pointers.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/type-quals.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/typedefs.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/udt-layout.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/variables-locations.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/variables.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/PDB/vbases.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/dissassemble-entry-point.s (100%) rename lldb/{lit => test/Shell}/SymbolFile/sizeless-symbol.test (100%) rename lldb/{lit => test/Shell}/SymbolFile/target-symbols-add-unwind.test (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/call-asm.c (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/eh-frame-dwarf-unwind.s (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/eh-frame-small-fde.s (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/prefer-debug-over-eh-frame.s (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/trap_frame_sym_ctx.s (100%) rename lldb/{lit => test/Shell}/Unwind/Inputs/unwind-plan-dwarf-dump.s (100%) rename lldb/{lit => test/Shell}/Unwind/eh-frame-dwarf-unwind.test (100%) rename lldb/{lit => test/Shell}/Unwind/eh-frame-small-fde.test (100%) rename lldb/{lit => test/Shell}/Unwind/prefer-debug-over-eh-frame.test (100%) rename lldb/{lit => test/Shell}/Unwind/trap_frame_sym_ctx.test (100%) rename lldb/{lit => test/Shell}/Unwind/unwind-plan-dwarf-dump.test (100%) rename lldb/{lit => test/Shell}/Watchpoint/Inputs/main.cpp (100%) rename lldb/{lit => test/Shell}/Watchpoint/SetErrorCases.test (100%) rename lldb/{lit => test/Shell}/helper/__init__.py (100%) rename lldb/{lit => test/Shell}/helper/build.py (100%) rename lldb/{lit => test/Shell}/helper/toolchain.py (98%) rename lldb/{lit => test/Shell}/lit-lldb-init.in (100%) rename lldb/{lit => test/Shell}/lit.cfg.py (97%) rename lldb/{lit => test/Shell}/lit.site.cfg.py.in (96%) create mode 100644 lldb/test/Unit/README.md rename lldb/{lit => test}/Unit/lit.cfg.py (97%) create mode 100644 lldb/test/Unit/lit.site.cfg.py.in create mode 100644 lldb/test/lit.cfg.py rename lldb/{lit/Unit => test}/lit.site.cfg.py.in (93%) diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 317643a44225f..58a7ef1a9a785 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -185,7 +185,6 @@ if(LLDB_INCLUDE_TESTS) add_subdirectory(test) add_subdirectory(unittests) - add_subdirectory(lit) add_subdirectory(utils/lit-cpuid) add_subdirectory(utils/lldb-dotest) endif() diff --git a/lldb/lit/CMakeLists.txt b/lldb/lit/CMakeLists.txt deleted file mode 100644 index 3e759b0e187a3..0000000000000 --- a/lldb/lit/CMakeLists.txt +++ /dev/null @@ -1,115 +0,0 @@ -# Test runner infrastructure for LLDB. This configures the LLDB test trees -# for use by Lit, and delegates to LLVM's lit test handlers. - -# LLVM_BUILD_MODE is used in lit.site.cfg -if (CMAKE_CFG_INTDIR STREQUAL ".") - set(LLVM_BUILD_MODE ".") -else () - set(LLVM_BUILD_MODE "%(build_mode)s") -endif () - -if (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(LLDB_IS_64_BITS 1) -endif() - -get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY) -set(dotest_args_replacement ${LLVM_BUILD_MODE}) - -set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.") -set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.") - -if(LLDB_BUILT_STANDALONE) - # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder. - string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR}) - string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") - - # Remaining ones must be paths to the provided LLVM build-tree. - if(LLVM_CONFIGURATION_TYPES) - # LLDB uses single-config; LLVM multi-config; pick one and prefer Release types. - # Otherwise, if both use multi-config the default is fine. - if(NOT CMAKE_CONFIGURATION_TYPES) - if(RelWithDebInfo IN_LIST LLVM_CONFIGURATION_TYPES) - set(dotest_args_replacement RelWithDebInfo) - elseif(Release IN_LIST LLVM_CONFIGURATION_TYPES) - set(dotest_args_replacement Release) - else() - list(GET LLVM_CONFIGURATION_TYPES 0 dotest_args_replacement) - endif() - endif() - else() - # Common case: LLVM used a single-configuration generator like Ninja. - set(dotest_args_replacement ".") - endif() -endif() - -string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") -string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) -string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) - -add_lldb_test_dependency( - lit-cpuid - llc - lli - llvm-config - llvm-dwarfdump - llvm-nm - llvm-mc - llvm-objcopy - llvm-readobj - llvm-strip - ) - -if(TARGET lld) - add_lldb_test_dependency(lld) -endif() - -# the value is not canonicalized within LLVM -llvm_canonicalize_cmake_booleans( - LLDB_DISABLE_PYTHON - LLVM_ENABLE_ZLIB - LLVM_ENABLE_SHARED_LIBS - LLDB_IS_64_BITS) - -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py - MAIN_CONFIG - ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py) -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py - MAIN_CONFIG - ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py) -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg) - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/lit-lldb-init.in - ${CMAKE_CURRENT_BINARY_DIR}/lit-lldb-init) - -if(NOT LLDB_BUILT_STANDALONE) - add_lldb_test_dependency( - FileCheck - count - not - ) -endif() - -add_lit_testsuite(check-lldb-lit "Running lldb lit test suite" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS lldb-test-deps - ) - -set_target_properties(check-lldb-lit PROPERTIES FOLDER "lldb tests") - -# If we're building with an in-tree clang, then list clang as a dependency -# to run tests. -if (TARGET clang) - add_dependencies(check-lldb-lit clang) -endif() - -add_lit_testsuites(LLDB - ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS lldb-test-deps - ) diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt new file mode 100644 index 0000000000000..4f787d21fd3eb --- /dev/null +++ b/lldb/test/API/CMakeLists.txt @@ -0,0 +1,133 @@ +function(add_python_test_target name test_script args comment) + set(PYTHON_TEST_COMMAND + ${PYTHON_EXECUTABLE} + ${test_script} + ${args} + ) + + add_custom_target(${name} + COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS} + COMMENT "${comment}" + USES_TERMINAL + ) + add_dependencies(${name} lldb-test-deps) +endfunction() + +# The default architecture with which to compile test executables is the default LLVM target +# architecture, which itself defaults to the host architecture. +string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH) +if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" ) + string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE}) +endif () + +# Allow the user to override the default by setting LLDB_TEST_ARCH +set(LLDB_TEST_ARCH + ${LLDB_DEFAULT_TEST_ARCH} + CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") + +# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script +set(LLDB_TEST_USER_ARGS + "" + CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") + +# The .noindex suffix is a marker for Spotlight to never index the +# build directory. LLDB queries Spotlight to locate .dSYM bundles +# based on the UUID embedded in a binary, and because the UUID is a +# hash of filename and .text section, there *will* be conflicts inside +# the build directory. +set(LLDB_TEST_COMMON_ARGS + --arch=${LLDB_TEST_ARCH} + -s + ${CMAKE_BINARY_DIR}/lldb-test-traces + -S nm + -u CXXFLAGS + -u CFLAGS + ) + +list(APPEND LLDB_TEST_COMMON_ARGS + --executable ${LLDB_TEST_EXECUTABLE} + --dsymutil ${LLDB_TEST_DSYMUTIL} + --filecheck ${LLDB_TEST_FILECHECK} + -C ${LLDB_TEST_C_COMPILER} + ) + +if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) + # All tests are currently flaky on Windows, so rerun them all once when they fail. + set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues) + + set(LLDB_TEST_DEBUG_TEST_CRASHES + 0 + CACHE BOOL "(Windows only) Enables debugging of tests in the test suite by showing the crash dialog when lldb crashes") + + set(LLDB_TEST_HIDE_CONSOLE_WINDOWS + 1 + CACHE BOOL "(Windows only) Hides the console window for an inferior when it is launched through the test suite") + + if (LLDB_TEST_DEBUG_TEST_CRASHES) + set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --enable-crash-dialog) + endif() + + if (NOT LLDB_TEST_HIDE_CONSOLE_WINDOWS) + set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --show-inferior-console) + endif() +endif() + +if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin") + list(APPEND LLDB_TEST_COMMON_ARGS + --env ARCHIVER=${CMAKE_AR} --env OBJCOPY=${CMAKE_OBJCOPY}) +endif() + +if (NOT "${LLDB_LIT_TOOLS_DIR}" STREQUAL "") + if (NOT EXISTS "${LLDB_LIT_TOOLS_DIR}") + message(WARNING "LLDB_LIT_TOOLS_DIR ${LLDB_LIT_TOOLS_DIR} does not exist.") + endif() +endif() + +if(CMAKE_HOST_APPLE) + if(LLDB_BUILD_FRAMEWORK) + get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) + list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_build_dir}/LLDB.framework) + endif() + + # Use the same identity for testing + get_property(code_sign_identity_used GLOBAL PROPERTY LLDB_DEBUGSERVER_CODESIGN_IDENTITY) + if(code_sign_identity_used) + list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${code_sign_identity_used}") + endif() + + if(LLDB_USE_SYSTEM_DEBUGSERVER) + lldb_find_system_debugserver(system_debugserver_path) + add_custom_target(debugserver + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${system_debugserver_path} ${LLVM_RUNTIME_OUTPUT_INTDIR} + COMMENT "Copying the system debugserver to LLDB's binaries directory for testing.") + # The custom target for the system debugserver has no install target, so we + # need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list. + if (LLVM_DISTRIBUTION_COMPONENTS) + list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS debugserver) + set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} PARENT_SCOPE) + endif() + message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver) + add_lldb_test_dependency(debugserver) + elseif(TARGET debugserver) + set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver) + message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path}) + add_lldb_test_dependency(debugserver) + elseif(TARGET lldb-server) + set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server) + message(STATUS "LLDB Tests use just-built lldb-server: ${lldb_server_path}") + list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path}) + add_lldb_test_dependency(lldb-server) + else() + message(WARNING "LLDB Tests enabled, but no server available") + endif() +endif() + +set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}) +set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS}) + +# This will add LLDB's test dependencies to the dependencies for check-all and +# include them in the test-depends target. +set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS}) diff --git a/lldb/test/API/README.md b/lldb/test/API/README.md new file mode 100644 index 0000000000000..fbb37136e26de --- /dev/null +++ b/lldb/test/API/README.md @@ -0,0 +1,4 @@ +# LLDB API Tests + +This directory only exists for the lit test driver. The actual tests live in +the `tests` directory in top level LLDB directory. diff --git a/lldb/test/dotest.py b/lldb/test/API/dotest.py similarity index 100% rename from lldb/test/dotest.py rename to lldb/test/API/dotest.py diff --git a/lldb/lit/Suite/lit.cfg b/lldb/test/API/lit.cfg similarity index 96% rename from lldb/lit/Suite/lit.cfg rename to lldb/test/API/lit.cfg index 9504f4ca1d845..bb9e3aaaaa44d 100644 --- a/lldb/lit/Suite/lit.cfg +++ b/lldb/test/API/lit.cfg @@ -9,7 +9,7 @@ import shlex import lit.formats # name: The name of this test suite. -config.name = 'lldb-Suite' +config.name = 'lldb-api' # suffixes: A list of file extensions to treat as test files. config.suffixes = ['.py'] @@ -73,7 +73,7 @@ if config.lldb_module_cache: dotest_cmd += ['--module-cache-dir', config.lldb_module_cache] # Load LLDB test format. -sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite")) +sys.path.append(os.path.join(config.lldb_src_root, "test", "API")) import lldbtest # testFormat: The test format to use to interpret tests. diff --git a/lldb/lit/Suite/lit.site.cfg.in b/lldb/test/API/lit.site.cfg.in similarity index 93% rename from lldb/lit/Suite/lit.site.cfg.in rename to lldb/test/API/lit.site.cfg.in index 306967d61fd00..883bc4033005b 100644 --- a/lldb/lit/Suite/lit.site.cfg.in +++ b/lldb/test/API/lit.site.cfg.in @@ -20,7 +20,7 @@ config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@" config.lldb_module_cache = "@LLDB_TEST_MODULE_CACHE_LLDB@" config.clang_module_cache = "@LLDB_TEST_MODULE_CACHE_CLANG@" config.python_executable = "@PYTHON_EXECUTABLE@" -config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py" +config.dotest_path = "@LLDB_SOURCE_DIR@/test/API/dotest.py" config.dotest_args_str = "@LLDB_DOTEST_ARGS@" config.lldb_disable_python = @LLDB_DISABLE_PYTHON@ config.dotest_lit_args_str = None @@ -43,4 +43,4 @@ except KeyError as e: lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Suite/lit.cfg") +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/API/lit.cfg") diff --git a/lldb/lit/Suite/lldbtest.py b/lldb/test/API/lldbtest.py similarity index 100% rename from lldb/lit/Suite/lldbtest.py rename to lldb/test/API/lldbtest.py diff --git a/lldb/test/testcases b/lldb/test/API/testcases similarity index 100% rename from lldb/test/testcases rename to lldb/test/API/testcases diff --git a/lldb/test/use_lldb_suite.py b/lldb/test/API/use_lldb_suite.py similarity index 100% rename from lldb/test/use_lldb_suite.py rename to lldb/test/API/use_lldb_suite.py diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index 7080dc4520457..d54e9ce010bf9 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -1,149 +1,127 @@ -function(add_python_test_target name test_script args comment) - set(PYTHON_TEST_COMMAND - ${PYTHON_EXECUTABLE} - ${test_script} - ${args} - ) - - add_custom_target(${name} - COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS} - COMMENT "${comment}" - USES_TERMINAL - ) - add_dependencies(${name} lldb-test-deps) -endfunction() - -# The default architecture with which to compile test executables is the default LLVM target -# architecture, which itself defaults to the host architecture. -string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH) -if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" ) - string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE}) -endif () - -# Allow the user to override the default by setting LLDB_TEST_ARCH -set(LLDB_TEST_ARCH - ${LLDB_DEFAULT_TEST_ARCH} - CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64") - -# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script -set(LLDB_TEST_USER_ARGS - "" - CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'") - -# The .noindex suffix is a marker for Spotlight to never index the -# build directory. LLDB queries Spotlight to locate .dSYM bundles -# based on the UUID embedded in a binary, and because the UUID is a -# hash of filename and .text section, there *will* be conflicts inside -# the build directory. -set(LLDB_TEST_COMMON_ARGS - --arch=${LLDB_TEST_ARCH} - -s - ${CMAKE_BINARY_DIR}/lldb-test-traces - -S nm - -u CXXFLAGS - -u CFLAGS - ) - -list(APPEND LLDB_TEST_COMMON_ARGS - --executable ${LLDB_TEST_EXECUTABLE} - --dsymutil ${LLDB_TEST_DSYMUTIL} - --filecheck ${LLDB_TEST_FILECHECK} - -C ${LLDB_TEST_C_COMPILER} - ) - -if ( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - # All tests are currently flaky on Windows, so rerun them all once when they fail. - set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues) +# Test runner infrastructure for LLDB. This configures the LLDB test trees +# for use by Lit, and delegates to LLVM's lit test handlers. - set(LLDB_TEST_DEBUG_TEST_CRASHES - 0 - CACHE BOOL "(Windows only) Enables debugging of tests in the test suite by showing the crash dialog when lldb crashes") +add_subdirectory(API) - set(LLDB_TEST_HIDE_CONSOLE_WINDOWS - 1 - CACHE BOOL "(Windows only) Hides the console window for an inferior when it is launched through the test suite") +# LLVM_BUILD_MODE is used in lit.site.cfg +if (CMAKE_CFG_INTDIR STREQUAL ".") + set(LLVM_BUILD_MODE ".") +else () + set(LLVM_BUILD_MODE "%(build_mode)s") +endif () - if (LLDB_TEST_DEBUG_TEST_CRASHES) - set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --enable-crash-dialog) - endif() +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(LLDB_IS_64_BITS 1) +endif() - if (NOT LLDB_TEST_HIDE_CONSOLE_WINDOWS) - set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --show-inferior-console) +get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY) +set(dotest_args_replacement ${LLVM_BUILD_MODE}) + +set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.") +set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.") + +if(LLDB_BUILT_STANDALONE) + # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder. + string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR}) + string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") + + # Remaining ones must be paths to the provided LLVM build-tree. + if(LLVM_CONFIGURATION_TYPES) + # LLDB uses single-config; LLVM multi-config; pick one and prefer Release types. + # Otherwise, if both use multi-config the default is fine. + if(NOT CMAKE_CONFIGURATION_TYPES) + if(RelWithDebInfo IN_LIST LLVM_CONFIGURATION_TYPES) + set(dotest_args_replacement RelWithDebInfo) + elseif(Release IN_LIST LLVM_CONFIGURATION_TYPES) + set(dotest_args_replacement Release) + else() + list(GET LLVM_CONFIGURATION_TYPES 0 dotest_args_replacement) + endif() + endif() + else() + # Common case: LLVM used a single-configuration generator like Ninja. + set(dotest_args_replacement ".") endif() endif() -if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin") - list(APPEND LLDB_TEST_COMMON_ARGS - --env ARCHIVER=${CMAKE_AR} --env OBJCOPY=${CMAKE_OBJCOPY}) -endif() +string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}") +string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) +string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) + +add_lldb_test_dependency( + lit-cpuid + llc + lli + llvm-config + llvm-dwarfdump + llvm-nm + llvm-mc + llvm-objcopy + llvm-readobj + llvm-strip + ) -if (NOT "${LLDB_LIT_TOOLS_DIR}" STREQUAL "") - if (NOT EXISTS "${LLDB_LIT_TOOLS_DIR}") - message(WARNING "LLDB_LIT_TOOLS_DIR ${LLDB_LIT_TOOLS_DIR} does not exist.") +if(TARGET lld) + add_lldb_test_dependency(lld) +else() + # LLD is required to link test executables on Windows. + if (CMAKE_SYSTEM_NAME MATCHES "Windows") + message(WARNING "lld required to test LLDB on Windows") endif() endif() -if(CMAKE_HOST_APPLE) - if(LLDB_BUILD_FRAMEWORK) - get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY) - list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_build_dir}/LLDB.framework) - endif() +# the value is not canonicalized within LLVM +llvm_canonicalize_cmake_booleans( + LLDB_DISABLE_PYTHON + LLVM_ENABLE_ZLIB + LLVM_ENABLE_SHARED_LIBS + LLDB_IS_64_BITS) + +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Shell/lit.site.cfg.py + MAIN_CONFIG + ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit.cfg.py) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py + MAIN_CONFIG + ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/API/lit.site.cfg.in + ${CMAKE_CURRENT_BINARY_DIR}/API/lit.site.cfg) +configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py + MAIN_CONFIG + ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit.cfg.py) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit-lldb-init.in + ${CMAKE_CURRENT_BINARY_DIR}/Shell/lit-lldb-init) + +if(NOT LLDB_BUILT_STANDALONE) + add_lldb_test_dependency( + FileCheck + count + not + ) +endif() - # Use the same identity for testing - get_property(code_sign_identity_used GLOBAL PROPERTY LLDB_DEBUGSERVER_CODESIGN_IDENTITY) - if(code_sign_identity_used) - list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${code_sign_identity_used}") - endif() - if(LLDB_USE_SYSTEM_DEBUGSERVER) - lldb_find_system_debugserver(system_debugserver_path) - add_custom_target(debugserver - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${system_debugserver_path} ${LLVM_RUNTIME_OUTPUT_INTDIR} - COMMENT "Copying the system debugserver to LLDB's binaries directory for testing.") - # The custom target for the system debugserver has no install target, so we - # need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list. - if (LLVM_DISTRIBUTION_COMPONENTS) - list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS debugserver) - set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} PARENT_SCOPE) - endif() - message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}") - list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver) - add_lldb_test_dependency(debugserver) - elseif(TARGET debugserver) - set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver) - message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}") - list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path}) - add_lldb_test_dependency(debugserver) - elseif(TARGET lldb-server) - set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server) - message(STATUS "LLDB Tests use just-built lldb-server: ${lldb_server_path}") - list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path}) - add_lldb_test_dependency(lldb-server) - else() - message(WARNING "LLDB Tests enabled, but no server available") - endif() -endif() +add_lit_testsuites(LLDB + ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS lldb-test-deps + ) -set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}) -set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS}) +add_lit_testsuite(check-lldb-lit "Running lldb lit test suite" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS lldb-test-deps + ) + +set_target_properties(check-lldb-lit PROPERTIES FOLDER "lldb tests") add_custom_target(check-lldb) add_dependencies(check-lldb lldb-test-deps) set_target_properties(check-lldb PROPERTIES FOLDER "lldb misc") - -# LLD is required to link test executables on Windows. -if (CMAKE_SYSTEM_NAME MATCHES "Windows") - if (TARGET lld) - add_lldb_test_dependency(lld) - else () - message(WARNING "lld required to test LLDB on Windows") - endif () -endif () - -# Run the lit-style tests and the unittests as part of the check-lldb target. add_dependencies(check-lldb check-lldb-lit) - -# This will add LLDB's test dependencies to the dependencies for check-all and -# include them in the test-depends target. -set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS}) diff --git a/lldb/lit/Breakpoint/Inputs/case-sensitive.c b/lldb/test/Shell/Breakpoint/Inputs/case-sensitive.c similarity index 100% rename from lldb/lit/Breakpoint/Inputs/case-sensitive.c rename to lldb/test/Shell/Breakpoint/Inputs/case-sensitive.c diff --git a/lldb/lit/Breakpoint/Inputs/debug_addrx.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_addrx.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_addrx.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_addrx.yaml diff --git a/lldb/lit/Breakpoint/Inputs/debug_rnglist_basic.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_basic.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_rnglist_basic.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_basic.yaml diff --git a/lldb/lit/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml diff --git a/lldb/lit/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml diff --git a/lldb/lit/Breakpoint/Inputs/debug_rnglistx_rlex.yaml b/lldb/test/Shell/Breakpoint/Inputs/debug_rnglistx_rlex.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/debug_rnglistx_rlex.yaml rename to lldb/test/Shell/Breakpoint/Inputs/debug_rnglistx_rlex.yaml diff --git a/lldb/lit/Breakpoint/Inputs/implicit_const_form_support.yaml b/lldb/test/Shell/Breakpoint/Inputs/implicit_const_form_support.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/implicit_const_form_support.yaml rename to lldb/test/Shell/Breakpoint/Inputs/implicit_const_form_support.yaml diff --git a/lldb/lit/Breakpoint/Inputs/jitbp.cpp b/lldb/test/Shell/Breakpoint/Inputs/jitbp.cpp similarity index 100% rename from lldb/lit/Breakpoint/Inputs/jitbp.cpp rename to lldb/test/Shell/Breakpoint/Inputs/jitbp.cpp diff --git a/lldb/lit/Breakpoint/Inputs/ppc64-localentry.s b/lldb/test/Shell/Breakpoint/Inputs/ppc64-localentry.s similarity index 100% rename from lldb/lit/Breakpoint/Inputs/ppc64-localentry.s rename to lldb/test/Shell/Breakpoint/Inputs/ppc64-localentry.s diff --git a/lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.o.yaml b/lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.o.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.o.yaml rename to lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.o.yaml diff --git a/lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.yaml b/lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.yaml rename to lldb/test/Shell/Breakpoint/Inputs/single-file-split-dwarf.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml diff --git a/lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml b/lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml similarity index 100% rename from lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml rename to lldb/test/Shell/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml diff --git a/lldb/lit/Breakpoint/case-insensitive.test b/lldb/test/Shell/Breakpoint/case-insensitive.test similarity index 100% rename from lldb/lit/Breakpoint/case-insensitive.test rename to lldb/test/Shell/Breakpoint/case-insensitive.test diff --git a/lldb/lit/Breakpoint/case-sensitive.test b/lldb/test/Shell/Breakpoint/case-sensitive.test similarity index 100% rename from lldb/lit/Breakpoint/case-sensitive.test rename to lldb/test/Shell/Breakpoint/case-sensitive.test diff --git a/lldb/lit/Breakpoint/debug_addrx.test b/lldb/test/Shell/Breakpoint/debug_addrx.test similarity index 100% rename from lldb/lit/Breakpoint/debug_addrx.test rename to lldb/test/Shell/Breakpoint/debug_addrx.test diff --git a/lldb/lit/Breakpoint/debug_rnglist_basic.test b/lldb/test/Shell/Breakpoint/debug_rnglist_basic.test similarity index 100% rename from lldb/lit/Breakpoint/debug_rnglist_basic.test rename to lldb/test/Shell/Breakpoint/debug_rnglist_basic.test diff --git a/lldb/lit/Breakpoint/debug_rnglist_offset_pair.test b/lldb/test/Shell/Breakpoint/debug_rnglist_offset_pair.test similarity index 100% rename from lldb/lit/Breakpoint/debug_rnglist_offset_pair.test rename to lldb/test/Shell/Breakpoint/debug_rnglist_offset_pair.test diff --git a/lldb/lit/Breakpoint/debug_rnglist_rlestartend.test b/lldb/test/Shell/Breakpoint/debug_rnglist_rlestartend.test similarity index 100% rename from lldb/lit/Breakpoint/debug_rnglist_rlestartend.test rename to lldb/test/Shell/Breakpoint/debug_rnglist_rlestartend.test diff --git a/lldb/lit/Breakpoint/debug_rnglistx_rlex.test b/lldb/test/Shell/Breakpoint/debug_rnglistx_rlex.test similarity index 100% rename from lldb/lit/Breakpoint/debug_rnglistx_rlex.test rename to lldb/test/Shell/Breakpoint/debug_rnglistx_rlex.test diff --git a/lldb/lit/Breakpoint/implicit_const_form_support.test b/lldb/test/Shell/Breakpoint/implicit_const_form_support.test similarity index 100% rename from lldb/lit/Breakpoint/implicit_const_form_support.test rename to lldb/test/Shell/Breakpoint/implicit_const_form_support.test diff --git a/lldb/lit/Breakpoint/jitbp_elf.test b/lldb/test/Shell/Breakpoint/jitbp_elf.test similarity index 100% rename from lldb/lit/Breakpoint/jitbp_elf.test rename to lldb/test/Shell/Breakpoint/jitbp_elf.test diff --git a/lldb/lit/Breakpoint/ppc64-localentry.test b/lldb/test/Shell/Breakpoint/ppc64-localentry.test similarity index 100% rename from lldb/lit/Breakpoint/ppc64-localentry.test rename to lldb/test/Shell/Breakpoint/ppc64-localentry.test diff --git a/lldb/lit/Breakpoint/single-file-split-dwarf.test b/lldb/test/Shell/Breakpoint/single-file-split-dwarf.test similarity index 100% rename from lldb/lit/Breakpoint/single-file-split-dwarf.test rename to lldb/test/Shell/Breakpoint/single-file-split-dwarf.test diff --git a/lldb/lit/Breakpoint/split-dwarf-5-addrbase.test b/lldb/test/Shell/Breakpoint/split-dwarf-5-addrbase.test similarity index 100% rename from lldb/lit/Breakpoint/split-dwarf-5-addrbase.test rename to lldb/test/Shell/Breakpoint/split-dwarf-5-addrbase.test diff --git a/lldb/lit/Breakpoint/split-dwarf5-debug-stroffsets.test b/lldb/test/Shell/Breakpoint/split-dwarf5-debug-stroffsets.test similarity index 100% rename from lldb/lit/Breakpoint/split-dwarf5-debug-stroffsets.test rename to lldb/test/Shell/Breakpoint/split-dwarf5-debug-stroffsets.test diff --git a/lldb/lit/BuildScript/compiler-full-path.test b/lldb/test/Shell/BuildScript/compiler-full-path.test similarity index 100% rename from lldb/lit/BuildScript/compiler-full-path.test rename to lldb/test/Shell/BuildScript/compiler-full-path.test diff --git a/lldb/lit/BuildScript/modes.test b/lldb/test/Shell/BuildScript/modes.test similarity index 100% rename from lldb/lit/BuildScript/modes.test rename to lldb/test/Shell/BuildScript/modes.test diff --git a/lldb/lit/BuildScript/script-args.test b/lldb/test/Shell/BuildScript/script-args.test similarity index 100% rename from lldb/lit/BuildScript/script-args.test rename to lldb/test/Shell/BuildScript/script-args.test diff --git a/lldb/lit/BuildScript/toolchain-clang-cl.test b/lldb/test/Shell/BuildScript/toolchain-clang-cl.test similarity index 100% rename from lldb/lit/BuildScript/toolchain-clang-cl.test rename to lldb/test/Shell/BuildScript/toolchain-clang-cl.test diff --git a/lldb/lit/BuildScript/toolchain-clang.test b/lldb/test/Shell/BuildScript/toolchain-clang.test similarity index 100% rename from lldb/lit/BuildScript/toolchain-clang.test rename to lldb/test/Shell/BuildScript/toolchain-clang.test diff --git a/lldb/lit/BuildScript/toolchain-msvc.test b/lldb/test/Shell/BuildScript/toolchain-msvc.test similarity index 100% rename from lldb/lit/BuildScript/toolchain-msvc.test rename to lldb/test/Shell/BuildScript/toolchain-msvc.test diff --git a/lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test b/lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test similarity index 100% rename from lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test rename to lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test diff --git a/lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test b/lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test similarity index 100% rename from lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test rename to lldb/test/Shell/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test diff --git a/lldb/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py b/lldb/test/Shell/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py similarity index 100% rename from lldb/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py rename to lldb/test/Shell/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py diff --git a/lldb/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg b/lldb/test/Shell/Commands/CommandScriptImmediateOutput/lit.local.cfg similarity index 100% rename from lldb/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg rename to lldb/test/Shell/Commands/CommandScriptImmediateOutput/lit.local.cfg diff --git a/lldb/lit/Commands/Inputs/frame.py b/lldb/test/Shell/Commands/Inputs/frame.py similarity index 100% rename from lldb/lit/Commands/Inputs/frame.py rename to lldb/test/Shell/Commands/Inputs/frame.py diff --git a/lldb/lit/Commands/Inputs/main.c b/lldb/test/Shell/Commands/Inputs/main.c similarity index 100% rename from lldb/lit/Commands/Inputs/main.c rename to lldb/test/Shell/Commands/Inputs/main.c diff --git a/lldb/lit/Commands/command-backtrace.test b/lldb/test/Shell/Commands/command-backtrace.test similarity index 100% rename from lldb/lit/Commands/command-backtrace.test rename to lldb/test/Shell/Commands/command-backtrace.test diff --git a/lldb/lit/Commands/command-regex-delete.test b/lldb/test/Shell/Commands/command-regex-delete.test similarity index 100% rename from lldb/lit/Commands/command-regex-delete.test rename to lldb/test/Shell/Commands/command-regex-delete.test diff --git a/lldb/lit/Commands/command-regex-unalias.test b/lldb/test/Shell/Commands/command-regex-unalias.test similarity index 100% rename from lldb/lit/Commands/command-regex-unalias.test rename to lldb/test/Shell/Commands/command-regex-unalias.test diff --git a/lldb/lit/Commands/command-script-import.test b/lldb/test/Shell/Commands/command-script-import.test similarity index 100% rename from lldb/lit/Commands/command-script-import.test rename to lldb/test/Shell/Commands/command-script-import.test diff --git a/lldb/lit/Commands/command-source.test b/lldb/test/Shell/Commands/command-source.test similarity index 100% rename from lldb/lit/Commands/command-source.test rename to lldb/test/Shell/Commands/command-source.test diff --git a/lldb/lit/Driver/Inputs/.lldbinit b/lldb/test/Shell/Driver/Inputs/.lldbinit similarity index 100% rename from lldb/lit/Driver/Inputs/.lldbinit rename to lldb/test/Shell/Driver/Inputs/.lldbinit diff --git a/lldb/lit/Driver/Inputs/Print0.in b/lldb/test/Shell/Driver/Inputs/Print0.in similarity index 100% rename from lldb/lit/Driver/Inputs/Print0.in rename to lldb/test/Shell/Driver/Inputs/Print0.in diff --git a/lldb/lit/Driver/Inputs/Print2.in b/lldb/test/Shell/Driver/Inputs/Print2.in similarity index 100% rename from lldb/lit/Driver/Inputs/Print2.in rename to lldb/test/Shell/Driver/Inputs/Print2.in diff --git a/lldb/lit/Driver/Inputs/Print4.in b/lldb/test/Shell/Driver/Inputs/Print4.in similarity index 100% rename from lldb/lit/Driver/Inputs/Print4.in rename to lldb/test/Shell/Driver/Inputs/Print4.in diff --git a/lldb/lit/Driver/Inputs/Print6.in b/lldb/test/Shell/Driver/Inputs/Print6.in similarity index 100% rename from lldb/lit/Driver/Inputs/Print6.in rename to lldb/test/Shell/Driver/Inputs/Print6.in diff --git a/lldb/lit/Driver/Inputs/convenience.in b/lldb/test/Shell/Driver/Inputs/convenience.in similarity index 100% rename from lldb/lit/Driver/Inputs/convenience.in rename to lldb/test/Shell/Driver/Inputs/convenience.in diff --git a/lldb/lit/Driver/Inputs/hello.c b/lldb/test/Shell/Driver/Inputs/hello.c similarity index 100% rename from lldb/lit/Driver/Inputs/hello.c rename to lldb/test/Shell/Driver/Inputs/hello.c diff --git a/lldb/lit/Driver/Inputs/hello.cpp b/lldb/test/Shell/Driver/Inputs/hello.cpp similarity index 100% rename from lldb/lit/Driver/Inputs/hello.cpp rename to lldb/test/Shell/Driver/Inputs/hello.cpp diff --git a/lldb/lit/Driver/Inputs/process_attach_pid.in b/lldb/test/Shell/Driver/Inputs/process_attach_pid.in similarity index 100% rename from lldb/lit/Driver/Inputs/process_attach_pid.in rename to lldb/test/Shell/Driver/Inputs/process_attach_pid.in diff --git a/lldb/lit/Driver/Inputs/syntax_error.py b/lldb/test/Shell/Driver/Inputs/syntax_error.py similarity index 100% rename from lldb/lit/Driver/Inputs/syntax_error.py rename to lldb/test/Shell/Driver/Inputs/syntax_error.py diff --git a/lldb/lit/Driver/LocalLLDBInit.test b/lldb/test/Shell/Driver/LocalLLDBInit.test similarity index 100% rename from lldb/lit/Driver/LocalLLDBInit.test rename to lldb/test/Shell/Driver/LocalLLDBInit.test diff --git a/lldb/lit/Driver/TestCommands.test b/lldb/test/Shell/Driver/TestCommands.test similarity index 100% rename from lldb/lit/Driver/TestCommands.test rename to lldb/test/Shell/Driver/TestCommands.test diff --git a/lldb/lit/Driver/TestConvenienceVariables.test b/lldb/test/Shell/Driver/TestConvenienceVariables.test similarity index 100% rename from lldb/lit/Driver/TestConvenienceVariables.test rename to lldb/test/Shell/Driver/TestConvenienceVariables.test diff --git a/lldb/lit/Driver/TestCore.test b/lldb/test/Shell/Driver/TestCore.test similarity index 100% rename from lldb/lit/Driver/TestCore.test rename to lldb/test/Shell/Driver/TestCore.test diff --git a/lldb/lit/Driver/TestFile.test b/lldb/test/Shell/Driver/TestFile.test similarity index 100% rename from lldb/lit/Driver/TestFile.test rename to lldb/test/Shell/Driver/TestFile.test diff --git a/lldb/lit/Driver/TestNoUseColor.test b/lldb/test/Shell/Driver/TestNoUseColor.test similarity index 100% rename from lldb/lit/Driver/TestNoUseColor.test rename to lldb/test/Shell/Driver/TestNoUseColor.test diff --git a/lldb/lit/Driver/TestProcessAttach.test b/lldb/test/Shell/Driver/TestProcessAttach.test similarity index 100% rename from lldb/lit/Driver/TestProcessAttach.test rename to lldb/test/Shell/Driver/TestProcessAttach.test diff --git a/lldb/lit/Driver/TestRepl.test b/lldb/test/Shell/Driver/TestRepl.test similarity index 100% rename from lldb/lit/Driver/TestRepl.test rename to lldb/test/Shell/Driver/TestRepl.test diff --git a/lldb/lit/Driver/TestSingleQuote.test b/lldb/test/Shell/Driver/TestSingleQuote.test similarity index 100% rename from lldb/lit/Driver/TestSingleQuote.test rename to lldb/test/Shell/Driver/TestSingleQuote.test diff --git a/lldb/lit/Driver/TestTarget.test b/lldb/test/Shell/Driver/TestTarget.test similarity index 100% rename from lldb/lit/Driver/TestTarget.test rename to lldb/test/Shell/Driver/TestTarget.test diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads.cpp similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook-threads.cpp diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook.c b/lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook.c similarity index 100% rename from lldb/lit/ExecControl/StopHook/Inputs/stop-hook.c rename to lldb/test/Shell/ExecControl/StopHook/Inputs/stop-hook.c diff --git a/lldb/lit/ExecControl/StopHook/stop-hook-threads.test b/lldb/test/Shell/ExecControl/StopHook/stop-hook-threads.test similarity index 100% rename from lldb/lit/ExecControl/StopHook/stop-hook-threads.test rename to lldb/test/Shell/ExecControl/StopHook/stop-hook-threads.test diff --git a/lldb/lit/ExecControl/StopHook/stop-hook.test b/lldb/test/Shell/ExecControl/StopHook/stop-hook.test similarity index 100% rename from lldb/lit/ExecControl/StopHook/stop-hook.test rename to lldb/test/Shell/ExecControl/StopHook/stop-hook.test diff --git a/lldb/lit/Expr/Inputs/call-function.cpp b/lldb/test/Shell/Expr/Inputs/call-function.cpp similarity index 100% rename from lldb/lit/Expr/Inputs/call-function.cpp rename to lldb/test/Shell/Expr/Inputs/call-function.cpp diff --git a/lldb/lit/Expr/Inputs/ir-memory-map-basic b/lldb/test/Shell/Expr/Inputs/ir-memory-map-basic similarity index 100% rename from lldb/lit/Expr/Inputs/ir-memory-map-basic rename to lldb/test/Shell/Expr/Inputs/ir-memory-map-basic diff --git a/lldb/lit/Expr/Inputs/ir-memory-map-mix-malloc-free b/lldb/test/Shell/Expr/Inputs/ir-memory-map-mix-malloc-free similarity index 100% rename from lldb/lit/Expr/Inputs/ir-memory-map-mix-malloc-free rename to lldb/test/Shell/Expr/Inputs/ir-memory-map-mix-malloc-free diff --git a/lldb/lit/Expr/Inputs/ir-memory-map-overlap1 b/lldb/test/Shell/Expr/Inputs/ir-memory-map-overlap1 similarity index 100% rename from lldb/lit/Expr/Inputs/ir-memory-map-overlap1 rename to lldb/test/Shell/Expr/Inputs/ir-memory-map-overlap1 diff --git a/lldb/lit/Expr/TestIRMemoryMap.test b/lldb/test/Shell/Expr/TestIRMemoryMap.test similarity index 100% rename from lldb/lit/Expr/TestIRMemoryMap.test rename to lldb/test/Shell/Expr/TestIRMemoryMap.test diff --git a/lldb/lit/Expr/TestIRMemoryMapWindows.test b/lldb/test/Shell/Expr/TestIRMemoryMapWindows.test similarity index 100% rename from lldb/lit/Expr/TestIRMemoryMapWindows.test rename to lldb/test/Shell/Expr/TestIRMemoryMapWindows.test diff --git a/lldb/lit/Expr/TestMultilineExpr.test b/lldb/test/Shell/Expr/TestMultilineExpr.test similarity index 100% rename from lldb/lit/Expr/TestMultilineExpr.test rename to lldb/test/Shell/Expr/TestMultilineExpr.test diff --git a/lldb/lit/Expr/TestTypeOfDeclTypeExpr.test b/lldb/test/Shell/Expr/TestTypeOfDeclTypeExpr.test similarity index 100% rename from lldb/lit/Expr/TestTypeOfDeclTypeExpr.test rename to lldb/test/Shell/Expr/TestTypeOfDeclTypeExpr.test diff --git a/lldb/lit/Heap/Inputs/cstr.c b/lldb/test/Shell/Heap/Inputs/cstr.c similarity index 100% rename from lldb/lit/Heap/Inputs/cstr.c rename to lldb/test/Shell/Heap/Inputs/cstr.c diff --git a/lldb/lit/Heap/heap-cstr.test b/lldb/test/Shell/Heap/heap-cstr.test similarity index 100% rename from lldb/lit/Heap/heap-cstr.test rename to lldb/test/Shell/Heap/heap-cstr.test diff --git a/lldb/lit/Host/Inputs/simple.c b/lldb/test/Shell/Host/Inputs/simple.c similarity index 100% rename from lldb/lit/Host/Inputs/simple.c rename to lldb/test/Shell/Host/Inputs/simple.c diff --git a/lldb/lit/Host/TestCustomShell.test b/lldb/test/Shell/Host/TestCustomShell.test similarity index 100% rename from lldb/lit/Host/TestCustomShell.test rename to lldb/test/Shell/Host/TestCustomShell.test diff --git a/lldb/lit/Minidump/Inputs/linux-x86_64.syms b/lldb/test/Shell/Minidump/Inputs/linux-x86_64.syms similarity index 100% rename from lldb/lit/Minidump/Inputs/linux-x86_64.syms rename to lldb/test/Shell/Minidump/Inputs/linux-x86_64.syms diff --git a/lldb/lit/Minidump/Inputs/linux-x86_64.yaml b/lldb/test/Shell/Minidump/Inputs/linux-x86_64.yaml similarity index 100% rename from lldb/lit/Minidump/Inputs/linux-x86_64.yaml rename to lldb/test/Shell/Minidump/Inputs/linux-x86_64.yaml diff --git a/lldb/lit/Minidump/Windows/Inputs/find-module.dmp.yaml b/lldb/test/Shell/Minidump/Windows/Inputs/find-module.dmp.yaml similarity index 100% rename from lldb/lit/Minidump/Windows/Inputs/find-module.dmp.yaml rename to lldb/test/Shell/Minidump/Windows/Inputs/find-module.dmp.yaml diff --git a/lldb/lit/Minidump/Windows/Inputs/find-module.exe.yaml b/lldb/test/Shell/Minidump/Windows/Inputs/find-module.exe.yaml similarity index 100% rename from lldb/lit/Minidump/Windows/Inputs/find-module.exe.yaml rename to lldb/test/Shell/Minidump/Windows/Inputs/find-module.exe.yaml diff --git a/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp b/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp rename to lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp diff --git a/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp b/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp rename to lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp diff --git a/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit b/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit rename to lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit diff --git a/lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb b/lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb rename to lldb/test/Shell/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb diff --git a/lldb/lit/Minidump/Windows/Sigsegv/sigsegv.test b/lldb/test/Shell/Minidump/Windows/Sigsegv/sigsegv.test similarity index 100% rename from lldb/lit/Minidump/Windows/Sigsegv/sigsegv.test rename to lldb/test/Shell/Minidump/Windows/Sigsegv/sigsegv.test diff --git a/lldb/lit/Minidump/Windows/find-module.test b/lldb/test/Shell/Minidump/Windows/find-module.test similarity index 100% rename from lldb/lit/Minidump/Windows/find-module.test rename to lldb/test/Shell/Minidump/Windows/find-module.test diff --git a/lldb/lit/Minidump/breakpad-symbols.test b/lldb/test/Shell/Minidump/breakpad-symbols.test similarity index 100% rename from lldb/lit/Minidump/breakpad-symbols.test rename to lldb/test/Shell/Minidump/breakpad-symbols.test diff --git a/lldb/lit/Minidump/disassemble-no-module.yaml b/lldb/test/Shell/Minidump/disassemble-no-module.yaml similarity index 100% rename from lldb/lit/Minidump/disassemble-no-module.yaml rename to lldb/test/Shell/Minidump/disassemble-no-module.yaml diff --git a/lldb/lit/Minidump/dump-all.test b/lldb/test/Shell/Minidump/dump-all.test similarity index 100% rename from lldb/lit/Minidump/dump-all.test rename to lldb/test/Shell/Minidump/dump-all.test diff --git a/lldb/lit/Minidump/fb-dump.test b/lldb/test/Shell/Minidump/fb-dump.test similarity index 100% rename from lldb/lit/Minidump/fb-dump.test rename to lldb/test/Shell/Minidump/fb-dump.test diff --git a/lldb/lit/Minidump/lit.local.cfg b/lldb/test/Shell/Minidump/lit.local.cfg similarity index 100% rename from lldb/lit/Minidump/lit.local.cfg rename to lldb/test/Shell/Minidump/lit.local.cfg diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-linux.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-linux.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-macosx.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-windows.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/identification-windows.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/sections.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml b/lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml rename to lldb/test/Shell/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml diff --git a/lldb/lit/ObjectFile/Breakpad/breakpad-identification.test b/lldb/test/Shell/ObjectFile/Breakpad/breakpad-identification.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/breakpad-identification.test rename to lldb/test/Shell/ObjectFile/Breakpad/breakpad-identification.test diff --git a/lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test b/lldb/test/Shell/ObjectFile/Breakpad/discontiguous-sections.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test rename to lldb/test/Shell/ObjectFile/Breakpad/discontiguous-sections.test diff --git a/lldb/lit/ObjectFile/Breakpad/lit.local.cfg b/lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/lit.local.cfg rename to lldb/test/Shell/ObjectFile/Breakpad/lit.local.cfg diff --git a/lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test b/lldb/test/Shell/ObjectFile/Breakpad/sections-trailing-func.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test rename to lldb/test/Shell/ObjectFile/Breakpad/sections-trailing-func.test diff --git a/lldb/lit/ObjectFile/Breakpad/sections.test b/lldb/test/Shell/ObjectFile/Breakpad/sections.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/sections.test rename to lldb/test/Shell/ObjectFile/Breakpad/sections.test diff --git a/lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test b/lldb/test/Shell/ObjectFile/Breakpad/uuid-matching-mac.test similarity index 100% rename from lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test rename to lldb/test/Shell/ObjectFile/Breakpad/uuid-matching-mac.test diff --git a/lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf b/lldb/test/Shell/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf similarity index 100% rename from lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf rename to lldb/test/Shell/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf diff --git a/lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c b/lldb/test/Shell/ObjectFile/ELF/Inputs/minidebuginfo-main.c similarity index 100% rename from lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c rename to lldb/test/Shell/ObjectFile/ELF/Inputs/minidebuginfo-main.c diff --git a/lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core b/lldb/test/Shell/ObjectFile/ELF/Inputs/netbsd-amd64.core similarity index 100% rename from lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core rename to lldb/test/Shell/ObjectFile/ELF/Inputs/netbsd-amd64.core diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-empty.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-empty.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-section.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap-section.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD-overlap.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_LOAD.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_LOAD.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_LOAD.yaml diff --git a/lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml b/lldb/test/Shell/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml rename to lldb/test/Shell/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml diff --git a/lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml b/lldb/test/Shell/ObjectFile/ELF/aarch64-relocations.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml rename to lldb/test/Shell/ObjectFile/ELF/aarch64-relocations.yaml diff --git a/lldb/lit/ObjectFile/ELF/base-address.yaml b/lldb/test/Shell/ObjectFile/ELF/base-address.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/base-address.yaml rename to lldb/test/Shell/ObjectFile/ELF/base-address.yaml diff --git a/lldb/lit/ObjectFile/ELF/basic-info.yaml b/lldb/test/Shell/ObjectFile/ELF/basic-info.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/basic-info.yaml rename to lldb/test/Shell/ObjectFile/ELF/basic-info.yaml diff --git a/lldb/lit/ObjectFile/ELF/build-id-case.yaml b/lldb/test/Shell/ObjectFile/ELF/build-id-case.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/build-id-case.yaml rename to lldb/test/Shell/ObjectFile/ELF/build-id-case.yaml diff --git a/lldb/lit/ObjectFile/ELF/compressed-sections.yaml b/lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/compressed-sections.yaml rename to lldb/test/Shell/ObjectFile/ELF/compressed-sections.yaml diff --git a/lldb/lit/ObjectFile/ELF/duplicate-section.yaml b/lldb/test/Shell/ObjectFile/ELF/duplicate-section.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/duplicate-section.yaml rename to lldb/test/Shell/ObjectFile/ELF/duplicate-section.yaml diff --git a/lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml b/lldb/test/Shell/ObjectFile/ELF/gnu-debuglink.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml rename to lldb/test/Shell/ObjectFile/ELF/gnu-debuglink.yaml diff --git a/lldb/lit/ObjectFile/ELF/many-sections.s b/lldb/test/Shell/ObjectFile/ELF/many-sections.s similarity index 100% rename from lldb/lit/ObjectFile/ELF/many-sections.s rename to lldb/test/Shell/ObjectFile/ELF/many-sections.s diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml rename to lldb/test/Shell/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-find-symbols.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml rename to lldb/test/Shell/ObjectFile/ELF/minidebuginfo-find-symbols.yaml diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-no-lzma.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml rename to lldb/test/Shell/ObjectFile/ELF/minidebuginfo-no-lzma.yaml diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test b/lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test similarity index 100% rename from lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test rename to lldb/test/Shell/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test diff --git a/lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test b/lldb/test/Shell/ObjectFile/ELF/netbsd-core-amd64.test similarity index 100% rename from lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test rename to lldb/test/Shell/ObjectFile/ELF/netbsd-core-amd64.test diff --git a/lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml b/lldb/test/Shell/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml rename to lldb/test/Shell/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-addresses.yaml b/lldb/test/Shell/ObjectFile/ELF/section-addresses.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-addresses.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-addresses.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-overlap.yaml b/lldb/test/Shell/ObjectFile/ELF/section-overlap.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-overlap.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-overlap.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-permissions.yaml b/lldb/test/Shell/ObjectFile/ELF/section-permissions.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-permissions.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-permissions.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml b/lldb/test/Shell/ObjectFile/ELF/section-types-edgecases.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-types-edgecases.yaml diff --git a/lldb/lit/ObjectFile/ELF/section-types.yaml b/lldb/test/Shell/ObjectFile/ELF/section-types.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/section-types.yaml rename to lldb/test/Shell/ObjectFile/ELF/section-types.yaml diff --git a/lldb/lit/ObjectFile/ELF/short-build-id.yaml b/lldb/test/Shell/ObjectFile/ELF/short-build-id.yaml similarity index 100% rename from lldb/lit/ObjectFile/ELF/short-build-id.yaml rename to lldb/test/Shell/ObjectFile/ELF/short-build-id.yaml diff --git a/lldb/lit/ObjectFile/MachO/lc_build_version.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/lc_build_version.yaml rename to lldb/test/Shell/ObjectFile/MachO/lc_build_version.yaml diff --git a/lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml rename to lldb/test/Shell/ObjectFile/MachO/lc_build_version_notools.yaml diff --git a/lldb/lit/ObjectFile/MachO/lc_version_min.yaml b/lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/lc_version_min.yaml rename to lldb/test/Shell/ObjectFile/MachO/lc_version_min.yaml diff --git a/lldb/lit/ObjectFile/MachO/subsections.yaml b/lldb/test/Shell/ObjectFile/MachO/subsections.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/subsections.yaml rename to lldb/test/Shell/ObjectFile/MachO/subsections.yaml diff --git a/lldb/lit/ObjectFile/MachO/symtab.yaml b/lldb/test/Shell/ObjectFile/MachO/symtab.yaml similarity index 100% rename from lldb/lit/ObjectFile/MachO/symtab.yaml rename to lldb/test/Shell/ObjectFile/MachO/symtab.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml b/lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml b/lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm64.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/basic-info-arm64.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/basic-info.yaml b/lldb/test/Shell/ObjectFile/PECOFF/basic-info.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/basic-info.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/basic-info.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/dep-modules.yaml b/lldb/test/Shell/ObjectFile/PECOFF/dep-modules.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/dep-modules.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/dep-modules.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml b/lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/export-dllfunc.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/lit.local.cfg b/lldb/test/Shell/ObjectFile/PECOFF/lit.local.cfg similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/lit.local.cfg rename to lldb/test/Shell/ObjectFile/PECOFF/lit.local.cfg diff --git a/lldb/lit/ObjectFile/PECOFF/sections-names.yaml b/lldb/test/Shell/ObjectFile/PECOFF/sections-names.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/sections-names.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/sections-names.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/subsections.yaml b/lldb/test/Shell/ObjectFile/PECOFF/subsections.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/subsections.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/subsections.yaml diff --git a/lldb/lit/ObjectFile/PECOFF/uuid.yaml b/lldb/test/Shell/ObjectFile/PECOFF/uuid.yaml similarity index 100% rename from lldb/lit/ObjectFile/PECOFF/uuid.yaml rename to lldb/test/Shell/ObjectFile/PECOFF/uuid.yaml diff --git a/lldb/lit/ObjectFile/lit.local.cfg b/lldb/test/Shell/ObjectFile/lit.local.cfg similarity index 100% rename from lldb/lit/ObjectFile/lit.local.cfg rename to lldb/test/Shell/ObjectFile/lit.local.cfg diff --git a/lldb/lit/Process/Inputs/env.cpp b/lldb/test/Shell/Process/Inputs/env.cpp similarity index 100% rename from lldb/lit/Process/Inputs/env.cpp rename to lldb/test/Shell/Process/Inputs/env.cpp diff --git a/lldb/lit/Process/TestEnvironment.test b/lldb/test/Shell/Process/TestEnvironment.test similarity index 100% rename from lldb/lit/Process/TestEnvironment.test rename to lldb/test/Shell/Process/TestEnvironment.test diff --git a/lldb/lit/Process/Windows/exception_access_violation.cpp b/lldb/test/Shell/Process/Windows/exception_access_violation.cpp similarity index 100% rename from lldb/lit/Process/Windows/exception_access_violation.cpp rename to lldb/test/Shell/Process/Windows/exception_access_violation.cpp diff --git a/lldb/lit/Python/crashlog.test b/lldb/test/Shell/Python/crashlog.test similarity index 97% rename from lldb/lit/Python/crashlog.test rename to lldb/test/Shell/Python/crashlog.test index 7ea7c0b5d74af..24d72eae41fa9 100644 --- a/lldb/lit/Python/crashlog.test +++ b/lldb/test/Shell/Python/crashlog.test @@ -1,6 +1,6 @@ # -*- python -*- # REQUIRES: system-darwin -# RUN: cd %S/../../examples/python && cat %s | %lldb | FileCheck %s +# RUN: cd %S/../../../examples/python && cat %s | %lldb | FileCheck %s # CHECK-LABEL: {{S}}KIP BEYOND CHECKS script import crashlog @@ -44,7 +44,7 @@ images = [ # CHECK: (0) # CHECK: 01234 # CHECK: /tmp/MyApp Pro.app/MyApp Pro - + "0x7fff63f20000 - 0x7fff63f77ff7 libc++.1.dylib (400.9.4) /usr/lib/libc++.1.dylib" # CHECK: 0x7fff63f20000 # CHECK: 0x7fff63f77ff7 diff --git a/lldb/lit/Quit/TestQuitExitCode-30.test b/lldb/test/Shell/Quit/TestQuitExitCode-30.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCode-30.test rename to lldb/test/Shell/Quit/TestQuitExitCode-30.test diff --git a/lldb/lit/Quit/TestQuitExitCode0.test b/lldb/test/Shell/Quit/TestQuitExitCode0.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCode0.test rename to lldb/test/Shell/Quit/TestQuitExitCode0.test diff --git a/lldb/lit/Quit/TestQuitExitCode30.test b/lldb/test/Shell/Quit/TestQuitExitCode30.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCode30.test rename to lldb/test/Shell/Quit/TestQuitExitCode30.test diff --git a/lldb/lit/Quit/TestQuitExitCodeHex0.test b/lldb/test/Shell/Quit/TestQuitExitCodeHex0.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeHex0.test rename to lldb/test/Shell/Quit/TestQuitExitCodeHex0.test diff --git a/lldb/lit/Quit/TestQuitExitCodeHexA.test b/lldb/test/Shell/Quit/TestQuitExitCodeHexA.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeHexA.test rename to lldb/test/Shell/Quit/TestQuitExitCodeHexA.test diff --git a/lldb/lit/Quit/TestQuitExitCodeImplicit0.test b/lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeImplicit0.test rename to lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test diff --git a/lldb/lit/Quit/TestQuitExitCodeNonInt.test b/lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeNonInt.test rename to lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test diff --git a/lldb/lit/Quit/TestQuitExitCodeTooManyArgs.test b/lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test similarity index 100% rename from lldb/lit/Quit/TestQuitExitCodeTooManyArgs.test rename to lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test diff --git a/lldb/lit/Quit/expect_exit_code.py b/lldb/test/Shell/Quit/expect_exit_code.py similarity index 100% rename from lldb/lit/Quit/expect_exit_code.py rename to lldb/test/Shell/Quit/expect_exit_code.py diff --git a/lldb/lit/Register/Inputs/x86-64-gp-read.cpp b/lldb/test/Shell/Register/Inputs/x86-64-gp-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-64-gp-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-64-gp-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-64-gp-write.cpp b/lldb/test/Shell/Register/Inputs/x86-64-gp-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-64-gp-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-64-gp-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-64-read.cpp b/lldb/test/Shell/Register/Inputs/x86-64-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-64-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-64-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-64-write.cpp b/lldb/test/Shell/Register/Inputs/x86-64-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-64-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-64-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-gp-read.cpp b/lldb/test/Shell/Register/Inputs/x86-gp-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-gp-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-gp-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-gp-write.cpp b/lldb/test/Shell/Register/Inputs/x86-gp-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-gp-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-gp-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-mm-xmm-read.cpp b/lldb/test/Shell/Register/Inputs/x86-mm-xmm-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-mm-xmm-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-mm-xmm-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp b/lldb/test/Shell/Register/Inputs/x86-mm-xmm-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-mm-xmm-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-ymm-read.cpp b/lldb/test/Shell/Register/Inputs/x86-ymm-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-ymm-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-ymm-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-ymm-write.cpp b/lldb/test/Shell/Register/Inputs/x86-ymm-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-ymm-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-ymm-write.cpp diff --git a/lldb/lit/Register/Inputs/x86-zmm-read.cpp b/lldb/test/Shell/Register/Inputs/x86-zmm-read.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-zmm-read.cpp rename to lldb/test/Shell/Register/Inputs/x86-zmm-read.cpp diff --git a/lldb/lit/Register/Inputs/x86-zmm-write.cpp b/lldb/test/Shell/Register/Inputs/x86-zmm-write.cpp similarity index 100% rename from lldb/lit/Register/Inputs/x86-zmm-write.cpp rename to lldb/test/Shell/Register/Inputs/x86-zmm-write.cpp diff --git a/lldb/lit/Register/x86-64-gp-read.test b/lldb/test/Shell/Register/x86-64-gp-read.test similarity index 100% rename from lldb/lit/Register/x86-64-gp-read.test rename to lldb/test/Shell/Register/x86-64-gp-read.test diff --git a/lldb/lit/Register/x86-64-gp-write.test b/lldb/test/Shell/Register/x86-64-gp-write.test similarity index 100% rename from lldb/lit/Register/x86-64-gp-write.test rename to lldb/test/Shell/Register/x86-64-gp-write.test diff --git a/lldb/lit/Register/x86-64-read.test b/lldb/test/Shell/Register/x86-64-read.test similarity index 100% rename from lldb/lit/Register/x86-64-read.test rename to lldb/test/Shell/Register/x86-64-read.test diff --git a/lldb/lit/Register/x86-64-write.test b/lldb/test/Shell/Register/x86-64-write.test similarity index 100% rename from lldb/lit/Register/x86-64-write.test rename to lldb/test/Shell/Register/x86-64-write.test diff --git a/lldb/lit/Register/x86-64-xmm16-read.test b/lldb/test/Shell/Register/x86-64-xmm16-read.test similarity index 100% rename from lldb/lit/Register/x86-64-xmm16-read.test rename to lldb/test/Shell/Register/x86-64-xmm16-read.test diff --git a/lldb/lit/Register/x86-64-xmm16-write.test b/lldb/test/Shell/Register/x86-64-xmm16-write.test similarity index 100% rename from lldb/lit/Register/x86-64-xmm16-write.test rename to lldb/test/Shell/Register/x86-64-xmm16-write.test diff --git a/lldb/lit/Register/x86-64-ymm-read.test b/lldb/test/Shell/Register/x86-64-ymm-read.test similarity index 100% rename from lldb/lit/Register/x86-64-ymm-read.test rename to lldb/test/Shell/Register/x86-64-ymm-read.test diff --git a/lldb/lit/Register/x86-64-ymm-write.test b/lldb/test/Shell/Register/x86-64-ymm-write.test similarity index 100% rename from lldb/lit/Register/x86-64-ymm-write.test rename to lldb/test/Shell/Register/x86-64-ymm-write.test diff --git a/lldb/lit/Register/x86-64-ymm16-read.test b/lldb/test/Shell/Register/x86-64-ymm16-read.test similarity index 100% rename from lldb/lit/Register/x86-64-ymm16-read.test rename to lldb/test/Shell/Register/x86-64-ymm16-read.test diff --git a/lldb/lit/Register/x86-64-ymm16-write.test b/lldb/test/Shell/Register/x86-64-ymm16-write.test similarity index 100% rename from lldb/lit/Register/x86-64-ymm16-write.test rename to lldb/test/Shell/Register/x86-64-ymm16-write.test diff --git a/lldb/lit/Register/x86-64-zmm-read.test b/lldb/test/Shell/Register/x86-64-zmm-read.test similarity index 100% rename from lldb/lit/Register/x86-64-zmm-read.test rename to lldb/test/Shell/Register/x86-64-zmm-read.test diff --git a/lldb/lit/Register/x86-64-zmm-write.test b/lldb/test/Shell/Register/x86-64-zmm-write.test similarity index 100% rename from lldb/lit/Register/x86-64-zmm-write.test rename to lldb/test/Shell/Register/x86-64-zmm-write.test diff --git a/lldb/lit/Register/x86-gp-read.test b/lldb/test/Shell/Register/x86-gp-read.test similarity index 100% rename from lldb/lit/Register/x86-gp-read.test rename to lldb/test/Shell/Register/x86-gp-read.test diff --git a/lldb/lit/Register/x86-gp-write.test b/lldb/test/Shell/Register/x86-gp-write.test similarity index 100% rename from lldb/lit/Register/x86-gp-write.test rename to lldb/test/Shell/Register/x86-gp-write.test diff --git a/lldb/lit/Register/x86-mm-xmm-read.test b/lldb/test/Shell/Register/x86-mm-xmm-read.test similarity index 100% rename from lldb/lit/Register/x86-mm-xmm-read.test rename to lldb/test/Shell/Register/x86-mm-xmm-read.test diff --git a/lldb/lit/Register/x86-mm-xmm-write.test b/lldb/test/Shell/Register/x86-mm-xmm-write.test similarity index 100% rename from lldb/lit/Register/x86-mm-xmm-write.test rename to lldb/test/Shell/Register/x86-mm-xmm-write.test diff --git a/lldb/lit/Register/x86-ymm-read.test b/lldb/test/Shell/Register/x86-ymm-read.test similarity index 100% rename from lldb/lit/Register/x86-ymm-read.test rename to lldb/test/Shell/Register/x86-ymm-read.test diff --git a/lldb/lit/Register/x86-ymm-write.test b/lldb/test/Shell/Register/x86-ymm-write.test similarity index 100% rename from lldb/lit/Register/x86-ymm-write.test rename to lldb/test/Shell/Register/x86-ymm-write.test diff --git a/lldb/lit/Register/x86-zmm-read.test b/lldb/test/Shell/Register/x86-zmm-read.test similarity index 100% rename from lldb/lit/Register/x86-zmm-read.test rename to lldb/test/Shell/Register/x86-zmm-read.test diff --git a/lldb/lit/Register/x86-zmm-write.test b/lldb/test/Shell/Register/x86-zmm-write.test similarity index 100% rename from lldb/lit/Register/x86-zmm-write.test rename to lldb/test/Shell/Register/x86-zmm-write.test diff --git a/lldb/lit/Reproducer/Functionalities/Inputs/DataFormatter.in b/lldb/test/Shell/Reproducer/Functionalities/Inputs/DataFormatter.in similarity index 100% rename from lldb/lit/Reproducer/Functionalities/Inputs/DataFormatter.in rename to lldb/test/Shell/Reproducer/Functionalities/Inputs/DataFormatter.in diff --git a/lldb/lit/Reproducer/Functionalities/Inputs/foo.cpp b/lldb/test/Shell/Reproducer/Functionalities/Inputs/foo.cpp similarity index 100% rename from lldb/lit/Reproducer/Functionalities/Inputs/foo.cpp rename to lldb/test/Shell/Reproducer/Functionalities/Inputs/foo.cpp diff --git a/lldb/lit/Reproducer/Functionalities/Inputs/stepping.c b/lldb/test/Shell/Reproducer/Functionalities/Inputs/stepping.c similarity index 100% rename from lldb/lit/Reproducer/Functionalities/Inputs/stepping.c rename to lldb/test/Shell/Reproducer/Functionalities/Inputs/stepping.c diff --git a/lldb/lit/Reproducer/Functionalities/TestDataFormatter.test b/lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test similarity index 100% rename from lldb/lit/Reproducer/Functionalities/TestDataFormatter.test rename to lldb/test/Shell/Reproducer/Functionalities/TestDataFormatter.test diff --git a/lldb/lit/Reproducer/Functionalities/TestImageList.test b/lldb/test/Shell/Reproducer/Functionalities/TestImageList.test similarity index 100% rename from lldb/lit/Reproducer/Functionalities/TestImageList.test rename to lldb/test/Shell/Reproducer/Functionalities/TestImageList.test diff --git a/lldb/lit/Reproducer/Functionalities/TestStepping.test b/lldb/test/Shell/Reproducer/Functionalities/TestStepping.test similarity index 100% rename from lldb/lit/Reproducer/Functionalities/TestStepping.test rename to lldb/test/Shell/Reproducer/Functionalities/TestStepping.test diff --git a/lldb/lit/Reproducer/Inputs/FileCapture.in b/lldb/test/Shell/Reproducer/Inputs/FileCapture.in similarity index 100% rename from lldb/lit/Reproducer/Inputs/FileCapture.in rename to lldb/test/Shell/Reproducer/Inputs/FileCapture.in diff --git a/lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in b/lldb/test/Shell/Reproducer/Inputs/GDBRemoteCapture.in similarity index 100% rename from lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in rename to lldb/test/Shell/Reproducer/Inputs/GDBRemoteCapture.in diff --git a/lldb/lit/Reproducer/Inputs/simple.c b/lldb/test/Shell/Reproducer/Inputs/simple.c similarity index 100% rename from lldb/lit/Reproducer/Inputs/simple.c rename to lldb/test/Shell/Reproducer/Inputs/simple.c diff --git a/lldb/lit/Reproducer/Modules/Inputs/Bar.h b/lldb/test/Shell/Reproducer/Modules/Inputs/Bar.h similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/Bar.h rename to lldb/test/Shell/Reproducer/Modules/Inputs/Bar.h diff --git a/lldb/lit/Reproducer/Modules/Inputs/Foo.h b/lldb/test/Shell/Reproducer/Modules/Inputs/Foo.h similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/Foo.h rename to lldb/test/Shell/Reproducer/Modules/Inputs/Foo.h diff --git a/lldb/lit/Reproducer/Modules/Inputs/ModuleCXX.in b/lldb/test/Shell/Reproducer/Modules/Inputs/ModuleCXX.in similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/ModuleCXX.in rename to lldb/test/Shell/Reproducer/Modules/Inputs/ModuleCXX.in diff --git a/lldb/lit/Reproducer/Modules/Inputs/main.cpp b/lldb/test/Shell/Reproducer/Modules/Inputs/main.cpp similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/main.cpp rename to lldb/test/Shell/Reproducer/Modules/Inputs/main.cpp diff --git a/lldb/lit/Reproducer/Modules/Inputs/module.modulemap b/lldb/test/Shell/Reproducer/Modules/Inputs/module.modulemap similarity index 100% rename from lldb/lit/Reproducer/Modules/Inputs/module.modulemap rename to lldb/test/Shell/Reproducer/Modules/Inputs/module.modulemap diff --git a/lldb/lit/Reproducer/Modules/TestModuleCXX.test b/lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test similarity index 100% rename from lldb/lit/Reproducer/Modules/TestModuleCXX.test rename to lldb/test/Shell/Reproducer/Modules/TestModuleCXX.test diff --git a/lldb/lit/Reproducer/TestDriverOptions.test b/lldb/test/Shell/Reproducer/TestDriverOptions.test similarity index 100% rename from lldb/lit/Reproducer/TestDriverOptions.test rename to lldb/test/Shell/Reproducer/TestDriverOptions.test diff --git a/lldb/lit/Reproducer/TestDump.test b/lldb/test/Shell/Reproducer/TestDump.test similarity index 100% rename from lldb/lit/Reproducer/TestDump.test rename to lldb/test/Shell/Reproducer/TestDump.test diff --git a/lldb/lit/Reproducer/TestFileRepro.test b/lldb/test/Shell/Reproducer/TestFileRepro.test similarity index 100% rename from lldb/lit/Reproducer/TestFileRepro.test rename to lldb/test/Shell/Reproducer/TestFileRepro.test diff --git a/lldb/lit/Reproducer/TestGDBRemoteRepro.test b/lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test similarity index 100% rename from lldb/lit/Reproducer/TestGDBRemoteRepro.test rename to lldb/test/Shell/Reproducer/TestGDBRemoteRepro.test diff --git a/lldb/lit/Reproducer/TestRelativePath.test b/lldb/test/Shell/Reproducer/TestRelativePath.test similarity index 100% rename from lldb/lit/Reproducer/TestRelativePath.test rename to lldb/test/Shell/Reproducer/TestRelativePath.test diff --git a/lldb/lit/Reproducer/TestReuseDirectory.test b/lldb/test/Shell/Reproducer/TestReuseDirectory.test similarity index 100% rename from lldb/lit/Reproducer/TestReuseDirectory.test rename to lldb/test/Shell/Reproducer/TestReuseDirectory.test diff --git a/lldb/lit/Reproducer/TestSynchronous.test b/lldb/test/Shell/Reproducer/TestSynchronous.test similarity index 100% rename from lldb/lit/Reproducer/TestSynchronous.test rename to lldb/test/Shell/Reproducer/TestSynchronous.test diff --git a/lldb/lit/Settings/Inputs/DontStopCommandSource.in b/lldb/test/Shell/Settings/Inputs/DontStopCommandSource.in similarity index 100% rename from lldb/lit/Settings/Inputs/DontStopCommandSource.in rename to lldb/test/Shell/Settings/Inputs/DontStopCommandSource.in diff --git a/lldb/lit/Settings/Inputs/EchoCommandsAll.out b/lldb/test/Shell/Settings/Inputs/EchoCommandsAll.out similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsAll.out rename to lldb/test/Shell/Settings/Inputs/EchoCommandsAll.out diff --git a/lldb/lit/Settings/Inputs/EchoCommandsNoComments.out b/lldb/test/Shell/Settings/Inputs/EchoCommandsNoComments.out similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsNoComments.out rename to lldb/test/Shell/Settings/Inputs/EchoCommandsNoComments.out diff --git a/lldb/lit/Settings/Inputs/EchoCommandsNone.out b/lldb/test/Shell/Settings/Inputs/EchoCommandsNone.out similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsNone.out rename to lldb/test/Shell/Settings/Inputs/EchoCommandsNone.out diff --git a/lldb/lit/Settings/Inputs/EchoCommandsQuiet.out b/lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsQuiet.out rename to lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out diff --git a/lldb/lit/Settings/Inputs/EchoCommandsTest.in b/lldb/test/Shell/Settings/Inputs/EchoCommandsTest.in similarity index 100% rename from lldb/lit/Settings/Inputs/EchoCommandsTest.in rename to lldb/test/Shell/Settings/Inputs/EchoCommandsTest.in diff --git a/lldb/lit/Settings/Inputs/StopCommandSource.in b/lldb/test/Shell/Settings/Inputs/StopCommandSource.in similarity index 100% rename from lldb/lit/Settings/Inputs/StopCommandSource.in rename to lldb/test/Shell/Settings/Inputs/StopCommandSource.in diff --git a/lldb/lit/Settings/Inputs/main.c b/lldb/test/Shell/Settings/Inputs/main.c similarity index 100% rename from lldb/lit/Settings/Inputs/main.c rename to lldb/test/Shell/Settings/Inputs/main.c diff --git a/lldb/lit/Settings/TestDisableColor.test b/lldb/test/Shell/Settings/TestDisableColor.test similarity index 100% rename from lldb/lit/Settings/TestDisableColor.test rename to lldb/test/Shell/Settings/TestDisableColor.test diff --git a/lldb/lit/Settings/TestDisassemblyFormat.test b/lldb/test/Shell/Settings/TestDisassemblyFormat.test similarity index 100% rename from lldb/lit/Settings/TestDisassemblyFormat.test rename to lldb/test/Shell/Settings/TestDisassemblyFormat.test diff --git a/lldb/lit/Settings/TestEchoCommands.test b/lldb/test/Shell/Settings/TestEchoCommands.test similarity index 100% rename from lldb/lit/Settings/TestEchoCommands.test rename to lldb/test/Shell/Settings/TestEchoCommands.test diff --git a/lldb/lit/Settings/TestFrameFormatColor.test b/lldb/test/Shell/Settings/TestFrameFormatColor.test similarity index 100% rename from lldb/lit/Settings/TestFrameFormatColor.test rename to lldb/test/Shell/Settings/TestFrameFormatColor.test diff --git a/lldb/lit/Settings/TestFrameFormatNoColor.test b/lldb/test/Shell/Settings/TestFrameFormatNoColor.test similarity index 100% rename from lldb/lit/Settings/TestFrameFormatNoColor.test rename to lldb/test/Shell/Settings/TestFrameFormatNoColor.test diff --git a/lldb/lit/Settings/TestModuleCacheSanity.test b/lldb/test/Shell/Settings/TestModuleCacheSanity.test similarity index 100% rename from lldb/lit/Settings/TestModuleCacheSanity.test rename to lldb/test/Shell/Settings/TestModuleCacheSanity.test diff --git a/lldb/lit/Settings/TestSettingsSet.test b/lldb/test/Shell/Settings/TestSettingsSet.test similarity index 100% rename from lldb/lit/Settings/TestSettingsSet.test rename to lldb/test/Shell/Settings/TestSettingsSet.test diff --git a/lldb/lit/Settings/TestSettingsWrite.test b/lldb/test/Shell/Settings/TestSettingsWrite.test similarity index 100% rename from lldb/lit/Settings/TestSettingsWrite.test rename to lldb/test/Shell/Settings/TestSettingsWrite.test diff --git a/lldb/lit/Settings/TestStopCommandSourceOnError.test b/lldb/test/Shell/Settings/TestStopCommandSourceOnError.test similarity index 100% rename from lldb/lit/Settings/TestStopCommandSourceOnError.test rename to lldb/test/Shell/Settings/TestStopCommandSourceOnError.test diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/basic-elf.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-elf.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/basic-elf.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-elf.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/basic-macho.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-macho.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/basic-macho.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/basic-macho.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-discontinuous-file-ids.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-edgecases.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-missing-file.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table-mixed-path-styles.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/line-table.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/line-table.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/line-table.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab-macho.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/symtab-macho.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab-macho.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/symtab.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/symtab.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/symtab.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-raSearch.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.syms diff --git a/lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml b/lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml rename to lldb/test/Shell/SymbolFile/Breakpad/Inputs/unwind-via-stack-win.yaml diff --git a/lldb/lit/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table-discontinuous-file-ids.test diff --git a/lldb/lit/SymbolFile/Breakpad/line-table-edgecases.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table-edgecases.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table-edgecases.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table-edgecases.test diff --git a/lldb/lit/SymbolFile/Breakpad/line-table-missing-file.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table-missing-file.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table-missing-file.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table-missing-file.test diff --git a/lldb/lit/SymbolFile/Breakpad/line-table-mixed-path-styles.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table-mixed-path-styles.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table-mixed-path-styles.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table-mixed-path-styles.test diff --git a/lldb/lit/SymbolFile/Breakpad/line-table.test b/lldb/test/Shell/SymbolFile/Breakpad/line-table.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/line-table.test rename to lldb/test/Shell/SymbolFile/Breakpad/line-table.test diff --git a/lldb/lit/SymbolFile/Breakpad/stack-cfi-parsing.test b/lldb/test/Shell/SymbolFile/Breakpad/stack-cfi-parsing.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/stack-cfi-parsing.test rename to lldb/test/Shell/SymbolFile/Breakpad/stack-cfi-parsing.test diff --git a/lldb/lit/SymbolFile/Breakpad/symtab-macho.test b/lldb/test/Shell/SymbolFile/Breakpad/symtab-macho.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/symtab-macho.test rename to lldb/test/Shell/SymbolFile/Breakpad/symtab-macho.test diff --git a/lldb/lit/SymbolFile/Breakpad/symtab.test b/lldb/test/Shell/SymbolFile/Breakpad/symtab.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/symtab.test rename to lldb/test/Shell/SymbolFile/Breakpad/symtab.test diff --git a/lldb/lit/SymbolFile/Breakpad/unwind-via-raSearch.test b/lldb/test/Shell/SymbolFile/Breakpad/unwind-via-raSearch.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/unwind-via-raSearch.test rename to lldb/test/Shell/SymbolFile/Breakpad/unwind-via-raSearch.test diff --git a/lldb/lit/SymbolFile/Breakpad/unwind-via-stack-cfi.test b/lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-cfi.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/unwind-via-stack-cfi.test rename to lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-cfi.test diff --git a/lldb/lit/SymbolFile/Breakpad/unwind-via-stack-win.test b/lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win.test similarity index 100% rename from lldb/lit/SymbolFile/Breakpad/unwind-via-stack-win.test rename to lldb/test/Shell/SymbolFile/Breakpad/unwind-via-stack-win.test diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script b/lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-line-basic.script similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/debug-line-basic.script rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-line-basic.script diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/debug-types-basic.cpp b/lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-basic.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/debug-types-basic.cpp rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-basic.cpp diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp b/lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/debug-types-expressions.cpp diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit b/lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-no-comp-dir-relative-name.lldbinit diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit b/lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-posix.lldbinit diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit b/lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/dir-separator-windows.lldbinit diff --git a/lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp b/lldb/test/Shell/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp rename to lldb/test/Shell/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp diff --git a/lldb/lit/SymbolFile/DWARF/apple-index-is-used.cpp b/lldb/test/Shell/SymbolFile/DWARF/apple-index-is-used.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/apple-index-is-used.cpp rename to lldb/test/Shell/SymbolFile/DWARF/apple-index-is-used.cpp diff --git a/lldb/lit/SymbolFile/DWARF/array-sizes.s b/lldb/test/Shell/SymbolFile/DWARF/array-sizes.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/array-sizes.s rename to lldb/test/Shell/SymbolFile/DWARF/array-sizes.s diff --git a/lldb/lit/SymbolFile/DWARF/childless-compile-unit.s b/lldb/test/Shell/SymbolFile/DWARF/childless-compile-unit.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/childless-compile-unit.s rename to lldb/test/Shell/SymbolFile/DWARF/childless-compile-unit.s diff --git a/lldb/lit/SymbolFile/DWARF/compilercontext.ll b/lldb/test/Shell/SymbolFile/DWARF/compilercontext.ll similarity index 100% rename from lldb/lit/SymbolFile/DWARF/compilercontext.ll rename to lldb/test/Shell/SymbolFile/DWARF/compilercontext.ll diff --git a/lldb/lit/SymbolFile/DWARF/debug-line-basic.s b/lldb/test/Shell/SymbolFile/DWARF/debug-line-basic.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-line-basic.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-line-basic.s diff --git a/lldb/lit/SymbolFile/DWARF/debug-names-compressed.cpp b/lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-names-compressed.cpp rename to lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-address-ranges.s b/lldb/test/Shell/SymbolFile/DWARF/debug-types-address-ranges.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-address-ranges.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-address-ranges.s diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-basic.test b/lldb/test/Shell/SymbolFile/DWARF/debug-types-basic.test similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-basic.test rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-basic.test diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-dwarf5.s b/lldb/test/Shell/SymbolFile/DWARF/debug-types-dwarf5.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-dwarf5.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-dwarf5.s diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp b/lldb/test/Shell/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-dwo-cross-reference.cpp diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-expressions.test b/lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-expressions.test rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-expressions.test diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-line-tables.s b/lldb/test/Shell/SymbolFile/DWARF/debug-types-line-tables.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-line-tables.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-line-tables.s diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-missing-signature.test b/lldb/test/Shell/SymbolFile/DWARF/debug-types-missing-signature.test similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-missing-signature.test rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-missing-signature.test diff --git a/lldb/lit/SymbolFile/DWARF/debug-types-signature-loop.s b/lldb/test/Shell/SymbolFile/DWARF/debug-types-signature-loop.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug-types-signature-loop.s rename to lldb/test/Shell/SymbolFile/DWARF/debug-types-signature-loop.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_aranges-empty-section.s b/lldb/test/Shell/SymbolFile/DWARF/debug_aranges-empty-section.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_aranges-empty-section.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_aranges-empty-section.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_loc.s b/lldb/test/Shell/SymbolFile/DWARF/debug_loc.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_loc.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_loc.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_ranges-missing-section.s b/lldb/test/Shell/SymbolFile/DWARF/debug_ranges-missing-section.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_ranges-missing-section.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_ranges-missing-section.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_ranges.s b/lldb/test/Shell/SymbolFile/DWARF/debug_ranges.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_ranges.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_ranges.s diff --git a/lldb/lit/SymbolFile/DWARF/debug_ranges_and_rnglists.test b/lldb/test/Shell/SymbolFile/DWARF/debug_ranges_and_rnglists.test similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_ranges_and_rnglists.test rename to lldb/test/Shell/SymbolFile/DWARF/debug_ranges_and_rnglists.test diff --git a/lldb/lit/SymbolFile/DWARF/debug_rnglists.s b/lldb/test/Shell/SymbolFile/DWARF/debug_rnglists.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/debug_rnglists.s rename to lldb/test/Shell/SymbolFile/DWARF/debug_rnglists.s diff --git a/lldb/lit/SymbolFile/DWARF/deterministic-build.cpp b/lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/deterministic-build.cpp rename to lldb/test/Shell/SymbolFile/DWARF/deterministic-build.cpp diff --git a/lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s b/lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s rename to lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir-relative-name.s diff --git a/lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s b/lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dir-separator-no-comp-dir.s rename to lldb/test/Shell/SymbolFile/DWARF/dir-separator-no-comp-dir.s diff --git a/lldb/lit/SymbolFile/DWARF/dir-separator-posix.s b/lldb/test/Shell/SymbolFile/DWARF/dir-separator-posix.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dir-separator-posix.s rename to lldb/test/Shell/SymbolFile/DWARF/dir-separator-posix.s diff --git a/lldb/lit/SymbolFile/DWARF/dir-separator-windows.s b/lldb/test/Shell/SymbolFile/DWARF/dir-separator-windows.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dir-separator-windows.s rename to lldb/test/Shell/SymbolFile/DWARF/dir-separator-windows.s diff --git a/lldb/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp b/lldb/test/Shell/SymbolFile/DWARF/dwarf5-index-is-used.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp rename to lldb/test/Shell/SymbolFile/DWARF/dwarf5-index-is-used.cpp diff --git a/lldb/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp b/lldb/test/Shell/SymbolFile/DWARF/dwarf5-partial-index.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp rename to lldb/test/Shell/SymbolFile/DWARF/dwarf5-partial-index.cpp diff --git a/lldb/lit/SymbolFile/DWARF/dwarf5_locations.s b/lldb/test/Shell/SymbolFile/DWARF/dwarf5_locations.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/dwarf5_locations.s rename to lldb/test/Shell/SymbolFile/DWARF/dwarf5_locations.s diff --git a/lldb/lit/SymbolFile/DWARF/find-basic-function.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-basic-function.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-basic-function.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-basic-namespace.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-basic-namespace.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-basic-namespace.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-basic-namespace.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-basic-type.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-basic-type.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-basic-type.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-basic-type.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-basic-variable.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-basic-variable.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-basic-variable.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-basic-variable.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-function-regex.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-function-regex.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-function-regex.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-function-regex.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-inline-method.s b/lldb/test/Shell/SymbolFile/DWARF/find-inline-method.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-inline-method.s rename to lldb/test/Shell/SymbolFile/DWARF/find-inline-method.s diff --git a/lldb/lit/SymbolFile/DWARF/find-method-local-struct.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-method-local-struct.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-method-local-struct.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-method-local-struct.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-method.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-method.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-method.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-method.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-qualified-variable.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-qualified-variable.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-qualified-variable.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-qualified-variable.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-type-in-function.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-type-in-function.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-type-in-function.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-type-in-function.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-variable-dwo.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-variable-dwo.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-variable-dwo.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-variable-dwo.cpp diff --git a/lldb/lit/SymbolFile/DWARF/find-variable-file.cpp b/lldb/test/Shell/SymbolFile/DWARF/find-variable-file.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/find-variable-file.cpp rename to lldb/test/Shell/SymbolFile/DWARF/find-variable-file.cpp diff --git a/lldb/lit/SymbolFile/DWARF/forward-declarations.s b/lldb/test/Shell/SymbolFile/DWARF/forward-declarations.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/forward-declarations.s rename to lldb/test/Shell/SymbolFile/DWARF/forward-declarations.s diff --git a/lldb/lit/SymbolFile/DWARF/gnu-style-compression.cpp b/lldb/test/Shell/SymbolFile/DWARF/gnu-style-compression.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/gnu-style-compression.cpp rename to lldb/test/Shell/SymbolFile/DWARF/gnu-style-compression.cpp diff --git a/lldb/lit/SymbolFile/DWARF/lit.local.cfg b/lldb/test/Shell/SymbolFile/DWARF/lit.local.cfg similarity index 100% rename from lldb/lit/SymbolFile/DWARF/lit.local.cfg rename to lldb/test/Shell/SymbolFile/DWARF/lit.local.cfg diff --git a/lldb/lit/SymbolFile/DWARF/parallel-indexing-stress.s b/lldb/test/Shell/SymbolFile/DWARF/parallel-indexing-stress.s similarity index 100% rename from lldb/lit/SymbolFile/DWARF/parallel-indexing-stress.s rename to lldb/test/Shell/SymbolFile/DWARF/parallel-indexing-stress.s diff --git a/lldb/lit/SymbolFile/DWARF/split-dwarf-inlining.cpp b/lldb/test/Shell/SymbolFile/DWARF/split-dwarf-inlining.cpp similarity index 100% rename from lldb/lit/SymbolFile/DWARF/split-dwarf-inlining.cpp rename to lldb/test/Shell/SymbolFile/DWARF/split-dwarf-inlining.cpp diff --git a/lldb/lit/SymbolFile/DWARF/split-dwarf-multiple-cu.ll b/lldb/test/Shell/SymbolFile/DWARF/split-dwarf-multiple-cu.ll similarity index 100% rename from lldb/lit/SymbolFile/DWARF/split-dwarf-multiple-cu.ll rename to lldb/test/Shell/SymbolFile/DWARF/split-dwarf-multiple-cu.ll diff --git a/lldb/lit/SymbolFile/Inputs/sizeless-symbol.s b/lldb/test/Shell/SymbolFile/Inputs/sizeless-symbol.s similarity index 100% rename from lldb/lit/SymbolFile/Inputs/sizeless-symbol.s rename to lldb/test/Shell/SymbolFile/Inputs/sizeless-symbol.s diff --git a/lldb/lit/SymbolFile/Inputs/target-symbols-add-unwind.c b/lldb/test/Shell/SymbolFile/Inputs/target-symbols-add-unwind.c similarity index 100% rename from lldb/lit/SymbolFile/Inputs/target-symbols-add-unwind.c rename to lldb/test/Shell/SymbolFile/Inputs/target-symbols-add-unwind.c diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-functions.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/ast-types.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-types.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/ast-types.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/ast-types.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/bitfields.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/bitfields.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/bitfields.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/bitfields.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-function.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/break-by-line.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/disassembly.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/disassembly.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/disassembly.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/disassembly.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-builtins.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-calling-conv.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/function-types-classes.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-bss.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-classes.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/globals-fundamental.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/local-variables.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/local-variables.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/local-variables.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/nested-types.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/nested-types.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/nested-types.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.s b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.s similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/s_constant.s rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/s_constant.s diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/source-list.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/source-list.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/source-list.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/source-list.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/tag-types.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/tag-types.lldbinit similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/Inputs/tag-types.lldbinit rename to lldb/test/Shell/SymbolFile/NativePDB/Inputs/tag-types.lldbinit diff --git a/lldb/lit/SymbolFile/NativePDB/ast-functions-msvc.cpp b/lldb/test/Shell/SymbolFile/NativePDB/ast-functions-msvc.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/ast-functions-msvc.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/ast-functions-msvc.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/ast-functions.cpp b/lldb/test/Shell/SymbolFile/NativePDB/ast-functions.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/ast-functions.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/ast-functions.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/ast-methods.cpp b/lldb/test/Shell/SymbolFile/NativePDB/ast-methods.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/ast-methods.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/ast-methods.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/ast-types.cpp b/lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/ast-types.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/ast-types.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/bitfields.cpp b/lldb/test/Shell/SymbolFile/NativePDB/bitfields.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/bitfields.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/bitfields.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/break-by-function.cpp b/lldb/test/Shell/SymbolFile/NativePDB/break-by-function.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/break-by-function.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/break-by-function.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/break-by-line.cpp b/lldb/test/Shell/SymbolFile/NativePDB/break-by-line.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/break-by-line.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/break-by-line.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/disassembly.cpp b/lldb/test/Shell/SymbolFile/NativePDB/disassembly.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/disassembly.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/disassembly.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/function-types-builtins.cpp b/lldb/test/Shell/SymbolFile/NativePDB/function-types-builtins.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/function-types-builtins.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/function-types-builtins.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/function-types-calling-conv.cpp b/lldb/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/function-types-calling-conv.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/function-types-calling-conv.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/function-types-classes.cpp b/lldb/test/Shell/SymbolFile/NativePDB/function-types-classes.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/function-types-classes.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/function-types-classes.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/global-classes.cpp b/lldb/test/Shell/SymbolFile/NativePDB/global-classes.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/global-classes.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/global-classes.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/globals-bss.cpp b/lldb/test/Shell/SymbolFile/NativePDB/globals-bss.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/globals-bss.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/globals-bss.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/globals-fundamental.cpp b/lldb/test/Shell/SymbolFile/NativePDB/globals-fundamental.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/globals-fundamental.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/globals-fundamental.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/local-variables.cpp b/lldb/test/Shell/SymbolFile/NativePDB/local-variables.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/local-variables.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/local-variables.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/nested-types.cpp b/lldb/test/Shell/SymbolFile/NativePDB/nested-types.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/nested-types.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/nested-types.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/s_constant.cpp b/lldb/test/Shell/SymbolFile/NativePDB/s_constant.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/s_constant.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/s_constant.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/source-list.cpp b/lldb/test/Shell/SymbolFile/NativePDB/source-list.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/source-list.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/source-list.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/stack_unwinding01.cpp b/lldb/test/Shell/SymbolFile/NativePDB/stack_unwinding01.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/stack_unwinding01.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/stack_unwinding01.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/tag-types.cpp b/lldb/test/Shell/SymbolFile/NativePDB/tag-types.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/tag-types.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/tag-types.cpp diff --git a/lldb/lit/SymbolFile/NativePDB/typedefs.cpp b/lldb/test/Shell/SymbolFile/NativePDB/typedefs.cpp similarity index 100% rename from lldb/lit/SymbolFile/NativePDB/typedefs.cpp rename to lldb/test/Shell/SymbolFile/NativePDB/typedefs.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/AstRestoreTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/AstRestoreTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/CallingConventionsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ClassLayoutTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/CompilandsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/CompilandsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest0.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest0.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest0.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest0.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest1.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest1.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest1.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest1.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest2.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest2.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/ExpressionsTest2.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/ExpressionsTest2.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbols.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbols.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h b/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord b/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord diff --git a/lldb/lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/PointerTypeTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/PointerTypeTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/PointerTypeTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/PointerTypeTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/TypeQualsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/TypeQualsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/UdtLayoutTest.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/UdtLayoutTest.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VBases.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VBases.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VBases.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VBases.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VBases.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script b/lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.script similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesLocationsTest.script diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp b/lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesTest.cpp similarity index 100% rename from lldb/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp rename to lldb/test/Shell/SymbolFile/PDB/Inputs/VariablesTest.cpp diff --git a/lldb/lit/SymbolFile/PDB/ast-restore.test b/lldb/test/Shell/SymbolFile/PDB/ast-restore.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/ast-restore.test rename to lldb/test/Shell/SymbolFile/PDB/ast-restore.test diff --git a/lldb/lit/SymbolFile/PDB/calling-conventions.test b/lldb/test/Shell/SymbolFile/PDB/calling-conventions.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/calling-conventions.test rename to lldb/test/Shell/SymbolFile/PDB/calling-conventions.test diff --git a/lldb/lit/SymbolFile/PDB/class-layout.test b/lldb/test/Shell/SymbolFile/PDB/class-layout.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/class-layout.test rename to lldb/test/Shell/SymbolFile/PDB/class-layout.test diff --git a/lldb/lit/SymbolFile/PDB/compilands.test b/lldb/test/Shell/SymbolFile/PDB/compilands.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/compilands.test rename to lldb/test/Shell/SymbolFile/PDB/compilands.test diff --git a/lldb/lit/SymbolFile/PDB/enums-layout.test b/lldb/test/Shell/SymbolFile/PDB/enums-layout.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/enums-layout.test rename to lldb/test/Shell/SymbolFile/PDB/enums-layout.test diff --git a/lldb/lit/SymbolFile/PDB/expressions.test b/lldb/test/Shell/SymbolFile/PDB/expressions.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/expressions.test rename to lldb/test/Shell/SymbolFile/PDB/expressions.test diff --git a/lldb/lit/SymbolFile/PDB/func-symbols.test b/lldb/test/Shell/SymbolFile/PDB/func-symbols.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/func-symbols.test rename to lldb/test/Shell/SymbolFile/PDB/func-symbols.test diff --git a/lldb/lit/SymbolFile/PDB/function-level-linking.test b/lldb/test/Shell/SymbolFile/PDB/function-level-linking.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/function-level-linking.test rename to lldb/test/Shell/SymbolFile/PDB/function-level-linking.test diff --git a/lldb/lit/SymbolFile/PDB/function-nested-block.test b/lldb/test/Shell/SymbolFile/PDB/function-nested-block.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/function-nested-block.test rename to lldb/test/Shell/SymbolFile/PDB/function-nested-block.test diff --git a/lldb/lit/SymbolFile/PDB/pointers.test b/lldb/test/Shell/SymbolFile/PDB/pointers.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/pointers.test rename to lldb/test/Shell/SymbolFile/PDB/pointers.test diff --git a/lldb/lit/SymbolFile/PDB/type-quals.test b/lldb/test/Shell/SymbolFile/PDB/type-quals.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/type-quals.test rename to lldb/test/Shell/SymbolFile/PDB/type-quals.test diff --git a/lldb/lit/SymbolFile/PDB/typedefs.test b/lldb/test/Shell/SymbolFile/PDB/typedefs.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/typedefs.test rename to lldb/test/Shell/SymbolFile/PDB/typedefs.test diff --git a/lldb/lit/SymbolFile/PDB/udt-layout.test b/lldb/test/Shell/SymbolFile/PDB/udt-layout.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/udt-layout.test rename to lldb/test/Shell/SymbolFile/PDB/udt-layout.test diff --git a/lldb/lit/SymbolFile/PDB/variables-locations.test b/lldb/test/Shell/SymbolFile/PDB/variables-locations.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/variables-locations.test rename to lldb/test/Shell/SymbolFile/PDB/variables-locations.test diff --git a/lldb/lit/SymbolFile/PDB/variables.test b/lldb/test/Shell/SymbolFile/PDB/variables.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/variables.test rename to lldb/test/Shell/SymbolFile/PDB/variables.test diff --git a/lldb/lit/SymbolFile/PDB/vbases.test b/lldb/test/Shell/SymbolFile/PDB/vbases.test similarity index 100% rename from lldb/lit/SymbolFile/PDB/vbases.test rename to lldb/test/Shell/SymbolFile/PDB/vbases.test diff --git a/lldb/lit/SymbolFile/dissassemble-entry-point.s b/lldb/test/Shell/SymbolFile/dissassemble-entry-point.s similarity index 100% rename from lldb/lit/SymbolFile/dissassemble-entry-point.s rename to lldb/test/Shell/SymbolFile/dissassemble-entry-point.s diff --git a/lldb/lit/SymbolFile/sizeless-symbol.test b/lldb/test/Shell/SymbolFile/sizeless-symbol.test similarity index 100% rename from lldb/lit/SymbolFile/sizeless-symbol.test rename to lldb/test/Shell/SymbolFile/sizeless-symbol.test diff --git a/lldb/lit/SymbolFile/target-symbols-add-unwind.test b/lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test similarity index 100% rename from lldb/lit/SymbolFile/target-symbols-add-unwind.test rename to lldb/test/Shell/SymbolFile/target-symbols-add-unwind.test diff --git a/lldb/lit/Unwind/Inputs/call-asm.c b/lldb/test/Shell/Unwind/Inputs/call-asm.c similarity index 100% rename from lldb/lit/Unwind/Inputs/call-asm.c rename to lldb/test/Shell/Unwind/Inputs/call-asm.c diff --git a/lldb/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s b/lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s similarity index 100% rename from lldb/lit/Unwind/Inputs/eh-frame-dwarf-unwind.s rename to lldb/test/Shell/Unwind/Inputs/eh-frame-dwarf-unwind.s diff --git a/lldb/lit/Unwind/Inputs/eh-frame-small-fde.s b/lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s similarity index 100% rename from lldb/lit/Unwind/Inputs/eh-frame-small-fde.s rename to lldb/test/Shell/Unwind/Inputs/eh-frame-small-fde.s diff --git a/lldb/lit/Unwind/Inputs/prefer-debug-over-eh-frame.s b/lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s similarity index 100% rename from lldb/lit/Unwind/Inputs/prefer-debug-over-eh-frame.s rename to lldb/test/Shell/Unwind/Inputs/prefer-debug-over-eh-frame.s diff --git a/lldb/lit/Unwind/Inputs/trap_frame_sym_ctx.s b/lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s similarity index 100% rename from lldb/lit/Unwind/Inputs/trap_frame_sym_ctx.s rename to lldb/test/Shell/Unwind/Inputs/trap_frame_sym_ctx.s diff --git a/lldb/lit/Unwind/Inputs/unwind-plan-dwarf-dump.s b/lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s similarity index 100% rename from lldb/lit/Unwind/Inputs/unwind-plan-dwarf-dump.s rename to lldb/test/Shell/Unwind/Inputs/unwind-plan-dwarf-dump.s diff --git a/lldb/lit/Unwind/eh-frame-dwarf-unwind.test b/lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test similarity index 100% rename from lldb/lit/Unwind/eh-frame-dwarf-unwind.test rename to lldb/test/Shell/Unwind/eh-frame-dwarf-unwind.test diff --git a/lldb/lit/Unwind/eh-frame-small-fde.test b/lldb/test/Shell/Unwind/eh-frame-small-fde.test similarity index 100% rename from lldb/lit/Unwind/eh-frame-small-fde.test rename to lldb/test/Shell/Unwind/eh-frame-small-fde.test diff --git a/lldb/lit/Unwind/prefer-debug-over-eh-frame.test b/lldb/test/Shell/Unwind/prefer-debug-over-eh-frame.test similarity index 100% rename from lldb/lit/Unwind/prefer-debug-over-eh-frame.test rename to lldb/test/Shell/Unwind/prefer-debug-over-eh-frame.test diff --git a/lldb/lit/Unwind/trap_frame_sym_ctx.test b/lldb/test/Shell/Unwind/trap_frame_sym_ctx.test similarity index 100% rename from lldb/lit/Unwind/trap_frame_sym_ctx.test rename to lldb/test/Shell/Unwind/trap_frame_sym_ctx.test diff --git a/lldb/lit/Unwind/unwind-plan-dwarf-dump.test b/lldb/test/Shell/Unwind/unwind-plan-dwarf-dump.test similarity index 100% rename from lldb/lit/Unwind/unwind-plan-dwarf-dump.test rename to lldb/test/Shell/Unwind/unwind-plan-dwarf-dump.test diff --git a/lldb/lit/Watchpoint/Inputs/main.cpp b/lldb/test/Shell/Watchpoint/Inputs/main.cpp similarity index 100% rename from lldb/lit/Watchpoint/Inputs/main.cpp rename to lldb/test/Shell/Watchpoint/Inputs/main.cpp diff --git a/lldb/lit/Watchpoint/SetErrorCases.test b/lldb/test/Shell/Watchpoint/SetErrorCases.test similarity index 100% rename from lldb/lit/Watchpoint/SetErrorCases.test rename to lldb/test/Shell/Watchpoint/SetErrorCases.test diff --git a/lldb/lit/helper/__init__.py b/lldb/test/Shell/helper/__init__.py similarity index 100% rename from lldb/lit/helper/__init__.py rename to lldb/test/Shell/helper/__init__.py diff --git a/lldb/lit/helper/build.py b/lldb/test/Shell/helper/build.py similarity index 100% rename from lldb/lit/helper/build.py rename to lldb/test/Shell/helper/build.py diff --git a/lldb/lit/helper/toolchain.py b/lldb/test/Shell/helper/toolchain.py similarity index 98% rename from lldb/lit/helper/toolchain.py rename to lldb/test/Shell/helper/toolchain.py index 0290e12c8f550..d9e5c0593ec1c 100644 --- a/lldb/lit/helper/toolchain.py +++ b/lldb/test/Shell/helper/toolchain.py @@ -29,7 +29,7 @@ def use_lldb_substitutions(config): if config.llvm_libs_dir: build_script_args.append('--libs-dir={0}'.format(config.llvm_libs_dir)) - lldb_init = os.path.join(config.test_exec_root, 'lit-lldb-init') + lldb_init = os.path.join(config.test_exec_root, 'Shell', 'lit-lldb-init') primary_tools = [ ToolSubst('%lldb', diff --git a/lldb/lit/lit-lldb-init.in b/lldb/test/Shell/lit-lldb-init.in similarity index 100% rename from lldb/lit/lit-lldb-init.in rename to lldb/test/Shell/lit-lldb-init.in diff --git a/lldb/lit/lit.cfg.py b/lldb/test/Shell/lit.cfg.py similarity index 97% rename from lldb/lit/lit.cfg.py rename to lldb/test/Shell/lit.cfg.py index 208338ce95c18..3503e95692295 100644 --- a/lldb/lit/lit.cfg.py +++ b/lldb/test/Shell/lit.cfg.py @@ -17,7 +17,7 @@ from helper import toolchain # name: The name of this test suite. -config.name = 'LLDB' +config.name = 'lldb-shell' # testFormat: The test format to use to interpret tests. config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) @@ -35,7 +35,7 @@ config.test_source_root = os.path.dirname(__file__) # test_exec_root: The root path where tests should be run. -config.test_exec_root = os.path.join(config.lldb_obj_root, 'lit') +config.test_exec_root = os.path.join(config.lldb_obj_root, 'test') llvm_config.use_default_substitutions() diff --git a/lldb/lit/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in similarity index 96% rename from lldb/lit/lit.site.cfg.py.in rename to lldb/test/Shell/lit.site.cfg.py.in index c9b6e09cc0e75..459d560454121 100644 --- a/lldb/lit/lit.site.cfg.py.in +++ b/lldb/test/Shell/lit.site.cfg.py.in @@ -41,4 +41,4 @@ import lit.llvm lit.llvm.initialize(lit_config, config) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/lit.cfg.py") +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Shell/lit.cfg.py") diff --git a/lldb/test/Unit/README.md b/lldb/test/Unit/README.md new file mode 100644 index 0000000000000..0302747acd9fa --- /dev/null +++ b/lldb/test/Unit/README.md @@ -0,0 +1,4 @@ +# LLDB Unit Tests + +This directory only exists for the lit test driver. The actual tests live in +the `unittest` directory in top level LLDB directory. diff --git a/lldb/lit/Unit/lit.cfg.py b/lldb/test/Unit/lit.cfg.py similarity index 97% rename from lldb/lit/Unit/lit.cfg.py rename to lldb/test/Unit/lit.cfg.py index 3633c73a1d404..e53bcd394ca1e 100644 --- a/lldb/lit/Unit/lit.cfg.py +++ b/lldb/test/Unit/lit.cfg.py @@ -9,7 +9,7 @@ from lit.llvm import llvm_config # name: The name of this test suite. -config.name = 'lldb-Unit' +config.name = 'lldb-unit' # suffixes: A list of file extensions to treat as test files. config.suffixes = [] diff --git a/lldb/test/Unit/lit.site.cfg.py.in b/lldb/test/Unit/lit.site.cfg.py.in new file mode 100644 index 0000000000000..9d9bcd4ba628d --- /dev/null +++ b/lldb/test/Unit/lit.site.cfg.py.in @@ -0,0 +1,29 @@ +@LIT_SITE_CFG_IN_HEADER@ + +config.test_exec_root = "@LLDB_BINARY_DIR@" +config.llvm_src_root = "@LLVM_SOURCE_DIR@" +config.llvm_obj_root = "@LLVM_BINARY_DIR@" +config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.llvm_libs_dir = "@LLVM_LIBS_DIR@" +config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" +config.lldb_obj_root = "@LLDB_BINARY_DIR@" +config.lldb_src_root = "@LLDB_SOURCE_DIR@" +config.target_triple = "@TARGET_TRIPLE@" +config.python_executable = "@PYTHON_EXECUTABLE@" + +# Support substitution of the tools and libs dirs with user parameters. This is +# used when we can't determine the tool dir at configuration time. +try: + config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params + config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params + config.llvm_build_mode = config.llvm_build_mode % lit_config.params +except KeyError as e: + key, = e.args + lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) + +import lit.llvm +lit.llvm.initialize(lit_config, config) + +# Let the main config do the real work. +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Unit/lit.cfg.py") diff --git a/lldb/test/lit.cfg.py b/lldb/test/lit.cfg.py new file mode 100644 index 0000000000000..797750bac2126 --- /dev/null +++ b/lldb/test/lit.cfg.py @@ -0,0 +1,41 @@ +# -*- Python -*- + +import os +import platform +import re +import shutil +import site +import sys + +import lit.formats +from lit.llvm import llvm_config +from lit.llvm.subst import FindTool +from lit.llvm.subst import ToolSubst +from distutils.spawn import find_executable + +# This is the top level configuration. Most of these configuration options will +# be overriden by individual lit configuration files in the test +# subdirectories. + +# name: The name of this test suite. +config.name = 'lldb' + +# testFormat: The test format to use to interpret tests. +config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell) + +# suffixes: A list of file extensions to treat as test files. This is overriden +# by individual lit.local.cfg files in the test subdirectories. +config.suffixes = ['.test', '.cpp', '.s'] + +# excludes: A list of directories to exclude from the testsuite. The 'Inputs' +# subdirectories contain auxiliary inputs for various tests in their parent +# directories. +config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt'] + +# test_source_root: The root path where tests are located. +config.test_source_root = os.path.dirname(__file__) + +# test_exec_root: The root path where tests should be run. +config.test_exec_root = os.path.join(config.lldb_obj_root, 'test') + +llvm_config.use_default_substitutions() diff --git a/lldb/lit/Unit/lit.site.cfg.py.in b/lldb/test/lit.site.cfg.py.in similarity index 93% rename from lldb/lit/Unit/lit.site.cfg.py.in rename to lldb/test/lit.site.cfg.py.in index 0c629fdfaa565..49d789d42d9a1 100644 --- a/lldb/lit/Unit/lit.site.cfg.py.in +++ b/lldb/test/lit.site.cfg.py.in @@ -26,4 +26,4 @@ import lit.llvm lit.llvm.initialize(lit_config, config) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Unit/lit.cfg.py") +lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/lit.cfg.py") From 02c2ab3d8872416589bd1a6ca3dfb96ba373a3b9 Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Wed, 9 Oct 2019 19:29:13 +0000 Subject: [PATCH 32/44] [ObjC generics] Fix not inheriting type bounds in categories/extensions. When a category/extension doesn't repeat a type bound, corresponding type parameter is substituted with `id` when used as a type argument. As a result, in the added test case it was causing errors like > type argument 'T' (aka 'id') does not satisfy the bound ('id') of type parameter 'T' We are already checking that type parameters should be consistent everywhere (see `checkTypeParamListConsistency`) and update `ObjCTypeParamDecl` to have correct underlying type. And when we use the type parameter as a method return type or a method parameter type, it is substituted to the bounded type. But when we use the type parameter as a type argument, we check `ObjCTypeParamType` that ignores the updated underlying type and remains `id`. Fix by desugaring `ObjCTypeParamType` to the underlying type, the same way we are doing with `TypedefType`. rdar://problem/54329242 Reviewers: erik.pilkington, ahatanak Reviewed By: erik.pilkington Subscribers: jkorous, dexonsmith, ributzka, cfe-commits Differential Revision: https://reviews.llvm.org/D66696 llvm-svn: 374202 --- clang/include/clang/AST/Type.h | 2 +- clang/lib/AST/Type.cpp | 4 ++++ clang/test/SemaObjC/parameterized_classes_subst.m | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index ecbbd73e19fb4..c9238e9521012 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -5569,7 +5569,7 @@ class ObjCTypeParamType : public Type, public: bool isSugared() const { return true; } - QualType desugar() const { return getCanonicalTypeInternal(); } + QualType desugar() const; static bool classof(const Type *T) { return T->getTypeClass() == ObjCTypeParam; diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 4fed5b410b172..4d54ea1061edc 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -663,6 +663,10 @@ ObjCTypeParamType::ObjCTypeParamType(const ObjCTypeParamDecl *D, initialize(protocols); } +QualType ObjCTypeParamType::desugar() const { + return getDecl()->getUnderlyingType(); +} + ObjCObjectType::ObjCObjectType(QualType Canonical, QualType Base, ArrayRef typeArgs, ArrayRef protocols, diff --git a/clang/test/SemaObjC/parameterized_classes_subst.m b/clang/test/SemaObjC/parameterized_classes_subst.m index d14a6e9deb406..b6d884760d294 100644 --- a/clang/test/SemaObjC/parameterized_classes_subst.m +++ b/clang/test/SemaObjC/parameterized_classes_subst.m @@ -467,3 +467,17 @@ - (void)mapUsingBlock:(id (^)(id))block { - (void)mapUsingBlock2:(id)block { // expected-warning{{conflicting parameter types in implementation}} } @end + +// -------------------------------------------------------------------------- +// Use a type parameter as a type argument. +// -------------------------------------------------------------------------- +// Type bounds in a category/extension are omitted. rdar://problem/54329242 +@interface ParameterizedContainer> +- (ParameterizedContainer *)inInterface; +@end +@interface ParameterizedContainer (Cat) +- (ParameterizedContainer *)inCategory; +@end +@interface ParameterizedContainer () +- (ParameterizedContainer *)inExtension; +@end From 2e6f6b4dadbf2af58646bbddec45bd3233fe3d19 Mon Sep 17 00:00:00 2001 From: David Greene Date: Wed, 9 Oct 2019 19:51:48 +0000 Subject: [PATCH 33/44] [System Model] [TTI] Update cache and prefetch TTI interfaces Re-apply 9fdfb045ae8b/r365676 with fixes for PPC and Hexagon. This involved moving defaults from TargetTransformInfoImplBase to MCSubtargetInfo. Rework the TTI cache and software prefetching APIs to prepare for the introduction of a general system model. Changes include: - Marking existing interfaces const and/or override as appropriate - Adding comments - Adding BasicTTIImpl interfaces that delegate to a subtarget implementation - Moving the default TargetTransformInfoImplBase implementation to a default MCSubtarget implementation Only a handful of targets use these interfaces currently: AArch64, Hexagon, PPC and SystemZ. AArch64 already has a custom subtarget implementation, so its custom TTI implementation is migrated to use the new facilities in BasicTTIImpl to invoke its custom subtarget implementation. The custom TTI implementations continue to exist for the other targets with this change. They are not moved over to subtarget-based implementations. The end goal is to have the default subtarget implementation defer to the system model defined by the target. With this change, the default MCSubtargetInfo implementation essentially returns the defaults TargetTransformInfoImplBase used to return. Existing users of TTI defaults will hit the defaults now in MCSubtargetInfo. Targets that define their own custom TTI implementations won't use the BasicTTIImpl implementations that route to the subtarget. Once system models are in place for the targets that use these interfaces, their custom TTI implementations can be removed. Differential Revision: https://reviews.llvm.org/D63614 llvm-svn: 374205 --- .../llvm/Analysis/TargetTransformInfo.h | 70 +++++++++++++------ .../llvm/Analysis/TargetTransformInfoImpl.h | 31 -------- llvm/include/llvm/CodeGen/BasicTTIImpl.h | 28 ++++++++ llvm/include/llvm/MC/MCSubtargetInfo.h | 44 ++++++++++++ llvm/lib/Analysis/TargetTransformInfo.cpp | 28 ++++++++ llvm/lib/MC/MCSubtargetInfo.cpp | 25 +++++++ llvm/lib/Target/AArch64/AArch64Subtarget.h | 8 +-- .../AArch64/AArch64TargetTransformInfo.cpp | 16 ----- .../AArch64/AArch64TargetTransformInfo.h | 8 --- .../Hexagon/HexagonTargetTransformInfo.h | 4 +- .../Target/PowerPC/PPCTargetTransformInfo.cpp | 4 +- .../Target/PowerPC/PPCTargetTransformInfo.h | 4 +- .../SystemZ/SystemZTargetTransformInfo.h | 6 +- 13 files changed, 188 insertions(+), 88 deletions(-) diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h index 6da2d7f43bc42..d1c1cf67688f8 100644 --- a/llvm/include/llvm/Analysis/TargetTransformInfo.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -837,18 +837,20 @@ class TargetTransformInfo { /// \return The associativity of the cache level, if available. llvm::Optional getCacheAssociativity(CacheLevel Level) const; - /// \return How much before a load we should place the prefetch instruction. - /// This is currently measured in number of instructions. + /// \return How much before a load we should place the prefetch + /// instruction. This is currently measured in number of + /// instructions. unsigned getPrefetchDistance() const; - /// \return Some HW prefetchers can handle accesses up to a certain constant - /// stride. This is the minimum stride in bytes where it makes sense to start - /// adding SW prefetches. The default is 1, i.e. prefetch with any stride. + /// \return Some HW prefetchers can handle accesses up to a certain + /// constant stride. This is the minimum stride in bytes where it + /// makes sense to start adding SW prefetches. The default is 1, + /// i.e. prefetch with any stride. unsigned getMinPrefetchStride() const; - /// \return The maximum number of iterations to prefetch ahead. If the - /// required number of iterations is more than this number, no prefetching is - /// performed. + /// \return The maximum number of iterations to prefetch ahead. If + /// the required number of iterations is more than this number, no + /// prefetching is performed. unsigned getMaxPrefetchIterationsAhead() const; /// \return The maximum interleave factor that any transform should try to @@ -1250,12 +1252,26 @@ class TargetTransformInfo::Concept { virtual unsigned getMinimumVF(unsigned ElemWidth) const = 0; virtual bool shouldConsiderAddressTypePromotion( const Instruction &I, bool &AllowPromotionWithoutCommonHeader) = 0; - virtual unsigned getCacheLineSize() = 0; - virtual llvm::Optional getCacheSize(CacheLevel Level) = 0; - virtual llvm::Optional getCacheAssociativity(CacheLevel Level) = 0; - virtual unsigned getPrefetchDistance() = 0; - virtual unsigned getMinPrefetchStride() = 0; - virtual unsigned getMaxPrefetchIterationsAhead() = 0; + virtual unsigned getCacheLineSize() const = 0; + virtual llvm::Optional getCacheSize(CacheLevel Level) const = 0; + virtual llvm::Optional getCacheAssociativity(CacheLevel Level) const = 0; + + /// \return How much before a load we should place the prefetch + /// instruction. This is currently measured in number of + /// instructions. + virtual unsigned getPrefetchDistance() const = 0; + + /// \return Some HW prefetchers can handle accesses up to a certain + /// constant stride. This is the minimum stride in bytes where it + /// makes sense to start adding SW prefetches. The default is 1, + /// i.e. prefetch with any stride. + virtual unsigned getMinPrefetchStride() const = 0; + + /// \return The maximum number of iterations to prefetch ahead. If + /// the required number of iterations is more than this number, no + /// prefetching is performed. + virtual unsigned getMaxPrefetchIterationsAhead() const = 0; + virtual unsigned getMaxInterleaveFactor(unsigned VF) = 0; virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind Opd1Info, @@ -1606,22 +1622,36 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept { return Impl.shouldConsiderAddressTypePromotion( I, AllowPromotionWithoutCommonHeader); } - unsigned getCacheLineSize() override { + unsigned getCacheLineSize() const override { return Impl.getCacheLineSize(); } - llvm::Optional getCacheSize(CacheLevel Level) override { + llvm::Optional getCacheSize(CacheLevel Level) const override { return Impl.getCacheSize(Level); } - llvm::Optional getCacheAssociativity(CacheLevel Level) override { + llvm::Optional getCacheAssociativity(CacheLevel Level) const override { return Impl.getCacheAssociativity(Level); } - unsigned getPrefetchDistance() override { return Impl.getPrefetchDistance(); } - unsigned getMinPrefetchStride() override { + + /// Return the preferred prefetch distance in terms of instructions. + /// + unsigned getPrefetchDistance() const override { + return Impl.getPrefetchDistance(); + } + + /// Return the minimum stride necessary to trigger software + /// prefetching. + /// + unsigned getMinPrefetchStride() const override { return Impl.getMinPrefetchStride(); } - unsigned getMaxPrefetchIterationsAhead() override { + + /// Return the maximum prefetch distance in terms of loop + /// iterations. + /// + unsigned getMaxPrefetchIterationsAhead() const override { return Impl.getMaxPrefetchIterationsAhead(); } + unsigned getMaxInterleaveFactor(unsigned VF) override { return Impl.getMaxInterleaveFactor(VF); } diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h index 2f1011799f137..cdb0ee32de19f 100644 --- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -371,37 +371,6 @@ class TargetTransformInfoImplBase { return false; } - unsigned getCacheLineSize() { return 0; } - - llvm::Optional getCacheSize(TargetTransformInfo::CacheLevel Level) { - switch (Level) { - case TargetTransformInfo::CacheLevel::L1D: - LLVM_FALLTHROUGH; - case TargetTransformInfo::CacheLevel::L2D: - return llvm::Optional(); - } - - llvm_unreachable("Unknown TargetTransformInfo::CacheLevel"); - } - - llvm::Optional getCacheAssociativity( - TargetTransformInfo::CacheLevel Level) { - switch (Level) { - case TargetTransformInfo::CacheLevel::L1D: - LLVM_FALLTHROUGH; - case TargetTransformInfo::CacheLevel::L2D: - return llvm::Optional(); - } - - llvm_unreachable("Unknown TargetTransformInfo::CacheLevel"); - } - - unsigned getPrefetchDistance() { return 0; } - - unsigned getMinPrefetchStride() { return 1; } - - unsigned getMaxPrefetchIterationsAhead() { return UINT_MAX; } - unsigned getMaxInterleaveFactor(unsigned VF) { return 1; } unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h index 75e0f844fd075..7617583fc292d 100644 --- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h +++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h @@ -514,6 +514,34 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase { return BaseT::getInstructionLatency(I); } + virtual Optional + getCacheSize(TargetTransformInfo::CacheLevel Level) const { + return Optional( + getST()->getCacheSize(static_cast(Level))); + } + + virtual Optional + getCacheAssociativity(TargetTransformInfo::CacheLevel Level) const { + return Optional( + getST()->getCacheAssociativity(static_cast(Level))); + } + + virtual unsigned getCacheLineSize() const { + return getST()->getCacheLineSize(); + } + + virtual unsigned getPrefetchDistance() const { + return getST()->getPrefetchDistance(); + } + + virtual unsigned getMinPrefetchStride() const { + return getST()->getMinPrefetchStride(); + } + + virtual unsigned getMaxPrefetchIterationsAhead() const { + return getST()->getMaxPrefetchIterationsAhead(); + } + /// @} /// \name Vector TTI Implementations diff --git a/llvm/include/llvm/MC/MCSubtargetInfo.h b/llvm/include/llvm/MC/MCSubtargetInfo.h index 23a5999b359cb..09130c4641ef1 100644 --- a/llvm/include/llvm/MC/MCSubtargetInfo.h +++ b/llvm/include/llvm/MC/MCSubtargetInfo.h @@ -223,6 +223,50 @@ class MCSubtargetInfo { } virtual unsigned getHwMode() const { return 0; } + + /// Return the cache size in bytes for the given level of cache. + /// Level is zero-based, so a value of zero means the first level of + /// cache. + /// + virtual Optional getCacheSize(unsigned Level) const; + + /// Return the cache associatvity for the given level of cache. + /// Level is zero-based, so a value of zero means the first level of + /// cache. + /// + virtual Optional getCacheAssociativity(unsigned Level) const; + + /// Return the target cache line size in bytes at a given level. + /// + virtual Optional getCacheLineSize(unsigned Level) const; + + /// Return the target cache line size in bytes. By default, return + /// the line size for the bottom-most level of cache. This provides + /// a more convenient interface for the common case where all cache + /// levels have the same line size. Return zero if there is no + /// cache model. + /// + virtual unsigned getCacheLineSize() const { + Optional Size = getCacheLineSize(0); + if (Size) + return *Size; + + return 0; + } + + /// Return the preferred prefetch distance in terms of instructions. + /// + virtual unsigned getPrefetchDistance() const; + + /// Return the maximum prefetch distance in terms of loop + /// iterations. + /// + virtual unsigned getMaxPrefetchIterationsAhead() const; + + /// Return the minimum stride necessary to trigger software + /// prefetching. + /// + virtual unsigned getMinPrefetchStride() const; }; } // end namespace llvm diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp index f3d20ce984dbd..b5467813094e8 100644 --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -40,6 +40,34 @@ namespace { struct NoTTIImpl : TargetTransformInfoImplCRTPBase { explicit NoTTIImpl(const DataLayout &DL) : TargetTransformInfoImplCRTPBase(DL) {} + + unsigned getCacheLineSize() const { return 0; } + + llvm::Optional getCacheSize(TargetTransformInfo::CacheLevel Level) const { + switch (Level) { + case TargetTransformInfo::CacheLevel::L1D: + LLVM_FALLTHROUGH; + case TargetTransformInfo::CacheLevel::L2D: + return llvm::Optional(); + } + llvm_unreachable("Unknown TargetTransformInfo::CacheLevel"); + } + + llvm::Optional getCacheAssociativity( + TargetTransformInfo::CacheLevel Level) const { + switch (Level) { + case TargetTransformInfo::CacheLevel::L1D: + LLVM_FALLTHROUGH; + case TargetTransformInfo::CacheLevel::L2D: + return llvm::Optional(); + } + + llvm_unreachable("Unknown TargetTransformInfo::CacheLevel"); + } + + unsigned getPrefetchDistance() const { return 0; } + unsigned getMinPrefetchStride() const { return 1; } + unsigned getMaxPrefetchIterationsAhead() const { return UINT_MAX; } }; } diff --git a/llvm/lib/MC/MCSubtargetInfo.cpp b/llvm/lib/MC/MCSubtargetInfo.cpp index 5fd48d9e10102..c8678df02bfd7 100644 --- a/llvm/lib/MC/MCSubtargetInfo.cpp +++ b/llvm/lib/MC/MCSubtargetInfo.cpp @@ -315,3 +315,28 @@ void MCSubtargetInfo::initInstrItins(InstrItineraryData &InstrItins) const { InstrItins = InstrItineraryData(getSchedModel(), Stages, OperandCycles, ForwardingPaths); } + +Optional MCSubtargetInfo::getCacheSize(unsigned Level) const { + return Optional(); +} + +Optional +MCSubtargetInfo::getCacheAssociativity(unsigned Level) const { + return Optional(); +} + +Optional MCSubtargetInfo::getCacheLineSize(unsigned Level) const { + return Optional(); +} + +unsigned MCSubtargetInfo::getPrefetchDistance() const { + return 0; +} + +unsigned MCSubtargetInfo::getMaxPrefetchIterationsAhead() const { + return UINT_MAX; +} + +unsigned MCSubtargetInfo::getMinPrefetchStride() const { + return 1; +} diff --git a/llvm/lib/Target/AArch64/AArch64Subtarget.h b/llvm/lib/Target/AArch64/AArch64Subtarget.h index 757a46999868a..00eb972846815 100644 --- a/llvm/lib/Target/AArch64/AArch64Subtarget.h +++ b/llvm/lib/Target/AArch64/AArch64Subtarget.h @@ -353,10 +353,10 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo { unsigned getVectorInsertExtractBaseCost() const { return VectorInsertExtractBaseCost; } - unsigned getCacheLineSize() const { return CacheLineSize; } - unsigned getPrefetchDistance() const { return PrefetchDistance; } - unsigned getMinPrefetchStride() const { return MinPrefetchStride; } - unsigned getMaxPrefetchIterationsAhead() const { + unsigned getCacheLineSize() const override { return CacheLineSize; } + unsigned getPrefetchDistance() const override { return PrefetchDistance; } + unsigned getMinPrefetchStride() const override { return MinPrefetchStride; } + unsigned getMaxPrefetchIterationsAhead() const override { return MaxPrefetchIterationsAhead; } unsigned getPrefFunctionLogAlignment() const { diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp index 301bf72d52399..dc916a7b3407d 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -892,22 +892,6 @@ bool AArch64TTIImpl::shouldConsiderAddressTypePromotion( return Considerable; } -unsigned AArch64TTIImpl::getCacheLineSize() { - return ST->getCacheLineSize(); -} - -unsigned AArch64TTIImpl::getPrefetchDistance() { - return ST->getPrefetchDistance(); -} - -unsigned AArch64TTIImpl::getMinPrefetchStride() { - return ST->getMinPrefetchStride(); -} - -unsigned AArch64TTIImpl::getMaxPrefetchIterationsAhead() { - return ST->getMaxPrefetchIterationsAhead(); -} - bool AArch64TTIImpl::useReductionIntrinsic(unsigned Opcode, Type *Ty, TTI::ReductionFlags Flags) const { assert(isa(Ty) && "Expected Ty to be a vector type"); diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h index 95cda63b01744..310e4538e22e0 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h @@ -156,14 +156,6 @@ class AArch64TTIImpl : public BasicTTIImplBase { shouldConsiderAddressTypePromotion(const Instruction &I, bool &AllowPromotionWithoutCommonHeader); - unsigned getCacheLineSize(); - - unsigned getPrefetchDistance(); - - unsigned getMinPrefetchStride(); - - unsigned getMaxPrefetchIterationsAhead(); - bool shouldExpandReduction(const IntrinsicInst *II) const { return false; } diff --git a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h index 27e8fc0190073..12ede503af833 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h +++ b/llvm/lib/Target/Hexagon/HexagonTargetTransformInfo.h @@ -68,8 +68,8 @@ class HexagonTTIImpl : public BasicTTIImplBase { bool shouldFavorPostInc() const; // L1 cache prefetch. - unsigned getPrefetchDistance() const; - unsigned getCacheLineSize() const; + unsigned getPrefetchDistance() const override; + unsigned getCacheLineSize() const override; /// @} diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp index 40e536687014b..a598df642c065 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp @@ -613,7 +613,7 @@ unsigned PPCTTIImpl::getRegisterBitWidth(bool Vector) const { } -unsigned PPCTTIImpl::getCacheLineSize() { +unsigned PPCTTIImpl::getCacheLineSize() const { // Check first if the user specified a custom line size. if (CacheLineSize.getNumOccurrences() > 0) return CacheLineSize; @@ -628,7 +628,7 @@ unsigned PPCTTIImpl::getCacheLineSize() { return 64; } -unsigned PPCTTIImpl::getPrefetchDistance() { +unsigned PPCTTIImpl::getPrefetchDistance() const { // This seems like a reasonable default for the BG/Q (this pass is enabled, by // default, only on the BG/Q). return 300; diff --git a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h index 5d76ee418b694..e66ba979af15e 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h +++ b/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h @@ -74,8 +74,8 @@ class PPCTTIImpl : public BasicTTIImplBase { bool enableInterleavedAccessVectorization(); unsigned getNumberOfRegisters(bool Vector); unsigned getRegisterBitWidth(bool Vector) const; - unsigned getCacheLineSize(); - unsigned getPrefetchDistance(); + unsigned getCacheLineSize() const override; + unsigned getPrefetchDistance() const override; unsigned getMaxInterleaveFactor(unsigned VF); int vectorCostAdjustment(int Cost, unsigned Opcode, Type *Ty1, Type *Ty2); int getArithmeticInstrCost( diff --git a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h index 16ce2ef1d7a00..bd9d2cd99c2ab 100644 --- a/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h +++ b/llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h @@ -59,9 +59,9 @@ class SystemZTTIImpl : public BasicTTIImplBase { unsigned getNumberOfRegisters(bool Vector); unsigned getRegisterBitWidth(bool Vector) const; - unsigned getCacheLineSize() { return 256; } - unsigned getPrefetchDistance() { return 2000; } - unsigned getMinPrefetchStride() { return 2048; } + unsigned getCacheLineSize() const override { return 256; } + unsigned getPrefetchDistance() const override { return 2000; } + unsigned getMinPrefetchStride() const override { return 2048; } bool hasDivRemOp(Type *DataType, bool IsSigned); bool prefersVectorizedAddressing() { return false; } From e60415a0db2b1696c016ad21821cc2704ee18811 Mon Sep 17 00:00:00 2001 From: Evandro Menezes Date: Wed, 9 Oct 2019 19:58:01 +0000 Subject: [PATCH 34/44] [Support] Add mathematical constants Add own version of the mathematical constants from the upcoming C++20 `std::numbers`. Differential revision: https://reviews.llvm.org/D68257 llvm-svn: 374207 --- llvm/include/llvm/Support/MathExtras.h | 37 +++++++++++++++++++ .../SelectionDAG/SelectionDAGBuilder.cpp | 12 +++--- .../lib/Transforms/Utils/SimplifyLibCalls.cpp | 6 +-- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h index 775d19a698f49..605539ea11e24 100644 --- a/llvm/include/llvm/Support/MathExtras.h +++ b/llvm/include/llvm/Support/MathExtras.h @@ -39,6 +39,7 @@ unsigned char _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask); #endif namespace llvm { + /// The behavior an operation has on an input of 0. enum ZeroBehavior { /// The returned value is undefined. @@ -49,6 +50,42 @@ enum ZeroBehavior { ZB_Width }; +/// Mathematical constants. +namespace numbers { +// TODO: Track C++20 std::numbers. +// TODO: Favor using the hexadecimal FP constants (requires C++17). +constexpr double e = 2.7182818284590452354, // (0x1.5bf0a8b145749P+1) https://oeis.org/A001113 + egamma = .57721566490153286061, // (0x1.2788cfc6fb619P-1) https://oeis.org/A001620 + ln2 = .69314718055994530942, // (0x1.62e42fefa39efP-1) https://oeis.org/A002162 + ln10 = 2.3025850929940456840, // (0x1.24bb1bbb55516P+1) https://oeis.org/A002392 + log2e = 1.4426950408889634074, // (0x1.71547652b82feP+0) + log10e = .43429448190325182765, // (0x1.bcb7b1526e50eP-2) + pi = 3.1415926535897932385, // (0x1.921fb54442d18P+1) https://oeis.org/A000796 + inv_pi = .31830988618379067154, // (0x1.45f306bc9c883P-2) https://oeis.org/A049541 + sqrtpi = 1.7724538509055160273, // (0x1.c5bf891b4ef6bP+0) https://oeis.org/A002161 + inv_sqrtpi = .56418958354775628695, // (0x1.20dd750429b6dP-1) https://oeis.org/A087197 + sqrt2 = 1.4142135623730950488, // (0x1.6a09e667f3bcdP+0) https://oeis.org/A00219 + inv_sqrt2 = .70710678118654752440, // (0x1.6a09e667f3bcdP-1) + sqrt3 = 1.7320508075688772935, // (0x1.bb67ae8584caaP+0) https://oeis.org/A002194 + inv_sqrt3 = .57735026918962576451, // (0x1.279a74590331cP-1) + phi = 1.6180339887498948482; // (0x1.9e3779b97f4a8P+0) https://oeis.org/A001622 +constexpr float ef = 2.71828183F, // (0x1.5bf0a8P+1) https://oeis.org/A001113 + egammaf = .577215665F, // (0x1.2788d0P-1) https://oeis.org/A001620 + ln2f = .693147181F, // (0x1.62e430P-1) https://oeis.org/A002162 + ln10f = 2.30258509F, // (0x1.26bb1cP+1) https://oeis.org/A002392 + log2ef = 1.44269504F, // (0x1.715476P+0) + log10ef = .434294482F, // (0x1.bcb7b2P-2) + pif = 3.14159265F, // (0x1.921fb6P+1) https://oeis.org/A000796 + inv_pif = .318309886F, // (0x1.45f306P-2) https://oeis.org/A049541 + sqrtpif = 1.77245385F, // (0x1.c5bf8aP+0) https://oeis.org/A002161 + inv_sqrtpif = .564189584F, // (0x1.20dd76P-1) https://oeis.org/A087197 + sqrt2f = 1.41421356F, // (0x1.6a09e6P+0) https://oeis.org/A002193 + inv_sqrt2f = .707106781F, // (0x1.6a09e6P-1) + sqrt3f = 1.73205081F, // (0x1.bb67aeP+0) https://oeis.org/A002194 + inv_sqrt3f = .577350269F, // (0x1.279a74P-1) + phif = 1.61803399F; // (0x1.9e377aP+0) https://oeis.org/A001622 +} // namespace numbers + namespace detail { template struct TrailingZerosCounter { static unsigned count(T Val, ZeroBehavior) { diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 5380630eabf6f..3c36cc6f6599c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -4974,12 +4974,11 @@ static SDValue expandExp(const SDLoc &dl, SDValue Op, SelectionDAG &DAG, // Put the exponent in the right bit position for later addition to the // final result: // - // #define LOG2OFe 1.4426950f - // t0 = Op * LOG2OFe + // t0 = Op * log2(e) // TODO: What fast-math-flags should be set here? SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, Op, - getF32Constant(DAG, 0x3fb8aa3b, dl)); + DAG.getConstantFP(numbers::log2ef, dl, MVT::f32)); return getLimitedPrecisionExp2(t0, dl, DAG); } @@ -4997,10 +4996,11 @@ static SDValue expandLog(const SDLoc &dl, SDValue Op, SelectionDAG &DAG, LimitFloatPrecision > 0 && LimitFloatPrecision <= 18) { SDValue Op1 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, Op); - // Scale the exponent by log(2) [0.69314718f]. + // Scale the exponent by log(2). SDValue Exp = GetExponent(DAG, Op1, TLI, dl); - SDValue LogOfExponent = DAG.getNode(ISD::FMUL, dl, MVT::f32, Exp, - getF32Constant(DAG, 0x3f317218, dl)); + SDValue LogOfExponent = + DAG.getNode(ISD::FMUL, dl, MVT::f32, Exp, + DAG.getConstantFP(numbers::ln2f, dl, MVT::f32)); // Get the significand and build it into a floating-point number with // exponent of 1. diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp index 1fb4f28f33641..461a5e2cba0d6 100644 --- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -48,7 +48,6 @@ static cl::opt cl::desc("Enable unsafe double to float " "shrinking for math lib calls")); - //===----------------------------------------------------------------------===// // Helper Functions //===----------------------------------------------------------------------===// @@ -1941,9 +1940,8 @@ Value *LibCallSimplifier::optimizeLog(CallInst *Log, IRBuilder<> &B) { ArgID == Intrinsic::exp || ArgID == Intrinsic::exp2) { Constant *Eul; if (ArgLb == ExpLb || ArgID == Intrinsic::exp) - // FIXME: The Euler number should be M_E, but it's place of definition - // is not quite standard. - Eul = ConstantFP::get(Log->getType(), 2.7182818284590452354); + // FIXME: Add more precise value of e for long double. + Eul = ConstantFP::get(Log->getType(), numbers::e); else if (ArgLb == Exp2Lb || ArgID == Intrinsic::exp2) Eul = ConstantFP::get(Log->getType(), 2.0); else From c57a9dc487e3959337b72c0779f397174bb52c99 Mon Sep 17 00:00:00 2001 From: Evandro Menezes Date: Wed, 9 Oct 2019 20:00:43 +0000 Subject: [PATCH 35/44] [AMDGPU] Use math constants defined in MathExtras (NFC) Use the the new math constants in `MathExtras.h`. Differential revision: https://reviews.llvm.org/D68285 llvm-svn: 374208 --- llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp | 28 +++------------- llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp | 33 ++++++++----------- llvm/lib/Target/AMDGPU/R600ISelLowering.cpp | 3 +- 3 files changed, 19 insertions(+), 45 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp index 65fa2720b5153..3027b21fb0537 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp @@ -12,10 +12,6 @@ // //===----------------------------------------------------------------------===// -#define AMDGPU_LOG2E_F 1.44269504088896340735992468100189214f -#define AMDGPU_LN2_F 0.693147180559945309417232121458176568f -#define AMDGPU_LN10_F 2.30258509299404568401799145468436421f - #include "AMDGPUISelLowering.h" #include "AMDGPU.h" #include "AMDGPUCallLowering.h" @@ -37,6 +33,7 @@ #include "llvm/IR/DataLayout.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/Support/KnownBits.h" +#include "llvm/Support/MathExtras.h" using namespace llvm; #include "AMDGPUGenCallingConv.inc" @@ -1135,9 +1132,9 @@ SDValue AMDGPUTargetLowering::LowerOperation(SDValue Op, case ISD::FROUND: return LowerFROUND(Op, DAG); case ISD::FFLOOR: return LowerFFLOOR(Op, DAG); case ISD::FLOG: - return LowerFLOG(Op, DAG, 1 / AMDGPU_LOG2E_F); + return LowerFLOG(Op, DAG, 1.0F / numbers::log2ef); case ISD::FLOG10: - return LowerFLOG(Op, DAG, AMDGPU_LN2_F / AMDGPU_LN10_F); + return LowerFLOG(Op, DAG, numbers::ln2f / numbers::ln10f); case ISD::FEXP: return lowerFEXP(Op, DAG); case ISD::SINT_TO_FP: return LowerSINT_TO_FP(Op, DAG); @@ -2285,30 +2282,13 @@ SDValue AMDGPUTargetLowering::LowerFLOG(SDValue Op, SelectionDAG &DAG, return DAG.getNode(ISD::FMUL, SL, VT, Log2Operand, Log2BaseInvertedOperand); } -// Return M_LOG2E of appropriate type -static SDValue getLog2EVal(SelectionDAG &DAG, const SDLoc &SL, EVT VT) { - switch (VT.getScalarType().getSimpleVT().SimpleTy) { - case MVT::f32: - return DAG.getConstantFP(1.44269504088896340735992468100189214f, SL, VT); - case MVT::f16: - return DAG.getConstantFP( - APFloat(APFloat::IEEEhalf(), "1.44269504088896340735992468100189214"), - SL, VT); - case MVT::f64: - return DAG.getConstantFP( - APFloat(APFloat::IEEEdouble(), "0x1.71547652b82fep+0"), SL, VT); - default: - llvm_unreachable("unsupported fp type"); - } -} - // exp2(M_LOG2E_F * f); SDValue AMDGPUTargetLowering::lowerFEXP(SDValue Op, SelectionDAG &DAG) const { EVT VT = Op.getValueType(); SDLoc SL(Op); SDValue Src = Op.getOperand(0); - const SDValue K = getLog2EVal(DAG, SL, VT); + const SDValue K = DAG.getConstantFP(numbers::log2e, SL, VT); SDValue Mul = DAG.getNode(ISD::FMUL, SL, VT, Src, K, Op->getFlags()); return DAG.getNode(ISD::FEXP2, SL, VT, Mul, Op->getFlags()); } diff --git a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp index 03f056f0fdce5..2c94e00466510 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp @@ -30,6 +30,7 @@ #include "llvm/IR/Module.h" #include "llvm/IR/ValueSymbolTable.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" @@ -48,18 +49,10 @@ static cl::list UseNative("amdgpu-use-native", cl::CommaSeparated, cl::ValueOptional, cl::Hidden); -#define MATH_PI 3.14159265358979323846264338327950288419716939937511 -#define MATH_E 2.71828182845904523536028747135266249775724709369996 -#define MATH_SQRT2 1.41421356237309504880168872420969807856967187537695 - -#define MATH_LOG2E 1.4426950408889634073599246810018921374266459541529859 -#define MATH_LOG10E 0.4342944819032518276511289189166050822943970058036665 -// Value of log2(10) -#define MATH_LOG2_10 3.3219280948873623478703194294893901758648313930245806 -// Value of 1 / log2(10) -#define MATH_RLOG2_10 0.3010299956639811952137388947244930267681898814621085 -// Value of 1 / M_LOG2E_F = 1 / log2(e) -#define MATH_RLOG2_E 0.6931471805599453094172321214581765680755001343602552 +#define MATH_PI numbers::pi +#define MATH_E numbers::e +#define MATH_SQRT2 numbers::sqrt2 +#define MATH_SQRT1_2 numbers::inv_sqrt2 namespace llvm { @@ -254,8 +247,8 @@ struct TableEntry { /* a list of {result, input} */ static const TableEntry tbl_acos[] = { - {MATH_PI/2.0, 0.0}, - {MATH_PI/2.0, -0.0}, + {MATH_PI / 2.0, 0.0}, + {MATH_PI / 2.0, -0.0}, {0.0, 1.0}, {MATH_PI, -1.0} }; @@ -271,8 +264,8 @@ static const TableEntry tbl_acospi[] = { static const TableEntry tbl_asin[] = { {0.0, 0.0}, {-0.0, -0.0}, - {MATH_PI/2.0, 1.0}, - {-MATH_PI/2.0, -1.0} + {MATH_PI / 2.0, 1.0}, + {-MATH_PI / 2.0, -1.0} }; static const TableEntry tbl_asinh[] = { {0.0, 0.0}, @@ -287,8 +280,8 @@ static const TableEntry tbl_asinpi[] = { static const TableEntry tbl_atan[] = { {0.0, 0.0}, {-0.0, -0.0}, - {MATH_PI/4.0, 1.0}, - {-MATH_PI/4.0, -1.0} + {MATH_PI / 4.0, 1.0}, + {-MATH_PI / 4.0, -1.0} }; static const TableEntry tbl_atanh[] = { {0.0, 0.0}, @@ -359,7 +352,7 @@ static const TableEntry tbl_log10[] = { }; static const TableEntry tbl_rsqrt[] = { {1.0, 1.0}, - {1.0/MATH_SQRT2, 2.0} + {MATH_SQRT1_2, 2.0} }; static const TableEntry tbl_sin[] = { {0.0, 0.0}, @@ -868,7 +861,7 @@ static double log2(double V) { #if _XOPEN_SOURCE >= 600 || defined(_ISOC99_SOURCE) || _POSIX_C_SOURCE >= 200112L return ::log2(V); #else - return log(V) / 0.693147180559945309417; + return log(V) / numbers::ln2; #endif } } diff --git a/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp b/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp index fa1565148d1ad..659458b0b752d 100644 --- a/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp @@ -41,6 +41,7 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MachineValueType.h" +#include "llvm/Support/MathExtras.h" #include #include #include @@ -782,7 +783,7 @@ SDValue R600TargetLowering::LowerTrig(SDValue Op, SelectionDAG &DAG) const { return TrigVal; // On R600 hw, COS/SIN input must be between -Pi and Pi. return DAG.getNode(ISD::FMUL, DL, VT, TrigVal, - DAG.getConstantFP(3.14159265359, DL, MVT::f32)); + DAG.getConstantFP(numbers::pif, DL, MVT::f32)); } SDValue R600TargetLowering::LowerSHLParts(SDValue Op, SelectionDAG &DAG) const { From 232b9dc46a301c252c3c54543a3c67e13d517475 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 9 Oct 2019 20:14:17 +0000 Subject: [PATCH 36/44] [ConstProp] add tests for extractelement with undef index; NFC llvm-svn: 374210 --- .../Transforms/ConstProp/InsertElement.ll | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/llvm/test/Transforms/ConstProp/InsertElement.ll b/llvm/test/Transforms/ConstProp/InsertElement.ll index 011ad3f57f468..ba3a9ade7176b 100644 --- a/llvm/test/Transforms/ConstProp/InsertElement.ll +++ b/llvm/test/Transforms/ConstProp/InsertElement.ll @@ -1,32 +1,53 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -constprop -S | FileCheck %s -; CHECK-LABEL: @test1 define i32 @test1() { +; CHECK-LABEL: @test1( +; CHECK-NEXT: ret i32 2139171423 +; %A = bitcast i32 2139171423 to float %B = insertelement <1 x float> undef, float %A, i32 0 %C = extractelement <1 x float> %B, i32 0 %D = bitcast float %C to i32 ret i32 %D -; CHECK: ret i32 2139171423 } -; CHECK-LABEL: @insertelement define <4 x i64> @insertelement() { +; CHECK-LABEL: @insertelement( +; CHECK-NEXT: ret <4 x i64> +; %vec1 = insertelement <4 x i64> undef, i64 -1, i32 0 %vec2 = insertelement <4 x i64> %vec1, i64 -2, i32 1 %vec3 = insertelement <4 x i64> %vec2, i64 -3, i32 2 %vec4 = insertelement <4 x i64> %vec3, i64 -4, i32 3 - ; CHECK: ret <4 x i64> ret <4 x i64> %vec4 } -; CHECK-LABEL: @insertelement_undef define <4 x i64> @insertelement_undef() { +; CHECK-LABEL: @insertelement_undef( +; CHECK-NEXT: [[VEC4:%.*]] = insertelement <4 x i64> , i64 -4, i32 3 +; CHECK-NEXT: ret <4 x i64> undef +; %vec1 = insertelement <4 x i64> undef, i64 -1, i32 0 %vec2 = insertelement <4 x i64> %vec1, i64 -2, i32 1 %vec3 = insertelement <4 x i64> %vec2, i64 -3, i32 2 %vec4 = insertelement <4 x i64> %vec3, i64 -4, i32 3 %vec5 = insertelement <4 x i64> %vec3, i64 -5, i32 4 - ; CHECK: ret <4 x i64> undef ret <4 x i64> %vec5 } + +define i64 @extract_undef_index_from_zero_vec() { +; CHECK-LABEL: @extract_undef_index_from_zero_vec( +; CHECK-NEXT: ret i64 0 +; + %E = extractelement <2 x i64> zeroinitializer, i64 undef + ret i64 %E +} + +define i64 @extract_undef_index_from_nonzero_vec() { +; CHECK-LABEL: @extract_undef_index_from_nonzero_vec( +; CHECK-NEXT: ret i64 undef +; + %E = extractelement <2 x i64> , i64 undef + ret i64 %E +} From c3317658cf26471d78008c6f401d98e36f4fbdd7 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 9 Oct 2019 20:18:27 +0000 Subject: [PATCH 37/44] [sanitizer] Use raise() in test and cover more signals llvm-svn: 374211 --- .../TestCases/Linux/signal_name.cpp | 19 +++++++++++++++++++ .../TestCases/Linux/signal_trap.cpp | 8 -------- 2 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.cpp delete mode 100644 compiler-rt/test/sanitizer_common/TestCases/Linux/signal_trap.cpp diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.cpp new file mode 100644 index 0000000000000..1842dc7210647 --- /dev/null +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.cpp @@ -0,0 +1,19 @@ +// RUN: %clangxx -O1 %s -o %t +// RUN: %env_tool_opts=handle_sigfpe=2 not %run %t 0 2>&1 | FileCheck %s -DSIGNAME=FPE +// RUN: %env_tool_opts=handle_sigill=2 not %run %t 1 2>&1 | FileCheck %s -DSIGNAME=ILL +// RUN: %env_tool_opts=handle_abort=2 not %run %t 2 2>&1 | FileCheck %s -DSIGNAME=ABRT +// RUN: %env_tool_opts=handle_segv=2 not %run %t 3 2>&1 | FileCheck %s -DSIGNAME=SEGV +// RUN: %env_tool_opts=handle_sigbus=2 not %run %t 4 2>&1 | FileCheck %s -DSIGNAME=BUS +// RUN: %env_tool_opts=handle_sigtrap=2 not %run %t 5 2>&1 | FileCheck %s -DSIGNAME=TRAP + +#include +#include + +int main(int argc, char **argv) { + if (argc != 2) return 0; + int signals[] = {SIGFPE, SIGILL, SIGABRT, SIGSEGV, SIGBUS, SIGTRAP}; + raise(signals[atoi(argv[1])]); +} + +// CHECK: Sanitizer:DEADLYSIGNAL +// CHECK: Sanitizer: [[SIGNAME]] on unknown address diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_trap.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_trap.cpp deleted file mode 100644 index 4298d44b88ca4..0000000000000 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_trap.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// RUN: %clangxx -O1 %s -o %t && %env_tool_opts=handle_sigtrap=2 not %run %t 2>&1 | FileCheck %s - -int main() { - __builtin_debugtrap(); -} - -// CHECK: Sanitizer:DEADLYSIGNAL -// CHECK: Sanitizer: TRAP on unknown address From c7cfa7c34e3ea9aa20288d2475ccb2ca85730605 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Wed, 9 Oct 2019 20:21:33 +0000 Subject: [PATCH 38/44] [test] Skip entry value test when clang < 10.0.0 clang-9 emitted the wrong opcode for entry values on Darwin. rdar://56119661 llvm-svn: 374212 --- .../basic_entry_values_x86_64/TestBasicEntryValuesX86_64.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/TestBasicEntryValuesX86_64.py b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/TestBasicEntryValuesX86_64.py index ad50f12c6b827..e0285e6d626d8 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/TestBasicEntryValuesX86_64.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/param_entry_vals/basic_entry_values_x86_64/TestBasicEntryValuesX86_64.py @@ -7,6 +7,7 @@ lldbinline.MakeInlineTest(__file__, globals(), [decorators.skipUnlessPlatform(supported_platforms), + decorators.skipIf(compiler="clang", compiler_version=['<', '10.0']), decorators.skipUnlessArch('x86_64'), decorators.skipUnlessHasCallSiteInfo, decorators.skipIf(dwarf_version=['<', '4'])]) From 39f759189d51ea32e3010772e4e1409b62aa7ef9 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 9 Oct 2019 20:22:14 +0000 Subject: [PATCH 39/44] [sanitizer] Make signal_name a C test llvm-svn: 374213 --- .../TestCases/Linux/{signal_name.cpp => signal_name.c} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename compiler-rt/test/sanitizer_common/TestCases/Linux/{signal_name.cpp => signal_name.c} (93%) diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c similarity index 93% rename from compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.cpp rename to compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c index 1842dc7210647..e29cb1e730362 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_name.c @@ -1,4 +1,4 @@ -// RUN: %clangxx -O1 %s -o %t +// RUN: %clang -O1 %s -o %t // RUN: %env_tool_opts=handle_sigfpe=2 not %run %t 0 2>&1 | FileCheck %s -DSIGNAME=FPE // RUN: %env_tool_opts=handle_sigill=2 not %run %t 1 2>&1 | FileCheck %s -DSIGNAME=ILL // RUN: %env_tool_opts=handle_abort=2 not %run %t 2 2>&1 | FileCheck %s -DSIGNAME=ABRT @@ -10,7 +10,8 @@ #include int main(int argc, char **argv) { - if (argc != 2) return 0; + if (argc != 2) + return 0; int signals[] = {SIGFPE, SIGILL, SIGABRT, SIGSEGV, SIGBUS, SIGTRAP}; raise(signals[atoi(argv[1])]); } From 02d264a54712badfb1886f4b692d51ad0259c0a6 Mon Sep 17 00:00:00 2001 From: DeForest Richards Date: Wed, 9 Oct 2019 20:26:13 +0000 Subject: [PATCH 40/44] [Docs] Adds Documentation links to sidebar Adds links to Getting Started/Tutorials, User Guides, and Reference documentation pages to sidebar. Also adds a new section for LLVM IR on the Reference documentation page. llvm-svn: 374214 --- llvm/docs/GettingStartedTutorials.rst | 6 +++- llvm/docs/Reference.rst | 42 +++++++++++++------------- llvm/docs/_templates/indexsidebar.html | 8 +++++ 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/llvm/docs/GettingStartedTutorials.rst b/llvm/docs/GettingStartedTutorials.rst index a8d60343ddc5b..712463952b84e 100644 --- a/llvm/docs/GettingStartedTutorials.rst +++ b/llvm/docs/GettingStartedTutorials.rst @@ -6,6 +6,7 @@ For those new to the LLVM system. .. toctree:: :hidden: + CompilerWriterInfo Frontend/PerformanceTips GettingStarted GettingStartedVS @@ -31,4 +32,7 @@ For those new to the LLVM system. :doc:`GettingStartedVS` An addendum to the main Getting Started guide for those using Visual Studio - on Windows. \ No newline at end of file + on Windows. + +:doc:`CompilerWriterInfo` + A list of helpful links for compiler writers. \ No newline at end of file diff --git a/llvm/docs/Reference.rst b/llvm/docs/Reference.rst index a24a8a1eade5a..c18b6d01375dd 100644 --- a/llvm/docs/Reference.rst +++ b/llvm/docs/Reference.rst @@ -16,7 +16,6 @@ LLVM and API reference documentation. Bugpoint CFIVerify CommandGuide/index - CompilerWriterInfo Coroutines DependenceGraphs/index ExceptionHandling @@ -68,23 +67,9 @@ API Reference LLVM Reference -------------- -:doc:`LLVM Language Reference Manual ` - Defines the LLVM intermediate representation and the assembly form of the - different nodes. - :doc:`FaultMaps` LLVM support for folding control flow into faulting machine instructions. -:doc:`InAlloca` - Description of the ``inalloca`` argument attribute. - -:doc:`Machine IR (MIR) Format Reference Manual ` - A reference manual for the MIR serialization format, which is used to test - LLVM's code generation passes. - -:doc:`GlobalISel` - This describes the prototype instruction selection replacement, GlobalISel. - :doc:`Atomics` Information about LLVM's concurrency model. @@ -92,12 +77,6 @@ LLVM Reference This document describes the design and implementation of exception handling in LLVM. -:doc:`CompilerWriterInfo` - A list of helpful links for compiler writers. - -:doc:`BitCodeFormat` - This describes the file format and encoding used for LLVM "bc" files. - :doc:`Extensions` LLVM-specific extensions to tools and formats LLVM seeks compatibility with. @@ -198,6 +177,27 @@ LibFuzzer :doc:`FuzzingLLVM` Information on writing and using Fuzzers to find bugs in LLVM. +======== +LLVM IR +======== + +:doc:`LLVM Language Reference Manual ` + Defines the LLVM intermediate representation and the assembly form of the + different nodes. + +:doc:`InAlloca` + Description of the ``inalloca`` argument attribute. + +:doc:`BitCodeFormat` + This describes the file format and encoding used for LLVM "bc" files. + +:doc:`Machine IR (MIR) Format Reference Manual ` + A reference manual for the MIR serialization format, which is used to test + LLVM's code generation passes. + +:doc:`GlobalISel` + This describes the prototype instruction selection replacement, GlobalISel. + ======= Testing ======= diff --git a/llvm/docs/_templates/indexsidebar.html b/llvm/docs/_templates/indexsidebar.html index 1a7b7df3ef6ef..0046f10b21f76 100644 --- a/llvm/docs/_templates/indexsidebar.html +++ b/llvm/docs/_templates/indexsidebar.html @@ -1,6 +1,14 @@ {# This template defines sidebar which can be used to provide common links on all documentation pages. #} +

Documentation

+ + +

Getting Involved

    From be1c2902265edc578d3f652ebcdeac8fe1d045b7 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 9 Oct 2019 20:30:54 +0000 Subject: [PATCH 41/44] [utils] Update lldb-dotest for new test layout The path to dotest.py changed after the test directory reorganization. llvm-svn: 374215 --- lldb/utils/lldb-dotest/lldb-dotest.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/utils/lldb-dotest/lldb-dotest.in b/lldb/utils/lldb-dotest/lldb-dotest.in index 68d3127340334..2032e2159d942 100755 --- a/lldb/utils/lldb-dotest/lldb-dotest.in +++ b/lldb/utils/lldb-dotest/lldb-dotest.in @@ -2,7 +2,7 @@ import subprocess import sys -dotest_path = '@LLDB_SOURCE_DIR@/test/dotest.py' +dotest_path = '@LLDB_SOURCE_DIR@/test/API/dotest.py' build_dir = '@LLDB_TEST_BUILD_DIRECTORY@' dotest_args_str = '@LLDB_DOTEST_ARGS@' From d61ef7c46d11d31f5983ce87997244168d3b64e1 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 9 Oct 2019 20:36:29 +0000 Subject: [PATCH 42/44] [CMake] Fix add_lldb_test_dependency This function would ignore all but the first argument. Now it correctly adds every dependency by iterating over its arguments. llvm-svn: 374216 --- lldb/cmake/modules/AddLLDB.cmake | 6 ++++-- lldb/test/CMakeLists.txt | 16 ++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake index f6402f94385cb..ef1e1df4c68fc 100644 --- a/lldb/cmake/modules/AddLLDB.cmake +++ b/lldb/cmake/modules/AddLLDB.cmake @@ -27,8 +27,10 @@ function(lldb_tablegen) endif() endfunction(lldb_tablegen) -function(add_lldb_test_dependency name) - add_dependencies(lldb-test-deps ${name}) +function(add_lldb_test_dependency) + foreach(dependency ${ARGN}) + add_dependencies(lldb-test-deps ${dependency}) + endforeach() endfunction(add_lldb_test_dependency) function(add_lldb_library name) diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index d54e9ce010bf9..d13b13950462b 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -70,6 +70,14 @@ else() endif() endif() +if(NOT LLDB_BUILT_STANDALONE) + add_lldb_test_dependency( + FileCheck + count + not + ) +endif() + # the value is not canonicalized within LLVM llvm_canonicalize_cmake_booleans( LLDB_DISABLE_PYTHON @@ -100,14 +108,6 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit-lldb-init.in ${CMAKE_CURRENT_BINARY_DIR}/Shell/lit-lldb-init) -if(NOT LLDB_BUILT_STANDALONE) - add_lldb_test_dependency( - FileCheck - count - not - ) -endif() - add_lit_testsuites(LLDB ${CMAKE_CURRENT_SOURCE_DIR} From 868b47fcbef1a116adf6668f24c2c3fcbfd57701 Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Wed, 9 Oct 2019 20:39:04 +0000 Subject: [PATCH 43/44] Skip Apple simulator test for all remote testing scenarios. The test makes no sense to run remotely, period. The architecture of the target is not the discriminant here. llvm-svn: 374217 --- .../test/tools/lldb-server/TestAppleSimulatorOSType.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py index ac90f9499aa1d..70a07ae183d93 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py @@ -103,21 +103,21 @@ def check_simulator_ostype(self, sdk, platform, arch='x86_64'): @apple_simulator_test('iphone') @debugserver_test - @skipIfDarwinEmbedded + @skipIfRemote def test_simulator_ostype_ios(self): self.check_simulator_ostype(sdk='iphonesimulator', platform='ios') @apple_simulator_test('appletv') @debugserver_test - @skipIfDarwinEmbedded + @skipIfRemote def test_simulator_ostype_tvos(self): self.check_simulator_ostype(sdk='appletvsimulator', platform='tvos') @apple_simulator_test('watch') @debugserver_test - @skipIfDarwinEmbedded + @skipIfRemote def test_simulator_ostype_watchos(self): self.check_simulator_ostype(sdk='watchsimulator', platform='watchos', arch='i386') From a0d83768f10849e5cf230391fac949dc5118c0a6 Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev Date: Wed, 9 Oct 2019 20:42:58 +0000 Subject: [PATCH 44/44] [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries This patch removes the remaining part of the OpenMP offload linker scripts which was used for inserting device binaries into the output linked binary. Device binaries are now inserted into the host binary with a help of the wrapper bit-code file which contains device binaries as data. Wrapper bit-code file is dynamically created by the clang driver with a help of new tool clang-offload-wrapper which takes device binaries as input and produces bit-code file with required contents. Wrapper bit-code is then compiled to an object and resulting object is appended to the host linking by the clang driver. This is the second part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943). Differential Revision: https://reviews.llvm.org/D68166 llvm-svn: 374219 --- clang/include/clang/Driver/Action.h | 14 +- clang/include/clang/Driver/Options.td | 2 - clang/include/clang/Driver/ToolChain.h | 2 + clang/lib/Driver/Action.cpp | 8 + clang/lib/Driver/Driver.cpp | 57 ++-- clang/lib/Driver/ToolChain.cpp | 9 + clang/lib/Driver/ToolChains/Clang.cpp | 54 ++++ clang/lib/Driver/ToolChains/Clang.h | 14 + clang/lib/Driver/ToolChains/CommonArgs.cpp | 114 -------- clang/lib/Driver/ToolChains/CommonArgs.h | 7 - clang/lib/Driver/ToolChains/Cuda.cpp | 2 - clang/lib/Driver/ToolChains/Gnu.cpp | 5 +- clang/test/Driver/clang-offload-wrapper.c | 29 +++ clang/test/Driver/openmp-offload-gpu.c | 2 +- clang/test/Driver/openmp-offload.c | 244 +++++++++--------- clang/tools/CMakeLists.txt | 1 + .../clang-offload-wrapper/CMakeLists.txt | 23 ++ .../ClangOffloadWrapper.cpp | 196 ++++++++++++++ 18 files changed, 518 insertions(+), 265 deletions(-) create mode 100644 clang/test/Driver/clang-offload-wrapper.c create mode 100644 clang/tools/clang-offload-wrapper/CMakeLists.txt create mode 100644 clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp diff --git a/clang/include/clang/Driver/Action.h b/clang/include/clang/Driver/Action.h index c6e90b2978354..8ccbb6c2bbfa2 100644 --- a/clang/include/clang/Driver/Action.h +++ b/clang/include/clang/Driver/Action.h @@ -72,9 +72,10 @@ class Action { VerifyPCHJobClass, OffloadBundlingJobClass, OffloadUnbundlingJobClass, + OffloadWrapperJobClass, JobClassFirst = PreprocessJobClass, - JobClassLast = OffloadUnbundlingJobClass + JobClassLast = OffloadWrapperJobClass }; // The offloading kind determines if this action is binded to a particular @@ -625,6 +626,17 @@ class OffloadUnbundlingJobAction final : public JobAction { } }; +class OffloadWrapperJobAction : public JobAction { + void anchor() override; + +public: + OffloadWrapperJobAction(ActionList &Inputs, types::ID Type); + + static bool classof(const Action *A) { + return A->getKind() == OffloadWrapperJobClass; + } +}; + } // namespace driver } // namespace clang diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index cbcf2ab326633..c6e06f2e7dd3c 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1604,8 +1604,6 @@ def fnoopenmp_use_tls : Flag<["-"], "fnoopenmp-use-tls">, Group, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>; def fopenmp_targets_EQ : CommaJoined<["-"], "fopenmp-targets=">, Flags<[DriverOption, CC1Option]>, HelpText<"Specify comma-separated list of triples OpenMP offloading targets to be supported">; -def fopenmp_dump_offload_linker_script : Flag<["-"], "fopenmp-dump-offload-linker-script">, - Group, Flags<[NoArgumentUnused, HelpHidden]>; def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">, Group, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>; def fnoopenmp_relocatable_target : Flag<["-"], "fnoopenmp-relocatable-target">, diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h index 2ba16ab21a927..f0676eee2d6ce 100644 --- a/clang/include/clang/Driver/ToolChain.h +++ b/clang/include/clang/Driver/ToolChain.h @@ -138,6 +138,7 @@ class ToolChain { mutable std::unique_ptr Link; mutable std::unique_ptr IfsMerge; mutable std::unique_ptr OffloadBundler; + mutable std::unique_ptr OffloadWrapper; Tool *getClang() const; Tool *getAssemble() const; @@ -145,6 +146,7 @@ class ToolChain { Tool *getIfsMerge() const; Tool *getClangAs() const; Tool *getOffloadBundler() const; + Tool *getOffloadWrapper() const; mutable std::unique_ptr SanitizerArguments; mutable std::unique_ptr XRayArguments; diff --git a/clang/lib/Driver/Action.cpp b/clang/lib/Driver/Action.cpp index 0187cf981eb56..0eb4c7257e7a8 100644 --- a/clang/lib/Driver/Action.cpp +++ b/clang/lib/Driver/Action.cpp @@ -41,6 +41,8 @@ const char *Action::getClassName(ActionClass AC) { return "clang-offload-bundler"; case OffloadUnbundlingJobClass: return "clang-offload-unbundler"; + case OffloadWrapperJobClass: + return "clang-offload-wrapper"; } llvm_unreachable("invalid class"); @@ -407,3 +409,9 @@ void OffloadUnbundlingJobAction::anchor() {} OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(Action *Input) : JobAction(OffloadUnbundlingJobClass, Input, Input->getType()) {} + +void OffloadWrapperJobAction::anchor() {} + +OffloadWrapperJobAction::OffloadWrapperJobAction(ActionList &Inputs, + types::ID Type) + : JobAction(OffloadWrapperJobClass, Inputs, Type) {} diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index a095274298271..51c262aa0a330 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2287,6 +2287,9 @@ class OffloadingActionBuilder final { /// Append top level actions generated by the builder. virtual void appendTopLevelActions(ActionList &AL) {} + /// Append linker actions generated by the builder. + virtual void appendLinkActions(ActionList &AL) {} + /// Append linker actions generated by the builder. virtual void appendLinkDependences(OffloadAction::DeviceDependences &DA) {} @@ -2890,7 +2893,7 @@ class OffloadingActionBuilder final { OpenMPDeviceActions.clear(); } - void appendLinkDependences(OffloadAction::DeviceDependences &DA) override { + void appendLinkActions(ActionList &AL) override { assert(ToolChains.size() == DeviceLinkerInputs.size() && "Toolchains and linker inputs sizes do not match."); @@ -2899,12 +2902,18 @@ class OffloadingActionBuilder final { for (auto &LI : DeviceLinkerInputs) { auto *DeviceLinkAction = C.MakeAction(LI, types::TY_Image); - DA.add(*DeviceLinkAction, **TC, /*BoundArch=*/nullptr, - Action::OFK_OpenMP); + OffloadAction::DeviceDependences DeviceLinkDeps; + DeviceLinkDeps.add(*DeviceLinkAction, **TC, /*BoundArch=*/nullptr, + Action::OFK_OpenMP); + AL.push_back(C.MakeAction(DeviceLinkDeps, + DeviceLinkAction->getType())); ++TC; } + DeviceLinkerInputs.clear(); } + void appendLinkDependences(OffloadAction::DeviceDependences &DA) override {} + bool initialize() override { // Get the OpenMP toolchains. If we don't get any, the action builder will // know there is nothing to do related to OpenMP offloading. @@ -3129,6 +3138,25 @@ class OffloadingActionBuilder final { return false; } + Action* makeHostLinkAction() { + // Build a list of device linking actions. + ActionList DeviceAL; + for (DeviceActionBuilder *SB : SpecializedBuilders) { + if (!SB->isValid()) + continue; + SB->appendLinkActions(DeviceAL); + } + + if (DeviceAL.empty()) + return nullptr; + + // Create wrapper bitcode from the result of device link actions and compile + // it to an object which will be added to the host link command. + auto *BC = C.MakeAction(DeviceAL, types::TY_LLVM_BC); + auto *ASM = C.MakeAction(BC, types::TY_PP_Asm); + return C.MakeAction(ASM, types::TY_Object); + } + /// Processes the host linker action. This currently consists of replacing it /// with an offload action if there are device link objects and propagate to /// the host action all the offload kinds used in the current compilation. The @@ -3434,6 +3462,8 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args, // Add a link action if necessary. if (!LinkerInputs.empty()) { + if (Action *Wrapper = OffloadBuilder.makeHostLinkAction()) + LinkerInputs.push_back(Wrapper); Action *LA = C.MakeAction(LinkerInputs, types::TY_Image); LA = OffloadBuilder.processHostLinkAction(LA); Actions.push_back(LA); @@ -3820,18 +3850,8 @@ class ToolSelector final { if (!AJ || !BJ) return nullptr; - // Retrieve the compile job, backend action must always be preceded by one. - ActionList CompileJobOffloadActions; - auto *CJ = getPrevDependentAction(BJ->getInputs(), CompileJobOffloadActions, - /*CanBeCollapsed=*/false); - if (!AJ || !BJ || !CJ) - return nullptr; - - assert(isa(CJ) && - "Expecting compile job preceding backend job."); - - // Get compiler tool. - const Tool *T = TC.SelectTool(*CJ); + // Get backend tool. + const Tool *T = TC.SelectTool(*BJ); if (!T) return nullptr; @@ -4236,6 +4256,13 @@ InputInfo Driver::BuildJobsForActionNoCache( A->getOffloadingDeviceKind(), TC->getTriple().normalize(), /*CreatePrefixForHost=*/!!A->getOffloadingHostActiveKinds() && !AtTopLevel); + if (isa(JA)) { + OffloadingPrefix += "-wrapper"; + if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o)) + BaseInput = FinalOutput->getValue(); + else + BaseInput = getDefaultImageName(); + } Result = InputInfo(A, GetNamedOutputPath(C, *JA, BaseInput, BoundArch, AtTopLevel, MultipleArchs, OffloadingPrefix), diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index db2497a10856f..357a5106ab393 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -292,6 +292,12 @@ Tool *ToolChain::getOffloadBundler() const { return OffloadBundler.get(); } +Tool *ToolChain::getOffloadWrapper() const { + if (!OffloadWrapper) + OffloadWrapper.reset(new tools::OffloadWrapper(*this)); + return OffloadWrapper.get(); +} + Tool *ToolChain::getTool(Action::ActionClass AC) const { switch (AC) { case Action::AssembleJobClass: @@ -324,6 +330,9 @@ Tool *ToolChain::getTool(Action::ActionClass AC) const { case Action::OffloadBundlingJobClass: case Action::OffloadUnbundlingJobClass: return getOffloadBundler(); + + case Action::OffloadWrapperJobClass: + return getOffloadWrapper(); } llvm_unreachable("Invalid tool kind."); diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 98e8c57235a99..22b830ee838b4 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -6463,3 +6463,57 @@ void OffloadBundler::ConstructJobMultipleOutputs( TCArgs.MakeArgString(getToolChain().GetProgramPath(getShortName())), CmdArgs, None)); } + +void OffloadWrapper::ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, + const InputInfoList &Inputs, + const ArgList &Args, + const char *LinkingOutput) const { + ArgStringList CmdArgs; + + const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); + + // Add the "effective" target triple. + CmdArgs.push_back("-target"); + CmdArgs.push_back(Args.MakeArgString(Triple.getTriple())); + + assert(JA.getInputs().size() == Inputs.size() && + "Not have inputs for all dependence actions??"); + + // Add offload targets. It is a comma-separated list of offload target + // triples. + SmallString<128> Targets; + Targets += "-offload-targets="; + for (unsigned I = 0; I < Inputs.size(); ++I) { + if (I) + Targets += ','; + + // Get input's Offload Kind and ToolChain. + const auto *OA = cast(JA.getInputs()[I]); + assert(OA->hasSingleDeviceDependence(/*DoNotConsiderHostActions=*/true) && + "Expected one device dependence!"); + const ToolChain *DeviceTC = nullptr; + OA->doOnEachDependence([&DeviceTC](Action *, const ToolChain *TC, + const char *) { DeviceTC = TC; }); + + // And add it to the offload targets. + Targets += DeviceTC->getTriple().normalize(); + } + CmdArgs.push_back(Args.MakeArgString(Targets)); + + // Add the output file name. + assert(Output.isFilename() && "Invalid output."); + CmdArgs.push_back("-o"); + CmdArgs.push_back(Output.getFilename()); + + // Add inputs. + for (const InputInfo &I : Inputs) { + assert(I.isFilename() && "Invalid input."); + CmdArgs.push_back(I.getFilename()); + } + + C.addCommand(std::make_unique( + JA, *this, + Args.MakeArgString(getToolChain().GetProgramPath(getShortName())), + CmdArgs, Inputs)); +} diff --git a/clang/lib/Driver/ToolChains/Clang.h b/clang/lib/Driver/ToolChains/Clang.h index 8b6ac43ebd556..b345c02489d4d 100644 --- a/clang/lib/Driver/ToolChains/Clang.h +++ b/clang/lib/Driver/ToolChains/Clang.h @@ -152,6 +152,20 @@ class LLVM_LIBRARY_VISIBILITY OffloadBundler final : public Tool { const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; + +/// Offload wrapper tool. +class LLVM_LIBRARY_VISIBILITY OffloadWrapper final : public Tool { +public: + OffloadWrapper(const ToolChain &TC) + : Tool("offload wrapper", "clang-offload-wrapper", TC) {} + + bool hasIntegratedCPP() const override { return false; } + void ConstructJob(Compilation &C, const JobAction &JA, + const InputInfo &Output, const InputInfoList &Inputs, + const llvm::opt::ArgList &TCArgs, + const char *LinkingOutput) const override; +}; + } // end namespace tools } // end namespace driver diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp index 47964099bd9c4..159b42a642708 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp @@ -1244,120 +1244,6 @@ void tools::AddRunTimeLibs(const ToolChain &TC, const Driver &D, } } -/// Add OpenMP linker script arguments at the end of the argument list so that -/// the fat binary is built by embedding each of the device images into the -/// host. The linker script also defines a few symbols required by the code -/// generation so that the images can be easily retrieved at runtime by the -/// offloading library. This should be used only in tool chains that support -/// linker scripts. -void tools::AddOpenMPLinkerScript(const ToolChain &TC, Compilation &C, - const InputInfo &Output, - const InputInfoList &Inputs, - const ArgList &Args, ArgStringList &CmdArgs, - const JobAction &JA) { - - // If this is not an OpenMP host toolchain, we don't need to do anything. - if (!JA.isHostOffloading(Action::OFK_OpenMP)) - return; - - // Create temporary linker script. Keep it if save-temps is enabled. - const char *LKS; - SmallString<256> Name = llvm::sys::path::filename(Output.getFilename()); - if (C.getDriver().isSaveTempsEnabled()) { - llvm::sys::path::replace_extension(Name, "lk"); - LKS = C.getArgs().MakeArgString(Name.c_str()); - } else { - llvm::sys::path::replace_extension(Name, ""); - Name = C.getDriver().GetTemporaryPath(Name, "lk"); - LKS = C.addTempFile(C.getArgs().MakeArgString(Name.c_str())); - } - - // Add linker script option to the command. - CmdArgs.push_back("-T"); - CmdArgs.push_back(LKS); - - // Create a buffer to write the contents of the linker script. - std::string LksBuffer; - llvm::raw_string_ostream LksStream(LksBuffer); - - // Get the OpenMP offload tool chains so that we can extract the triple - // associated with each device input. - auto OpenMPToolChains = C.getOffloadToolChains(); - assert(OpenMPToolChains.first != OpenMPToolChains.second && - "No OpenMP toolchains??"); - - // Track the input file name and device triple in order to build the script, - // inserting binaries in the designated sections. - SmallVector, 8> InputBinaryInfo; - - // Add commands to embed target binaries. We ensure that each section and - // image is 16-byte aligned. This is not mandatory, but increases the - // likelihood of data to be aligned with a cache block in several main host - // machines. - LksStream << "/*\n"; - LksStream << " OpenMP Offload Linker Script\n"; - LksStream << " *** Automatically generated by Clang ***\n"; - LksStream << "*/\n"; - LksStream << "TARGET(binary)\n"; - auto DTC = OpenMPToolChains.first; - for (auto &II : Inputs) { - const Action *A = II.getAction(); - // Is this a device linking action? - if (A && isa(A) && - A->isDeviceOffloading(Action::OFK_OpenMP)) { - assert(DTC != OpenMPToolChains.second && - "More device inputs than device toolchains??"); - InputBinaryInfo.push_back(std::make_pair( - DTC->second->getTriple().normalize(), II.getFilename())); - ++DTC; - LksStream << "INPUT(" << II.getFilename() << ")\n"; - } - } - - assert(DTC == OpenMPToolChains.second && - "Less device inputs than device toolchains??"); - - LksStream << "SECTIONS\n"; - LksStream << "{\n"; - - // Put each target binary into a separate section. - for (const auto &BI : InputBinaryInfo) { - LksStream << " .omp_offloading." << BI.first << " :\n"; - LksStream << " ALIGN(0x10)\n"; - LksStream << " {\n"; - LksStream << " PROVIDE_HIDDEN(.omp_offloading.img_start." << BI.first - << " = .);\n"; - LksStream << " " << BI.second << "\n"; - LksStream << " PROVIDE_HIDDEN(.omp_offloading.img_end." << BI.first - << " = .);\n"; - LksStream << " }\n"; - } - - LksStream << "}\n"; - LksStream << "INSERT BEFORE .data\n"; - LksStream.flush(); - - // Dump the contents of the linker script if the user requested that. We - // support this option to enable testing of behavior with -###. - if (C.getArgs().hasArg(options::OPT_fopenmp_dump_offload_linker_script)) - llvm::errs() << LksBuffer; - - // If this is a dry run, do not create the linker script file. - if (C.getArgs().hasArg(options::OPT__HASH_HASH_HASH)) - return; - - // Open script file and write the contents. - std::error_code EC; - llvm::raw_fd_ostream Lksf(LKS, EC, llvm::sys::fs::OF_None); - - if (EC) { - C.getDriver().Diag(clang::diag::err_unable_to_make_temp) << EC.message(); - return; - } - - Lksf << LksBuffer; -} - /// Add HIP linker script arguments at the end of the argument list so that /// the fat binary is built by embedding the device images into the host. The /// linker script also defines a symbol required by the code generation so that diff --git a/clang/lib/Driver/ToolChains/CommonArgs.h b/clang/lib/Driver/ToolChains/CommonArgs.h index 1aff07ab8fe56..63359d77363bf 100644 --- a/clang/lib/Driver/ToolChains/CommonArgs.h +++ b/clang/lib/Driver/ToolChains/CommonArgs.h @@ -45,13 +45,6 @@ void AddRunTimeLibs(const ToolChain &TC, const Driver &D, llvm::opt::ArgStringList &CmdArgs, const llvm::opt::ArgList &Args); -void AddOpenMPLinkerScript(const ToolChain &TC, Compilation &C, - const InputInfo &Output, - const InputInfoList &Inputs, - const llvm::opt::ArgList &Args, - llvm::opt::ArgStringList &CmdArgs, - const JobAction &JA); - void AddHIPLinkerScript(const ToolChain &TC, Compilation &C, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp index 4cada743b8859..8c704a3078adc 100644 --- a/clang/lib/Driver/ToolChains/Cuda.cpp +++ b/clang/lib/Driver/ToolChains/Cuda.cpp @@ -563,8 +563,6 @@ void NVPTX::OpenMPLinker::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(CubinF); } - AddOpenMPLinkerScript(getToolChain(), C, Output, Inputs, Args, CmdArgs, JA); - const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("nvlink")); C.addCommand(std::make_unique(JA, *this, Exec, CmdArgs, Inputs)); diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp index c7abe5c69a1df..c302a31cd2e10 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp @@ -499,7 +499,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, P = ToolChain.GetFilePath(crtbegin); } CmdArgs.push_back(Args.MakeArgString(P)); - } + } // Add crtfastmath.o if available and fast math is enabled. ToolChain.AddFastMathRuntimeIfAvailable(Args, CmdArgs); @@ -623,9 +623,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, } } - // Add OpenMP offloading linker script args if required. - AddOpenMPLinkerScript(getToolChain(), C, Output, Inputs, Args, CmdArgs, JA); - // Add HIP offloading linker script args if required. AddHIPLinkerScript(getToolChain(), C, Output, Inputs, Args, CmdArgs, JA, *this); diff --git a/clang/test/Driver/clang-offload-wrapper.c b/clang/test/Driver/clang-offload-wrapper.c new file mode 100644 index 0000000000000..542930bc3c558 --- /dev/null +++ b/clang/test/Driver/clang-offload-wrapper.c @@ -0,0 +1,29 @@ +// REQUIRES: x86-registered-target + +// +// Check help message. +// +// RUN: clang-offload-wrapper --help | FileCheck %s --check-prefix CHECK-HELP +// CHECK-HELP: {{.*}}OVERVIEW: A tool to create a wrapper bitcode for offload target binaries. Takes offload +// CHECK-HELP: {{.*}}target binaries as input and produces bitcode file containing target binaries packaged +// CHECK-HELP: {{.*}}as data. +// CHECK-HELP: {{.*}}USAGE: clang-offload-wrapper [options] +// CHECK-HELP: {{.*}} -o= - Output filename +// CHECK-HELP: {{.*}} --offload-targets= - Comma-separated list of device target triples +// CHECK-HELP: {{.*}} --target= - Target triple for the output module + +// +// Generate a file to wrap. +// +// RUN: echo 'Content of device file' > %t.tgt + +// +// Check bitcode produced by the wrapper tool. +// +// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -offload-targets=powerpc64le-ibm-linux-gnu -o %t.wrapper.bc %t.tgt +// RUN: llvm-dis %t.wrapper.bc -o - | FileCheck %s --check-prefix CHECK-IR + +// CHECK-IR: target triple = "x86_64-pc-linux-gnu" + +// CHECK-IR: @.omp_offloading.img_start.powerpc64le-ibm-linux-gnu = hidden unnamed_addr constant [{{[0-9]+}} x i8] c"Content of device file{{.+}}", section ".omp_offloading.powerpc64le-ibm-linux-gnu" +// CHECK-IR: @.omp_offloading.img_end.powerpc64le-ibm-linux-gnu = hidden unnamed_addr constant [0 x i8] zeroinitializer, section ".omp_offloading.powerpc64le-ibm-linux-gnu" diff --git a/clang/test/Driver/openmp-offload-gpu.c b/clang/test/Driver/openmp-offload-gpu.c index 3d2ac4525f6c6..dc4dbd1f37c97 100644 --- a/clang/test/Driver/openmp-offload-gpu.c +++ b/clang/test/Driver/openmp-offload-gpu.c @@ -55,7 +55,7 @@ // RUN: -fopenmp-targets=nvptx64-nvidia-cuda %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-CUBIN-NVLINK %s -// CHK-CUBIN-NVLINK: clang{{.*}}" "-o" "[[PTX:.*\.s]]" +// CHK-CUBIN-NVLINK: clang{{.*}}" {{.*}}"-fopenmp-is-device" {{.*}}"-o" "[[PTX:.*\.s]]" // CHK-CUBIN-NVLINK-NEXT: ptxas{{.*}}" "--output-file" "[[CUBIN:.*\.cubin]]" {{.*}}"[[PTX]]" // CHK-CUBIN-NVLINK-NEXT: nvlink{{.*}}" {{.*}}"[[CUBIN]]" diff --git a/clang/test/Driver/openmp-offload.c b/clang/test/Driver/openmp-offload.c index 0ba3c4326310b..292818b84fa1c 100644 --- a/clang/test/Driver/openmp-offload.c +++ b/clang/test/Driver/openmp-offload.c @@ -106,15 +106,18 @@ // CHK-PHASES: 2: compiler, {1}, ir, (host-openmp) // CHK-PHASES: 3: backend, {2}, assembler, (host-openmp) // CHK-PHASES: 4: assembler, {3}, object, (host-openmp) -// CHK-PHASES: 5: linker, {4}, image, (host-openmp) -// CHK-PHASES: 6: input, "[[INPUT]]", c, (device-openmp) -// CHK-PHASES: 7: preprocessor, {6}, cpp-output, (device-openmp) -// CHK-PHASES: 8: compiler, {7}, ir, (device-openmp) -// CHK-PHASES: 9: offload, "host-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-openmp (x86_64-pc-linux-gnu)" {8}, ir -// CHK-PHASES: 10: backend, {9}, assembler, (device-openmp) -// CHK-PHASES: 11: assembler, {10}, object, (device-openmp) -// CHK-PHASES: 12: linker, {11}, image, (device-openmp) -// CHK-PHASES: 13: offload, "host-openmp (powerpc64le-ibm-linux-gnu)" {5}, "device-openmp (x86_64-pc-linux-gnu)" {12}, image +// CHK-PHASES: 5: input, "[[INPUT]]", c, (device-openmp) +// CHK-PHASES: 6: preprocessor, {5}, cpp-output, (device-openmp) +// CHK-PHASES: 7: compiler, {6}, ir, (device-openmp) +// CHK-PHASES: 8: offload, "host-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-openmp (x86_64-pc-linux-gnu)" {7}, ir +// CHK-PHASES: 9: backend, {8}, assembler, (device-openmp) +// CHK-PHASES: 10: assembler, {9}, object, (device-openmp) +// CHK-PHASES: 11: linker, {10}, image, (device-openmp) +// CHK-PHASES: 12: offload, "device-openmp (x86_64-pc-linux-gnu)" {11}, image +// CHK-PHASES: 13: clang-offload-wrapper, {12}, ir, (host-openmp) +// CHK-PHASES: 14: backend, {13}, assembler, (host-openmp) +// CHK-PHASES: 15: assembler, {14}, object, (host-openmp) +// CHK-PHASES: 16: linker, {4, 15}, image, (host-openmp) /// ########################################################################### @@ -128,15 +131,15 @@ // CHK-PHASES-LIB: 3: compiler, {2}, ir, (host-openmp) // CHK-PHASES-LIB: 4: backend, {3}, assembler, (host-openmp) // CHK-PHASES-LIB: 5: assembler, {4}, object, (host-openmp) -// CHK-PHASES-LIB: 6: linker, {0, 5}, image, (host-openmp) -// CHK-PHASES-LIB: 7: input, "somelib", object, (device-openmp) -// CHK-PHASES-LIB: 8: input, "[[INPUT]]", c, (device-openmp) -// CHK-PHASES-LIB: 9: preprocessor, {8}, cpp-output, (device-openmp) -// CHK-PHASES-LIB: 10: compiler, {9}, ir, (device-openmp) -// CHK-PHASES-LIB: 11: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {10}, ir -// CHK-PHASES-LIB: 12: backend, {11}, assembler, (device-openmp) -// CHK-PHASES-LIB: 13: assembler, {12}, object, (device-openmp) -// CHK-PHASES-LIB: 14: linker, {7, 13}, image, (device-openmp) +// CHK-PHASES-LIB: 6: input, "somelib", object, (device-openmp) +// CHK-PHASES-LIB: 7: input, "[[INPUT]]", c, (device-openmp) +// CHK-PHASES-LIB: 8: preprocessor, {7}, cpp-output, (device-openmp) +// CHK-PHASES-LIB: 9: compiler, {8}, ir, (device-openmp) +// CHK-PHASES-LIB: 10: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {9}, ir +// CHK-PHASES-LIB: 11: backend, {10}, assembler, (device-openmp) +// CHK-PHASES-LIB: 12: assembler, {11}, object, (device-openmp) +// CHK-PHASES-LIB: 13: linker, {6, 12}, image, (device-openmp) +// CHK-PHASES-LIB: 14: offload, "device-openmp (x86_64-pc-linux-gnu)" {13}, image // CHK-PHASES-LIB: 15: input, "somelib", object, (device-openmp) // CHK-PHASES-LIB: 16: input, "[[INPUT]]", c, (device-openmp) // CHK-PHASES-LIB: 17: preprocessor, {16}, cpp-output, (device-openmp) @@ -145,8 +148,11 @@ // CHK-PHASES-LIB: 20: backend, {19}, assembler, (device-openmp) // CHK-PHASES-LIB: 21: assembler, {20}, object, (device-openmp) // CHK-PHASES-LIB: 22: linker, {15, 21}, image, (device-openmp) -// CHK-PHASES-LIB: 23: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {6}, "device-openmp (x86_64-pc-linux-gnu)" {14}, "device-openmp (powerpc64-ibm-linux-gnu)" {22}, image - +// CHK-PHASES-LIB: 23: offload, "device-openmp (powerpc64-ibm-linux-gnu)" {22}, image +// CHK-PHASES-LIB: 24: clang-offload-wrapper, {14, 23}, ir, (host-openmp) +// CHK-PHASES-LIB: 25: backend, {24}, assembler, (host-openmp) +// CHK-PHASES-LIB: 26: assembler, {25}, object, (host-openmp) +// CHK-PHASES-LIB: 27: linker, {0, 5, 26}, image, (host-openmp) /// ########################################################################### @@ -165,21 +171,21 @@ // CHK-PHASES-FILES: 8: compiler, {7}, ir, (host-openmp) // CHK-PHASES-FILES: 9: backend, {8}, assembler, (host-openmp) // CHK-PHASES-FILES: 10: assembler, {9}, object, (host-openmp) -// CHK-PHASES-FILES: 11: linker, {0, 5, 10}, image, (host-openmp) -// CHK-PHASES-FILES: 12: input, "somelib", object, (device-openmp) -// CHK-PHASES-FILES: 13: input, "[[INPUT1]]", c, (device-openmp) -// CHK-PHASES-FILES: 14: preprocessor, {13}, cpp-output, (device-openmp) -// CHK-PHASES-FILES: 15: compiler, {14}, ir, (device-openmp) -// CHK-PHASES-FILES: 16: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {15}, ir -// CHK-PHASES-FILES: 17: backend, {16}, assembler, (device-openmp) -// CHK-PHASES-FILES: 18: assembler, {17}, object, (device-openmp) -// CHK-PHASES-FILES: 19: input, "[[INPUT2]]", c, (device-openmp) -// CHK-PHASES-FILES: 20: preprocessor, {19}, cpp-output, (device-openmp) -// CHK-PHASES-FILES: 21: compiler, {20}, ir, (device-openmp) -// CHK-PHASES-FILES: 22: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {8}, "device-openmp (x86_64-pc-linux-gnu)" {21}, ir -// CHK-PHASES-FILES: 23: backend, {22}, assembler, (device-openmp) -// CHK-PHASES-FILES: 24: assembler, {23}, object, (device-openmp) -// CHK-PHASES-FILES: 25: linker, {12, 18, 24}, image, (device-openmp) +// CHK-PHASES-FILES: 11: input, "somelib", object, (device-openmp) +// CHK-PHASES-FILES: 12: input, "[[INPUT1]]", c, (device-openmp) +// CHK-PHASES-FILES: 13: preprocessor, {12}, cpp-output, (device-openmp) +// CHK-PHASES-FILES: 14: compiler, {13}, ir, (device-openmp) +// CHK-PHASES-FILES: 15: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {14}, ir +// CHK-PHASES-FILES: 16: backend, {15}, assembler, (device-openmp) +// CHK-PHASES-FILES: 17: assembler, {16}, object, (device-openmp) +// CHK-PHASES-FILES: 18: input, "[[INPUT2]]", c, (device-openmp) +// CHK-PHASES-FILES: 19: preprocessor, {18}, cpp-output, (device-openmp) +// CHK-PHASES-FILES: 20: compiler, {19}, ir, (device-openmp) +// CHK-PHASES-FILES: 21: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {8}, "device-openmp (x86_64-pc-linux-gnu)" {20}, ir +// CHK-PHASES-FILES: 22: backend, {21}, assembler, (device-openmp) +// CHK-PHASES-FILES: 23: assembler, {22}, object, (device-openmp) +// CHK-PHASES-FILES: 24: linker, {11, 17, 23}, image, (device-openmp) +// CHK-PHASES-FILES: 25: offload, "device-openmp (x86_64-pc-linux-gnu)" {24}, image // CHK-PHASES-FILES: 26: input, "somelib", object, (device-openmp) // CHK-PHASES-FILES: 27: input, "[[INPUT1]]", c, (device-openmp) // CHK-PHASES-FILES: 28: preprocessor, {27}, cpp-output, (device-openmp) @@ -194,7 +200,11 @@ // CHK-PHASES-FILES: 37: backend, {36}, assembler, (device-openmp) // CHK-PHASES-FILES: 38: assembler, {37}, object, (device-openmp) // CHK-PHASES-FILES: 39: linker, {26, 32, 38}, image, (device-openmp) -// CHK-PHASES-FILES: 40: offload, "host-openmp (powerpc64-ibm-linux-gnu)" {11}, "device-openmp (x86_64-pc-linux-gnu)" {25}, "device-openmp (powerpc64-ibm-linux-gnu)" {39}, image +// CHK-PHASES-FILES: 40: offload, "device-openmp (powerpc64-ibm-linux-gnu)" {39}, image +// CHK-PHASES-FILES: 41: clang-offload-wrapper, {25, 40}, ir, (host-openmp) +// CHK-PHASES-FILES: 42: backend, {41}, assembler, (host-openmp) +// CHK-PHASES-FILES: 43: assembler, {42}, object, (host-openmp) +// CHK-PHASES-FILES: 44: linker, {0, 5, 10, 43}, image, (host-openmp) /// ########################################################################### @@ -216,15 +226,18 @@ // CHK-PHASES-WITH-CUDA: 11: offload, "host-cuda-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {10}, ir // CHK-PHASES-WITH-CUDA: 12: backend, {11}, assembler, (host-cuda-openmp) // CHK-PHASES-WITH-CUDA: 13: assembler, {12}, object, (host-cuda-openmp) -// CHK-PHASES-WITH-CUDA: 14: linker, {13}, image, (host-cuda-openmp) -// CHK-PHASES-WITH-CUDA: 15: input, "[[INPUT]]", cuda, (device-openmp) -// CHK-PHASES-WITH-CUDA: 16: preprocessor, {15}, cuda-cpp-output, (device-openmp) -// CHK-PHASES-WITH-CUDA: 17: compiler, {16}, ir, (device-openmp) -// CHK-PHASES-WITH-CUDA: 18: offload, "host-cuda-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-openmp (nvptx64-nvidia-cuda)" {17}, ir -// CHK-PHASES-WITH-CUDA: 19: backend, {18}, assembler, (device-openmp) -// CHK-PHASES-WITH-CUDA: 20: assembler, {19}, object, (device-openmp) -// CHK-PHASES-WITH-CUDA: 21: linker, {20}, image, (device-openmp) -// CHK-PHASES-WITH-CUDA: 22: offload, "host-cuda-openmp (powerpc64le-ibm-linux-gnu)" {14}, "device-openmp (nvptx64-nvidia-cuda)" {21}, image +// CHK-PHASES-WITH-CUDA: 14: input, "[[INPUT]]", cuda, (device-openmp) +// CHK-PHASES-WITH-CUDA: 15: preprocessor, {14}, cuda-cpp-output, (device-openmp) +// CHK-PHASES-WITH-CUDA: 16: compiler, {15}, ir, (device-openmp) +// CHK-PHASES-WITH-CUDA: 17: offload, "host-cuda-openmp (powerpc64le-ibm-linux-gnu)" {2}, "device-openmp (nvptx64-nvidia-cuda)" {16}, ir +// CHK-PHASES-WITH-CUDA: 18: backend, {17}, assembler, (device-openmp) +// CHK-PHASES-WITH-CUDA: 19: assembler, {18}, object, (device-openmp) +// CHK-PHASES-WITH-CUDA: 20: linker, {19}, image, (device-openmp) +// CHK-PHASES-WITH-CUDA: 21: offload, "device-openmp (nvptx64-nvidia-cuda)" {20}, image +// CHK-PHASES-WITH-CUDA: 22: clang-offload-wrapper, {21}, ir, (host-cuda-openmp) +// CHK-PHASES-WITH-CUDA: 23: backend, {22}, assembler, (host-cuda-openmp) +// CHK-PHASES-WITH-CUDA: 24: assembler, {23}, object, (host-cuda-openmp) +// CHK-PHASES-WITH-CUDA: 25: linker, {13, 24}, image, (host-cuda-openmp) /// ########################################################################### @@ -237,65 +250,31 @@ /// -fopenmp-host-ir-file-path: specifies the host IR file that can be loaded by /// the target code generation to gather information about which declaration /// really need to be emitted. -/// We use -fopenmp-dump-offload-linker-script to dump the linker script and -/// check its contents. /// -// RUN: %clang -### -fopenmp=libomp -o %t.out -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -fopenmp-dump-offload-linker-script -no-canonical-prefixes 2>&1 \ -// RUN: | FileCheck -check-prefix=CHK-COMMANDS -check-prefix=CHK-LKS -check-prefix=CHK-LKS-REG %s -// RUN: %clang -### -fopenmp=libomp -o %t.out -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -save-temps -fopenmp-dump-offload-linker-script -no-canonical-prefixes 2>&1 \ -// RUN: | FileCheck -check-prefix=CHK-COMMANDS-ST -check-prefix=CHK-LKS -check-prefix=CHK-LKS-ST %s - -// Make sure we are not dumping the script unless the user requested it. // RUN: %clang -### -fopenmp=libomp -o %t.out -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -no-canonical-prefixes 2>&1 \ -// RUN: | FileCheck -check-prefix=CHK-LKS-NODUMP %s +// RUN: | FileCheck -check-prefix=CHK-COMMANDS %s // RUN: %clang -### -fopenmp=libomp -o %t.out -target powerpc64le-linux -fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu %s -save-temps -no-canonical-prefixes 2>&1 \ -// RUN: | FileCheck -check-prefix=CHK-LKS-NODUMP %s - -// -// Check the linker script contains what we expect. -// -// CHK-LKS: /* -// CHK-LKS: OpenMP Offload Linker Script -// CHK-LKS: *** Automatically generated by Clang *** -// CHK-LKS-NODUMP-NOT: OpenMP Offload Linker Script. -// CHK-LKS: */ -// CHK-LKS: TARGET(binary) -// CHK-LKS-REG: INPUT([[T1BIN:.+\.out]]) -// CHK-LKS-REG: INPUT([[T2BIN:.+\.out]]) -// CHK-LKS-ST: INPUT([[T1BIN:.+\.out-openmp-powerpc64le-ibm-linux-gnu]]) -// CHK-LKS-ST: INPUT([[T2BIN:.+\.out-openmp-x86_64-pc-linux-gnu]]) -// CHK-LKS: SECTIONS -// CHK-LKS: { -// CHK-LKS: .omp_offloading.powerpc64le-ibm-linux-gnu : -// CHK-LKS: ALIGN(0x10) -// CHK-LKS: { -// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.img_start.powerpc64le-ibm-linux-gnu = .); -// CHK-LKS: [[T1BIN]] -// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.img_end.powerpc64le-ibm-linux-gnu = .); -// CHK-LKS: } -// CHK-LKS: .omp_offloading.x86_64-pc-linux-gnu : -// CHK-LKS: ALIGN(0x10) -// CHK-LKS: { -// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.img_start.x86_64-pc-linux-gnu = .); -// CHK-LKS: [[T2BIN]] -// CHK-LKS: PROVIDE_HIDDEN(.omp_offloading.img_end.x86_64-pc-linux-gnu = .); -// CHK-LKS: } -// CHK-LKS: } -// CHK-LKS: INSERT BEFORE .data +// RUN: | FileCheck -check-prefix=CHK-COMMANDS-ST %s // -// Generate host BC file. +// Generate host BC file and host object. // // CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-llvm-bc" // CHK-COMMANDS-SAME: "-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" // CHK-COMMANDS-SAME: "-o" " // CHK-COMMANDS-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "c" " // CHK-COMMANDS-SAME: [[INPUT:[^\\/]+\.c]]" +// CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]" // CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-E" {{.*}}"-fopenmp" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[HOSTPP:[^\\/]+\.i]]" "-x" "c" " // CHK-COMMANDS-ST-SAME: [[INPUT:[^\\/]+\.c]]" // CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" {{.*}}"-o" " // CHK-COMMANDS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-COMMANDS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]" +// CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" " +// CHK-COMMANDS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]" // // Compile for the powerpc device. @@ -335,21 +314,26 @@ // CHK-COMMANDS-ST-SAME: [[T2BIN:[^\\/]+\.out-openmp-x86_64-pc-linux-gnu]]" {{.*}}"{{.*}}[[T2OBJ]]" // -// Generate host object from the BC file and link using the linker script. +// Create wrapper BC file and wrapper object. // +// CHK-COMMANDS: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" " +// CHK-COMMANDS-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]" // CHK-COMMANDS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " -// CHK-COMMANDS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]" -// CHK-COMMANDS: ld{{(\.exe)?}}" {{.*}}"-o" " -// CHK-COMMANDS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"-lomptarget" {{.*}}"-T" " -// CHK-COMMANDS-SAME: [[HOSTLK:[^\\/]+\.lk]]" +// CHK-COMMANDS-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]" +// CHK-COMMANDS-ST: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" " +// CHK-COMMANDS-ST-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]" // CHK-COMMANDS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-S" {{.*}}"-fopenmp" {{.*}}"-o" " -// CHK-COMMANDS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]" +// CHK-COMMANDS-ST-SAME: [[WRAPPERASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]" // CHK-COMMANDS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" " -// CHK-COMMANDS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]" -// CHK-COMMANDS-ST: ld{{(\.exe)?}}" {{.*}}"-o" " -// CHK-COMMANDS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"-lomptarget" {{.*}}"-T" " -// CHK-COMMANDS-ST-SAME: [[HOSTLK:[^\\/]+\.lk]]" +// CHK-COMMANDS-ST-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "{{.*}}[[WRAPPERASM]]" +// +// Link host binary. +// +// CHK-COMMANDS: ld{{(\.exe)?}}" {{.*}}"-o" " +// CHK-COMMANDS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]" {{.*}}"-lomptarget" +// CHK-COMMANDS-ST: ld{{(\.exe)?}}" {{.*}}"-o" " +// CHK-COMMANDS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]" {{.*}}"-lomptarget" /// ########################################################################### @@ -391,20 +375,24 @@ // CHK-UBACTIONS: 3: compiler, {2}, ir, (host-openmp) // CHK-UBACTIONS: 4: backend, {3}, assembler, (host-openmp) // CHK-UBACTIONS: 5: assembler, {4}, object, (host-openmp) -// CHK-UBACTIONS: 6: linker, {0, 5}, image, (host-openmp) -// CHK-UBACTIONS: 7: input, "somelib", object, (device-openmp) -// CHK-UBACTIONS: 8: compiler, {2}, ir, (device-openmp) -// CHK-UBACTIONS: 9: offload, "host-openmp (powerpc64le-unknown-linux)" {3}, "device-openmp (powerpc64le-ibm-linux-gnu)" {8}, ir -// CHK-UBACTIONS: 10: backend, {9}, assembler, (device-openmp) -// CHK-UBACTIONS: 11: assembler, {10}, object, (device-openmp) -// CHK-UBACTIONS: 12: linker, {7, 11}, image, (device-openmp) +// CHK-UBACTIONS: 6: input, "somelib", object, (device-openmp) +// CHK-UBACTIONS: 7: compiler, {2}, ir, (device-openmp) +// CHK-UBACTIONS: 8: offload, "host-openmp (powerpc64le-unknown-linux)" {3}, "device-openmp (powerpc64le-ibm-linux-gnu)" {7}, ir +// CHK-UBACTIONS: 9: backend, {8}, assembler, (device-openmp) +// CHK-UBACTIONS: 10: assembler, {9}, object, (device-openmp) +// CHK-UBACTIONS: 11: linker, {6, 10}, image, (device-openmp) +// CHK-UBACTIONS: 12: offload, "device-openmp (powerpc64le-ibm-linux-gnu)" {11}, image // CHK-UBACTIONS: 13: input, "somelib", object, (device-openmp) // CHK-UBACTIONS: 14: compiler, {2}, ir, (device-openmp) // CHK-UBACTIONS: 15: offload, "host-openmp (powerpc64le-unknown-linux)" {3}, "device-openmp (x86_64-pc-linux-gnu)" {14}, ir // CHK-UBACTIONS: 16: backend, {15}, assembler, (device-openmp) // CHK-UBACTIONS: 17: assembler, {16}, object, (device-openmp) // CHK-UBACTIONS: 18: linker, {13, 17}, image, (device-openmp) -// CHK-UBACTIONS: 19: offload, "host-openmp (powerpc64le-unknown-linux)" {6}, "device-openmp (powerpc64le-ibm-linux-gnu)" {12}, "device-openmp (x86_64-pc-linux-gnu)" {18}, image +// CHK-UBACTIONS: 19: offload, "device-openmp (x86_64-pc-linux-gnu)" {18}, image +// CHK-UBACTIONS: 20: clang-offload-wrapper, {12, 19}, ir, (host-openmp) +// CHK-UBACTIONS: 21: backend, {20}, assembler, (host-openmp) +// CHK-UBACTIONS: 22: assembler, {21}, object, (host-openmp) +// CHK-UBACTIONS: 23: linker, {0, 5, 22}, image, (host-openmp) /// ########################################################################### @@ -507,6 +495,8 @@ // CHK-UBJOBS-SAME: [[T2PP:[^\\/]+\.i]]" "-unbundle" // CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" {{.*}}"-o" " // CHK-UBJOBS-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" +// CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]" // CHK-UBJOBS-ST: clang-offload-bundler{{.*}}" "-type=i" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= // CHK-UBJOBS-ST-SAME: [[INPUT:[^\\/]+\.i]]" "-outputs= // CHK-UBJOBS-ST-SAME: [[HOSTPP:[^\\/,]+\.i]], @@ -514,6 +504,10 @@ // CHK-UBJOBS-ST-SAME: [[T2PP:[^\\/,]+\.i]]" "-unbundle" // CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-llvm-bc" {{.*}}"-fopenmp" {{.*}}"-fopenmp-targets=powerpc64le-ibm-linux-gnu,x86_64-pc-linux-gnu" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[HOSTBC:[^\\/]+\.bc]]" "-x" "cpp-output" "{{.*}}[[HOSTPP]]" +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]" +// CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" " +// CHK-UBJOBS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]" // Create target 1 object. // CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-ibm-linux-gnu" "-aux-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-fopenmp-is-device" "-fopenmp-host-ir-file-path" "{{.*}}[[HOSTBC]]" {{.*}}"-o" " @@ -543,19 +537,23 @@ // CHK-UBJOBS-ST: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS-ST-SAME: [[T2BIN:[^\\/]+\.out-openmp-x86_64-pc-linux-gnu]]" {{.*}}"{{.*}}[[T2OBJ]]" -// Create binary. +// Create wrapper BC file and wrapper object. +// CHK-UBJOBS: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" " +// CHK-UBJOBS-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]" // CHK-UBJOBS: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " -// CHK-UBJOBS-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[HOSTBC]]" -// CHK-UBJOBS: ld{{(\.exe)?}}" {{.*}}"-o" " -// CHK-UBJOBS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" " -// CHK-UBJOBS-SAME: [[LKS:[^\\/]+\.lk]]" +// CHK-UBJOBS-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]" +// CHK-UBJOBS-ST: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" " +// CHK-UBJOBS-ST-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]" // CHK-UBJOBS-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" {{.*}}"-S" {{.*}}"-fopenmp" {{.*}}"-o" " -// CHK-UBJOBS-ST-SAME: [[HOSTASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[HOSTBC]]" +// CHK-UBJOBS-ST-SAME: [[WRAPPERASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]" // CHK-UBJOBS-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" " -// CHK-UBJOBS-ST-SAME: [[HOSTOBJ:[^\\/]+\.o]]" "{{.*}}[[HOSTASM]]" +// CHK-UBJOBS-ST-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "{{.*}}[[WRAPPERASM]]" + +// Create binary. +// CHK-UBJOBS: ld{{(\.exe)?}}" {{.*}}"-o" " +// CHK-UBJOBS-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]" // CHK-UBJOBS-ST: ld{{(\.exe)?}}" {{.*}}"-o" " -// CHK-UBJOBS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" " -// CHK-UBJOBS-ST-SAME: [[LKS:[^\\/]+\.lk]]" +// CHK-UBJOBS-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]" // Unbundle object file. // CHK-UBJOBS2: clang-offload-bundler{{.*}}" "-type=o" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= @@ -567,9 +565,12 @@ // CHK-UBJOBS2-SAME: [[T1BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T1OBJ]]" // CHK-UBJOBS2: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS2-SAME: [[T2BIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[T2OBJ]]" +// CHK-UBJOBS2: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" " +// CHK-UBJOBS2-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]" +// CHK-UBJOBS2: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-emit-obj" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS2-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]" // CHK-UBJOBS2: ld{{(\.exe)?}}" {{.*}}"-o" " -// CHK-UBJOBS2-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" " -// CHK-UBJOBS2-SAME: [[LKS:[^\\/]+\.lk]]" +// CHK-UBJOBS2-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]" // CHK-UBJOBS2-ST-NOT: clang-offload-bundler{{.*}}in.so // CHK-UBJOBS2-ST: clang-offload-bundler{{.*}}" "-type=o" "-targets=host-powerpc64le-unknown-linux,openmp-powerpc64le-ibm-linux-gnu,openmp-x86_64-pc-linux-gnu" "-inputs= // CHK-UBJOBS2-ST-SAME: [[INPUT:[^\\/]+\.o]]" "-outputs= @@ -581,9 +582,14 @@ // CHK-UBJOBS2-ST-SAME: [[T1BIN:[^\\/]+\.out-openmp-powerpc64le-ibm-linux-gnu]]" {{.*}}"{{.*}}[[T1OBJ]]" // CHK-UBJOBS2-ST: ld{{(\.exe)?}}" {{.*}}"-o" " // CHK-UBJOBS2-ST-SAME: [[T2BIN:[^\\/]+\.out-openmp-x86_64-pc-linux-gnu]]" {{.*}}"{{.*}}[[T2OBJ]]" +// CHK-UBJOBS2-ST: clang-offload-wrapper{{(\.exe)?}}" "-target" "powerpc64le-unknown-linux" {{.*}}"-o" " +// CHK-UBJOBS2-ST-SAME: [[WRAPPERBC:[^\\/]+\.bc]]" "{{.*}}[[T1BIN]]" "{{.*}}[[T2BIN]]" +// CHK-UBJOBS2-ST: clang{{.*}}" "-cc1" "-triple" "powerpc64le-unknown-linux" "-S" {{.*}}"-fopenmp" {{.*}}"-o" " +// CHK-UBJOBS2-ST-SAME: [[WRAPPERASM:[^\\/]+\.s]]" "-x" "ir" "{{.*}}[[WRAPPERBC]]" +// CHK-UBJOBS2-ST: clang{{.*}}" "-cc1as" "-triple" "powerpc64le-unknown-linux" "-filetype" "obj" {{.*}}"-o" " +// CHK-UBJOBS2-ST-SAME: [[WRAPPEROBJ:[^\\/]+\.o]]" "{{.*}}[[WRAPPERASM]]" // CHK-UBJOBS2-ST: ld{{(\.exe)?}}" {{.*}}"-o" " -// CHK-UBJOBS2-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" {{.*}}"-T" " -// CHK-UBJOBS2-ST-SAME: [[LKS:[^\\/]+\.lk]]" +// CHK-UBJOBS2-ST-SAME: [[HOSTBIN:[^\\/]+\.out]]" {{.*}}"{{.*}}[[HOSTOBJ]]" "{{.*}}[[WRAPPEROBJ]]" /// ########################################################################### diff --git a/clang/tools/CMakeLists.txt b/clang/tools/CMakeLists.txt index 223f1f74f3f9d..e46c3669a2c2b 100644 --- a/clang/tools/CMakeLists.txt +++ b/clang/tools/CMakeLists.txt @@ -8,6 +8,7 @@ add_clang_subdirectory(clang-format-vs) add_clang_subdirectory(clang-fuzzer) add_clang_subdirectory(clang-import-test) add_clang_subdirectory(clang-offload-bundler) +add_clang_subdirectory(clang-offload-wrapper) add_clang_subdirectory(clang-scan-deps) add_clang_subdirectory(c-index-test) diff --git a/clang/tools/clang-offload-wrapper/CMakeLists.txt b/clang/tools/clang-offload-wrapper/CMakeLists.txt new file mode 100644 index 0000000000000..6f8940f88eabd --- /dev/null +++ b/clang/tools/clang-offload-wrapper/CMakeLists.txt @@ -0,0 +1,23 @@ +set(LLVM_LINK_COMPONENTS BitWriter Core Support TransformUtils) + +if(NOT CLANG_BUILT_STANDALONE) + set(tablegen_deps intrinsics_gen) +endif() + +add_clang_tool(clang-offload-wrapper + ClangOffloadWrapper.cpp + + DEPENDS + ${tablegen_deps} + ) + +set(CLANG_OFFLOAD_WRAPPER_LIB_DEPS + clangBasic + ) + +add_dependencies(clang clang-offload-wrapper) + +clang_target_link_libraries(clang-offload-wrapper + PRIVATE + ${CLANG_OFFLOAD_WRAPPER_LIB_DEPS} + ) diff --git a/clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp b/clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp new file mode 100644 index 0000000000000..e18da35e79b63 --- /dev/null +++ b/clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp @@ -0,0 +1,196 @@ +//===-- clang-offload-wrapper/ClangOffloadWrapper.cpp -----------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// Implementation of the offload wrapper tool. It takes offload target binaries +/// as input and creates wrapper bitcode file containing target binaries +/// packaged as data. +/// +//===----------------------------------------------------------------------===// + +#include "clang/Basic/Version.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/Triple.h" +#include "llvm/Bitcode/BitcodeWriter.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Errc.h" +#include "llvm/Support/Error.h" +#include "llvm/Support/ErrorOr.h" +#include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/Signals.h" +#include "llvm/Support/StringSaver.h" +#include "llvm/Support/ToolOutputFile.h" +#include "llvm/Support/WithColor.h" +#include "llvm/Support/raw_ostream.h" +#include +#include + +using namespace llvm; + +static cl::opt Help("h", cl::desc("Alias for -help"), cl::Hidden); + +// Mark all our options with this category, everything else (except for -version +// and -help) will be hidden. +static cl::OptionCategory + ClangOffloadWrapperCategory("clang-offload-wrapper options"); + +static cl::opt Output("o", cl::Required, + cl::desc("Output filename"), + cl::value_desc("filename"), + cl::cat(ClangOffloadWrapperCategory)); + +static cl::list Inputs(cl::Positional, cl::OneOrMore, + cl::desc(""), + cl::cat(ClangOffloadWrapperCategory)); + +static cl::opt + Target("target", cl::Required, + cl::desc("Target triple for the output module"), + cl::value_desc("triple"), cl::cat(ClangOffloadWrapperCategory)); + +static cl::list + OffloadTargets("offload-targets", cl::CommaSeparated, cl::OneOrMore, + cl::desc("Comma-separated list of device target triples"), + cl::value_desc("triples"), + cl::cat(ClangOffloadWrapperCategory)); + +namespace { + +class BinaryWrapper { +public: + // Binary descriptor. The first field is the a reference to the binary bits, + // and the second is the target triple the binary was built for. + using BinaryDesc = std::pair, StringRef>; + +private: + LLVMContext C; + Module M; + + // Saver for generated strings. + BumpPtrAllocator Alloc; + UniqueStringSaver SS; + +private: + void createImages(ArrayRef Binaries) { + for (const BinaryDesc &Bin : Binaries) { + StringRef SectionName = SS.save(".omp_offloading." + Bin.second); + + auto *DataC = ConstantDataArray::get(C, Bin.first); + auto *ImageB = + new GlobalVariable(M, DataC->getType(), /*isConstant=*/true, + GlobalVariable::ExternalLinkage, DataC, + ".omp_offloading.img_start." + Bin.second); + ImageB->setSection(SectionName); + ImageB->setUnnamedAddr(GlobalValue::UnnamedAddr::Global); + ImageB->setVisibility(llvm::GlobalValue::HiddenVisibility); + + auto *EmptyC = + ConstantAggregateZero::get(ArrayType::get(Type::getInt8Ty(C), 0u)); + auto *ImageE = + new GlobalVariable(M, EmptyC->getType(), /*isConstant=*/true, + GlobalVariable::ExternalLinkage, EmptyC, + ".omp_offloading.img_end." + Bin.second); + ImageE->setSection(SectionName); + ImageE->setUnnamedAddr(GlobalValue::UnnamedAddr::Global); + ImageE->setVisibility(GlobalValue::HiddenVisibility); + } + } + +public: + BinaryWrapper(StringRef Target) : M("offload.wrapper.object", C), SS(Alloc) { + M.setTargetTriple(Target); + } + + const Module &wrapBinaries(ArrayRef Binaries) { + createImages(Binaries); + return M; + } +}; + +} // anonymous namespace + +int main(int argc, const char **argv) { + sys::PrintStackTraceOnErrorSignal(argv[0]); + + cl::HideUnrelatedOptions(ClangOffloadWrapperCategory); + cl::SetVersionPrinter([](raw_ostream &OS) { + OS << clang::getClangToolFullVersion("clang-offload-wrapper") << '\n'; + }); + cl::ParseCommandLineOptions( + argc, argv, + "A tool to create a wrapper bitcode for offload target binaries. Takes " + "offload\ntarget binaries as input and produces bitcode file containing " + "target binaries packaged\nas data.\n"); + + if (Help) { + cl::PrintHelpMessage(); + return 0; + } + + auto reportError = [argv](Error E) { + logAllUnhandledErrors(std::move(E), WithColor::error(errs(), argv[0])); + }; + + if (Triple(Target).getArch() == Triple::UnknownArch) { + reportError(createStringError( + errc::invalid_argument, "'" + Target + "': unsupported target triple")); + return 1; + } + + if (Inputs.size() != OffloadTargets.size()) { + reportError(createStringError( + errc::invalid_argument, + "number of input files and offload targets should match")); + return 1; + } + + // Read device binaries. + SmallVector, 4u> Buffers; + SmallVector Images; + Buffers.reserve(Inputs.size()); + Images.reserve(Inputs.size()); + for (unsigned I = 0; I < Inputs.size(); ++I) { + const std::string &File = Inputs[I]; + ErrorOr> BufOrErr = + MemoryBuffer::getFileOrSTDIN(File); + if (!BufOrErr) { + reportError(createFileError(File, BufOrErr.getError())); + return 1; + } + const std::unique_ptr &Buf = + Buffers.emplace_back(std::move(*BufOrErr)); + Images.emplace_back( + makeArrayRef(Buf->getBufferStart(), Buf->getBufferSize()), + OffloadTargets[I]); + } + + // Create the output file to write the resulting bitcode to. + std::error_code EC; + ToolOutputFile Out(Output, EC, sys::fs::OF_None); + if (EC) { + reportError(createFileError(Output, EC)); + return 1; + } + + // Create a wrapper for device binaries and write its bitcode to the file. + WriteBitcodeToFile(BinaryWrapper(Target).wrapBinaries( + makeArrayRef(Images.data(), Images.size())), + Out.os()); + if (Out.os().has_error()) { + reportError(createFileError(Output, Out.os().error())); + return 1; + } + + // Success. + Out.keep(); + return 0; +}