1 // When entry values are emitted, expect a subprogram for extern decls so that 2 // the dwarf generator can describe call site parameters at extern call sites. 3 // 4 // RUN: %clang -Xclang -femit-debug-entry-values -g -O2 -target x86_64-none-linux-gnu -S -emit-llvm %s -o - | FileCheck %s -check-prefix=ENTRY-VAL 5 // ENTRY-VAL: !DISubprogram(name: "fn1" 6 7 // Similarly, when the debugger tuning is gdb, expect a subprogram for extern 8 // decls so that the dwarf generator can describe information needed for tail 9 // call frame reconstrution. 10 // 11 // RUN: %clang -g -O2 -target x86_64-none-linux-gnu -ggdb -S -emit-llvm %s -o - | FileCheck %s -check-prefix=GDB 12 // GDB: !DISubprogram(name: "fn1" 13 // 14 // Do not emit a subprogram for extern decls when entry values are disabled and 15 // the tuning is not set to gdb. 16 // 17 // RUN: %clang -g -O2 -target x86_64-none-linux-gnu -gsce -S -emit-llvm %s -o - | FileCheck %s -check-prefix=SCE 18 // SCE-NOT: !DISubprogram(name: "fn1" 19 20 extern int fn1(int a, int b); 21 22 int fn2 () { 23 int x = 4, y = 5; 24 int res = fn1(x, y); 25 26 return res; 27 } 28 29