[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-verbose-trap.cpp
blobf492698ccab83d9d0b89d7b8c54e8c13eb530dbd
1 // RUN: %clang_cc1 -triple arm64-apple-ios -std=c++20 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
3 // CHECK-LABEL: define void @_Z2f0v()
4 // CHECK: call void @llvm.trap(), !dbg ![[LOC17:.*]]
6 // CHECK: declare void @llvm.trap() #[[ATTR1:.*]]
8 // CHECK-LABEL: define void @_Z2f1v()
9 // CHECK: call void @llvm.trap(), !dbg ![[LOC23:.*]]
10 // CHECK: call void @llvm.trap(), !dbg ![[LOC25:.*]]
12 // CHECK-LABEL: define void @_Z2f3v()
13 // CHECK: call void @_Z2f2IXadsoKcL_ZL8constCatEEEXadsoS0_L_ZL8constMsgEEEEvv()
15 // CHECK-LABEL: define internal void @_Z2f2IXadsoKcL_ZL8constCatEEEXadsoS0_L_ZL8constMsgEEEEvv
16 // CHECK: call void @llvm.trap(), !dbg ![[LOC36:.*]]
18 // CHECK: attributes #[[ATTR1]] = { cold {{.*}}}
20 // CHECK: ![[FILESCOPE:.*]] = !DIFile(filename: "{{.*}}debug-info-verbose-trap.cpp"
22 char const constCat[] = "category2";
23 char const constMsg[] = "hello";
25 // CHECK: ![[SUBPROG14:.*]] = distinct !DISubprogram(name: "f0", linkageName: "_Z2f0v",
26 // CHECK: ![[LOC17]] = !DILocation(line: 0, scope: ![[SUBPROG18:.*]], inlinedAt: ![[LOC20:.*]])
27 // CHECK: ![[SUBPROG18]] = distinct !DISubprogram(name: "__clang_trap_msg$category1$Argument_must_not_be_null", scope: ![[FILESCOPE]], file: ![[FILESCOPE]], type: !{{.*}}, flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: !{{.*}})
28 // CHECK: ![[LOC20]] = !DILocation(line: [[@LINE+2]], column: 3, scope: ![[SUBPROG14]])
29 void f0() {
30 __builtin_verbose_trap("category1", "Argument_must_not_be_null");
33 // CHECK: ![[SUBPROG22:.*]] = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v",
34 // CHECK: ![[LOC23]] = !DILocation(line: 0, scope: ![[SUBPROG18]], inlinedAt: ![[LOC24:.*]])
35 // CHECK: ![[LOC24]] = !DILocation(line: [[@LINE+5]], column: 3, scope: ![[SUBPROG22]])
36 // CHECK: ![[LOC25]] = !DILocation(line: 0, scope: ![[SUBPROG26:.*]], inlinedAt: ![[LOC27:.*]])
37 // CHECK: ![[SUBPROG26]] = distinct !DISubprogram(name: "__clang_trap_msg$category2$hello", scope: ![[FILESCOPE]], file: ![[FILESCOPE]], type: !{{.*}}, flags: DIFlagArtificial, spFlags: DISPFlagDefinition, unit: !{{.*}})
38 // CHECK: ![[LOC27]] = !DILocation(line: [[@LINE+3]], column: 3, scope: ![[SUBPROG22]])
39 void f1() {
40 __builtin_verbose_trap("category1", "Argument_must_not_be_null");
41 __builtin_verbose_trap("category2", "hello");
44 // CHECK: ![[SUBPROG32:.*]] = distinct !DISubprogram(name: "f2<constCat, constMsg>", linkageName: "_Z2f2IXadsoKcL_ZL8constCatEEEXadsoS0_L_ZL8constMsgEEEEvv",
45 // CHECK: ![[LOC36]] = !DILocation(line: 0, scope: ![[SUBPROG26]], inlinedAt: ![[LOC37:.*]])
46 // CHECK: ![[LOC37]] = !DILocation(line: [[@LINE+3]], column: 3, scope: ![[SUBPROG32]])
47 template <const char * const category, const char * const reason>
48 void f2() {
49 __builtin_verbose_trap(category, reason);
52 void f3() {
53 f2<constCat, constMsg>();