xref: /llvm-project/llvm/test/Instrumentation/JustMyCode/jmc-instrument-x86.ll (revision 62b21c6ced918c7fec97b557e3087e3ffdf71494)
1; RUN: opt -jmc-instrumenter -S < %s | FileCheck %s
2; RUN: opt -passes=jmc-instrumenter -S < %s | FileCheck %s
3
4; CHECK: $_JustMyCode_Default = comdat any
5
6; CHECK: @"_A8764FDD_x@c" = internal unnamed_addr global i8 1, section ".msvcjmc", align 1, !dbg !0
7; CHECK: @llvm.used = appending global [1 x ptr] [ptr @_JustMyCode_Default], section "llvm.metadata"
8
9; CHECK: define void @w1() #0 !dbg !10 {
10; CHECK:   call x86_fastcallcc void @__CheckForDebuggerJustMyCode(ptr inreg noundef @"_A8764FDD_x@c")
11; CHECK:   ret void
12; CHECK: }
13
14; CHECK: define void @_JustMyCode_Default(ptr inreg noundef %0) unnamed_addr comdat {
15; CHECK:   ret void
16; CHECK: }
17
18; CHECK: declare x86_fastcallcc void @__CheckForDebuggerJustMyCode(ptr inreg noundef) unnamed_addr
19
20; CHECK: !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
21; CHECK: !1 = distinct !DIGlobalVariable(name: "_A8764FDD_x@c", scope: !2, file: !3, type: !5, isLocal: true, isDefinition: true)
22; CHECK: !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: None)
23; CHECK: !3 = !DIFile(filename: "./b/./../b/x.c", directory: "C:\\\\a\\\\")
24; CHECK: !4 = !{!0}
25; CHECK: !5 = !DIBasicType(name: "unsigned char", size: 8, encoding: DW_ATE_unsigned_char, flags: DIFlagArtificial)
26; CHECK: !6 = !{i32 2, !"CodeView", i32 1}
27; CHECK: !7 = !{i32 2, !"Debug Info Version", i32 3}
28; CHECK: !8 = !{!"clang"}
29; CHECK: !9 = !{!"/alternatename:__CheckForDebuggerJustMyCode=_JustMyCode_Default"}
30; CHECK: !10 = distinct !DISubprogram(name: "w1", scope: !3, file: !3, line: 1, type: !11, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !13)
31; CHECK: !11 = !DISubroutineType(types: !12)
32
33target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32-a:0:32-S32"
34target triple = "i386-pc-windows-msvc"
35
36define void @w1() #0 !dbg !10 {
37  ret void
38}
39
40attributes #0 = { "target-cpu"="pentium4" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
41
42!llvm.dbg.cu = !{!0}
43!llvm.module.flags = !{!7, !8}
44!llvm.ident = !{!9}
45
46!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
47!1 = !DIFile(filename: "./b/./../b/x.c", directory: "C:\\\\a\\\\")
48!7 = !{i32 2, !"CodeView", i32 1}
49!8 = !{i32 2, !"Debug Info Version", i32 3}
50!9 = !{!"clang"}
51!10 = distinct !DISubprogram(name: "w1", scope: !1, file: !1, line: 1, type: !31, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !33)
52!31 = !DISubroutineType(types: !32)
53!32 = !{null}
54!33 = !{}
55