brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 47dbe2b Raw
86 lines · plain
1; Test for the expected CFI codegen in a module with CFI metadata.2; RUN: opt -unified-lto -thinlto-bc -o %t0.o %s3; RUN: llvm-lto --exported-symbol=main -filetype=asm -o - %t0.o | FileCheck %s4 5; CHECK-LABEL: main6 7; CHECK: jbe8; CHECK-NEXT: ud29 10; ModuleID = 'llvm/test/LTO/X86/unified-cfi.ll'11source_filename = "cfi.cpp"12target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"13target triple = "x86_64-scei-ps4"14 15@func = hidden global [3 x i32 ()*] [i32 ()* @_Z1av, i32 ()* @_Z1bv, i32 ()* @_Z1cv], align 1616@.src = private unnamed_addr constant [8 x i8] c"cfi.cpp\00", align 117@anon.9260195284c792ab5c6ef4d97bfcf95d.0 = private unnamed_addr constant { i16, i16, [9 x i8] } { i16 -1, i16 0, [9 x i8] c"'int ()'\00" }18 19; Function Attrs: noinline nounwind optnone sspstrong uwtable20define hidden i32 @_Z1av() #0 !type !3 !type !4 {21entry:22  ret i32 123}24 25; Function Attrs: noinline nounwind optnone sspstrong uwtable26define hidden i32 @_Z1bv() #0 !type !3 !type !4 {27entry:28  ret i32 229}30 31; Function Attrs: noinline nounwind optnone sspstrong uwtable32define hidden i32 @_Z1cv() #0 !type !3 !type !4 {33entry:34  ret i32 335}36 37; Function Attrs: noinline norecurse nounwind optnone sspstrong uwtable38define hidden i32 @main(i32 %argc, i8** %argv) #1 !type !5 !type !6 {39entry:40  %retval = alloca i32, align 441  %argc.addr = alloca i32, align 442  %argv.addr = alloca i8**, align 843  store i32 0, i32* %retval, align 444  store i32 %argc, i32* %argc.addr, align 445  store i8** %argv, i8*** %argv.addr, align 846  %0 = load i32, i32* %argc.addr, align 447  %idxprom = sext i32 %0 to i6448  %arrayidx = getelementptr inbounds [3 x i32 ()*], [3 x i32 ()*]* @func, i64 0, i64 %idxprom49  %1 = load i32 ()*, i32 ()** %arrayidx, align 850  %2 = bitcast i32 ()* %1 to i8*, !nosanitize !751  %3 = call i1 @llvm.type.test(i8* %2, metadata !"_ZTSFivE"), !nosanitize !752  br i1 %3, label %cont, label %trap, !nosanitize !753 54trap:                                             ; preds = %entry55  call void @llvm.trap() #4, !nosanitize !756  unreachable, !nosanitize !757 58cont:                                             ; preds = %entry59  %call = call i32 %1()60  ret i32 %call61}62 63; Function Attrs: nofree nosync nounwind readnone speculatable willreturn64declare i1 @llvm.type.test(i8*, metadata) #265 66; Function Attrs: cold noreturn nounwind67declare void @llvm.trap() #368 69attributes #0 = { noinline nounwind optnone sspstrong uwtable }70attributes #1 = { noinline norecurse nounwind optnone sspstrong uwtable }71attributes #2 = { nofree nosync nounwind readnone speculatable willreturn }72attributes #3 = { cold noreturn nounwind }73attributes #4 = { noreturn nounwind }74 75!llvm.module.flags = !{!0, !1}76!llvm.ident = !{!2}77 78!0 = !{i32 1, !"wchar_size", i32 2}79!1 = !{i32 7, !"PIC Level", i32 2}80!2 = !{!"clang version 7.0.0 (PS4 clang version 99.99.0.1562 432a534f checking)"}81!3 = !{i64 0, !"_ZTSFivE"}82!4 = !{i64 0, !"_ZTSFivE.generalized"}83!5 = !{i64 0, !"_ZTSFiiPPcE"}84!6 = !{i64 0, !"_ZTSFiiPvE.generalized"}85!7 = !{}86