From f8af5cf600354830d4ccf59732403f0f073eccb9 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 22 Dec 2013 00:04:03 +0000 Subject: Vendor import of llvm release_34 branch r197841 (effectively, 3.4 RC3): https://llvm.org/svn/llvm-project/llvm/branches/release_34@197841 --- test/Bitcode/2012-05-07-SwitchInstRangesSupport.ll | 33 --- test/Bitcode/attributes-3.3.ll | 236 +++++++++++++++++++++ test/Bitcode/attributes-3.3.ll.bc | Bin 0 -> 1592 bytes test/Bitcode/attributes.ll | 39 ++++ test/Bitcode/case-ranges-3.3.ll | 67 ++++++ test/Bitcode/case-ranges-3.3.ll.bc | Bin 0 -> 560 bytes test/Bitcode/drop-debug-info.ll | 26 +++ test/Bitcode/extractelement.ll | 2 +- test/Bitcode/invalid.ll | 7 + test/Bitcode/invalid.ll.bc | Bin 0 -> 332 bytes test/Bitcode/lit.local.cfg | 1 - test/Bitcode/metadata-2.ll | 2 +- test/Bitcode/metadata.ll | 3 +- test/Bitcode/null-type.ll | 5 +- test/Bitcode/select.ll | 9 + test/Bitcode/shuffle.ll | 2 +- test/Bitcode/upgrade-tbaa.ll | 23 ++ 17 files changed, 413 insertions(+), 42 deletions(-) delete mode 100644 test/Bitcode/2012-05-07-SwitchInstRangesSupport.ll create mode 100644 test/Bitcode/attributes-3.3.ll create mode 100644 test/Bitcode/attributes-3.3.ll.bc create mode 100644 test/Bitcode/case-ranges-3.3.ll create mode 100644 test/Bitcode/case-ranges-3.3.ll.bc create mode 100644 test/Bitcode/drop-debug-info.ll create mode 100644 test/Bitcode/invalid.ll create mode 100644 test/Bitcode/invalid.ll.bc delete mode 100644 test/Bitcode/lit.local.cfg create mode 100644 test/Bitcode/select.ll create mode 100644 test/Bitcode/upgrade-tbaa.ll (limited to 'test/Bitcode') diff --git a/test/Bitcode/2012-05-07-SwitchInstRangesSupport.ll b/test/Bitcode/2012-05-07-SwitchInstRangesSupport.ll deleted file mode 100644 index 583b9a853bde..000000000000 --- a/test/Bitcode/2012-05-07-SwitchInstRangesSupport.ll +++ /dev/null @@ -1,33 +0,0 @@ -; RUN: rm -f %t.bc -; RUN: rm -f %t.ll -; RUN: rm -f %t2.bc -; RUN: rm -f %t2.ll -; RUN: llvm-as %s -o %t.bc -; RUN: llvm-dis %t.bc -o - | tail -n +2 > %t.ll -; RUN: llvm-as %t.ll -o %t2.bc -; RUN: llvm-dis %t2.bc -o - | tail -n +2 > %t2.ll -; RUN: llvm-diff %t.ll %t2.ll - -define void @test() { - %mem = alloca i32 - store i32 2, i32* %mem - %c = load i32* %mem - switch i32 %c, label %exit [ - i32 1, label %exit - i32 2, label %exit - ] -exit: - ret void -} -define void @test_wide() { - %mem = alloca i256 - store i256 2, i256* %mem - %c = load i256* %mem - switch i256 %c, label %exit [ - i256 123456789012345678901234567890, label %exit - i256 2, label %exit - ] -exit: - ret void -} - diff --git a/test/Bitcode/attributes-3.3.ll b/test/Bitcode/attributes-3.3.ll new file mode 100644 index 000000000000..cd70ba1a749a --- /dev/null +++ b/test/Bitcode/attributes-3.3.ll @@ -0,0 +1,236 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; attributes-3.3.ll.bc was generated by passing this file to llvm-as-3.3. +; The test checks that LLVM does not silently misread attributes of +; older bitcode files. + +define void @f1(i8 zeroext) +; CHECK: define void @f1(i8 zeroext) +{ + ret void; +} + +define void @f2(i8 signext) +; CHECK: define void @f2(i8 signext) +{ + ret void; +} + +define void @f3() noreturn +; CHECK: define void @f3() #0 +{ + ret void; +} + +define void @f4(i8 inreg) +; CHECK: define void @f4(i8 inreg) +{ + ret void; +} + +define void @f5(i8* sret) +; CHECK: define void @f5(i8* sret) +{ + ret void; +} + +define void @f6() nounwind +; CHECK: define void @f6() #1 +{ + ret void; +} + +define void @f7(i8* noalias) +; CHECK: define void @f7(i8* noalias) +{ + ret void; +} + +define void @f8(i8* byval) +; CHECK: define void @f8(i8* byval) +{ + ret void; +} + +define void @f9(i8* nest) +; CHECK: define void @f9(i8* nest) +{ + ret void; +} + +define void @f10() readnone +; CHECK: define void @f10() #2 +{ + ret void; +} + +define void @f11() readonly +; CHECK: define void @f11() #3 +{ + ret void; +} + +define void @f12() noinline +; CHECK: define void @f12() #4 +{ + ret void; +} + +define void @f13() alwaysinline +; CHECK: define void @f13() #5 +{ + ret void; +} + +define void @f14() optsize +; CHECK: define void @f14() #6 +{ + ret void; +} + +define void @f15() ssp +; CHECK: define void @f15() #7 +{ + ret void; +} + +define void @f16() sspreq +; CHECK: define void @f16() #8 +{ + ret void; +} + +define void @f17(i8 align 4) +; CHECK: define void @f17(i8 align 4) +{ + ret void; +} + +define void @f18(i8* nocapture) +; CHECK: define void @f18(i8* nocapture) +{ + ret void; +} + +define void @f19() noredzone +; CHECK: define void @f19() #9 +{ + ret void; +} + +define void @f20() noimplicitfloat +; CHECK: define void @f20() #10 +{ + ret void; +} + +define void @f21() naked +; CHECK: define void @f21() #11 +{ + ret void; +} + +define void @f22() inlinehint +; CHECK: define void @f22() #12 +{ + ret void; +} + +define void @f23() alignstack(4) +; CHECK: define void @f23() #13 +{ + ret void; +} + +define void @f24() returns_twice +; CHECK: define void @f24() #14 +{ + ret void; +} + +define void @f25() uwtable +; CHECK: define void @f25() #15 +{ + ret void; +} + +define void @f26() nonlazybind +; CHECK: define void @f26() #16 +{ + ret void; +} + +define void @f27() sanitize_address +; CHECK: define void @f27() #17 +{ + ret void; +} +define void @f28() sanitize_thread +; CHECK: define void @f28() #18 +{ + ret void; +} +define void @f29() sanitize_memory +; CHECK: define void @f29() #19 +{ + ret void; +} + +define void @f30() "cpu"="cortex-a8" +; CHECK: define void @f30() #20 +{ + ret void; +} + +define i8 @f31(i8 returned %A) +; CHECK: define i8 @f31(i8 returned %A) +{ + ret i8 %A; +} + +define void @f32() sspstrong +; CHECK: define void @f32() #21 +{ + ret void; +} + +define void @f33() minsize +; CHECK: define void @f33() #22 +{ + ret void; +} + +declare void @nobuiltin() + +define void @f34() +; CHECK: define void @f34() +{ + call void @nobuiltin() nobuiltin +; CHECK: call void @nobuiltin() #23 + ret void; +} + +; CHECK: attributes #0 = { noreturn } +; CHECK: attributes #1 = { nounwind } +; CHECK: attributes #2 = { readnone } +; CHECK: attributes #3 = { readonly } +; CHECK: attributes #4 = { noinline } +; CHECK: attributes #5 = { alwaysinline } +; CHECK: attributes #6 = { optsize } +; CHECK: attributes #7 = { ssp } +; CHECK: attributes #8 = { sspreq } +; CHECK: attributes #9 = { noredzone } +; CHECK: attributes #10 = { noimplicitfloat } +; CHECK: attributes #11 = { naked } +; CHECK: attributes #12 = { inlinehint } +; CHECK: attributes #13 = { alignstack=4 } +; CHECK: attributes #14 = { returns_twice } +; CHECK: attributes #15 = { uwtable } +; CHECK: attributes #16 = { nonlazybind } +; CHECK: attributes #17 = { sanitize_address } +; CHECK: attributes #18 = { sanitize_thread } +; CHECK: attributes #19 = { sanitize_memory } +; CHECK: attributes #20 = { "cpu"="cortex-a8" } +; CHECK: attributes #21 = { sspstrong } +; CHECK: attributes #22 = { minsize } +; CHECK: attributes #23 = { nobuiltin } diff --git a/test/Bitcode/attributes-3.3.ll.bc b/test/Bitcode/attributes-3.3.ll.bc new file mode 100644 index 000000000000..5dd71864ea4f Binary files /dev/null and b/test/Bitcode/attributes-3.3.ll.bc differ diff --git a/test/Bitcode/attributes.ll b/test/Bitcode/attributes.ll index 6c46e94012a5..1789878e9f50 100644 --- a/test/Bitcode/attributes.ll +++ b/test/Bitcode/attributes.ll @@ -179,6 +179,40 @@ define void @f30() "cpu"="cortex-a8" ret void; } +define i8 @f31(i8 returned %A) +; CHECK: define i8 @f31(i8 returned %A) +{ + ret i8 %A; +} + +define void @f32() sspstrong +; CHECK: define void @f32() #21 +{ + ret void; +} + +define void @f33() minsize +; CHECK: define void @f33() #22 +{ + ret void; +} + +declare void @nobuiltin() + +define void @f34() +; CHECK: define void @f34() +{ + call void @nobuiltin() nobuiltin +; CHECK: call void @nobuiltin() #24 + ret void; +} + +define void @f35() optnone noinline +; CHECK: define void @f35() #23 +{ + ret void; +} + ; CHECK: attributes #0 = { noreturn } ; CHECK: attributes #1 = { nounwind } ; CHECK: attributes #2 = { readnone } @@ -200,3 +234,8 @@ define void @f30() "cpu"="cortex-a8" ; CHECK: attributes #18 = { sanitize_thread } ; CHECK: attributes #19 = { sanitize_memory } ; CHECK: attributes #20 = { "cpu"="cortex-a8" } +; CHECK: attributes #21 = { sspstrong } +; CHECK: attributes #22 = { minsize } +; CHECK: attributes #23 = { noinline optnone } +; CHECK: attributes #24 = { nobuiltin } + diff --git a/test/Bitcode/case-ranges-3.3.ll b/test/Bitcode/case-ranges-3.3.ll new file mode 100644 index 000000000000..6e1d0a69a591 --- /dev/null +++ b/test/Bitcode/case-ranges-3.3.ll @@ -0,0 +1,67 @@ +; RUN: llvm-dis < %s.bc| FileCheck %s + +; case-ranges.ll.bc was generated by passing this file to llvm-as from the 3.3 +; release of LLVM. This tests that the bitcode for switches from that release +; can still be read. + +define i32 @foo(i32 %x) nounwind ssp uwtable { +; CHECK: define i32 @foo + %1 = alloca i32, align 4 + %2 = alloca i32, align 4 + store i32 %x, i32* %2, align 4 + %3 = load i32* %2, align 4 + switch i32 %3, label %9 [ +; CHECK: switch i32 %3, label %9 + i32 -3, label %4 +; CHECK-NEXT: i32 -3, label %4 + i32 -2, label %4 +; CHECK-NEXT: i32 -2, label %4 + i32 -1, label %4 +; CHECK-NEXT: i32 -1, label %4 + i32 0, label %4 +; CHECK-NEXT: i32 0, label %4 + i32 1, label %4 +; CHECK-NEXT: i32 1, label %4 + i32 2, label %4 +; CHECK-NEXT: i32 2, label %4 + i32 4, label %5 +; CHECK-NEXT: i32 4, label %5 + i32 5, label %6 +; CHECK-NEXT: i32 5, label %6 + i32 6, label %7 +; CHECK-NEXT: i32 6, label %7 + i32 7, label %8 +; CHECK-NEXT: i32 7, label %8 + ] + +;