1 // RUN: %clang_cc1 -x c -debug-info-kind=limited -triple bpf-linux-gnu -emit-llvm %s -o - | FileCheck %s
2
3 extern char ch;
test(void)4 int test(void) {
5 return ch;
6 }
7
test2(void)8 int test2(void) {
9 extern char ch2;
10 return ch2;
11 }
12
13 extern int (*foo)(int);
test3(void)14 int test3(void) {
15 return foo(0);
16 }
17
18 // CHECK: distinct !DIGlobalVariable(name: "ch",{{.*}} type: ![[CHART:[0-9]+]], isLocal: false, isDefinition: false
19 // CHECK: distinct !DIGlobalVariable(name: "ch2",{{.*}} type: ![[CHART]], isLocal: false, isDefinition: false
20 // CHECK: ![[CHART]] = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
21
22 // CHECK: distinct !DIGlobalVariable(name: "foo",{{.*}} type: ![[FUNC:[0-9]+]], isLocal: false, isDefinition: false)
23 // CHECK: ![[FUNC]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: ![[SUB:[0-9]+]], size: 64)
24 // CHECK: ![[SUB]] = !DISubroutineType(types: ![[TYPES:[0-9]+]])
25 // CHECK: ![[TYPES]] = !{![[BASET:[0-9]+]], ![[BASET]]}
26 // CHECK: ![[BASET]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
27