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