brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 5a40118 Raw
42 lines · c
1// This test checks if C functions with internal linkage names are mangled2// and the module hash suffixes attached including emitting DW_AT_linkage_name.3//4// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-strict-prototypes -debug-info-kind=limited -dwarf-version=4 -emit-llvm -o -  %s | FileCheck %s --check-prefix=PLAIN5// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-strict-prototypes -debug-info-kind=limited -dwarf-version=4 -funique-internal-linkage-names -emit-llvm -o -  %s | FileCheck %s --check-prefix=UNIQUE6//7// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-strict-prototypes -debug-info-kind=limited -dwarf-version=5 -emit-llvm -o -  %s | FileCheck %s --check-prefix=PLAIN8// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-strict-prototypes -debug-info-kind=limited -dwarf-version=5 -funique-internal-linkage-names -emit-llvm -o -  %s | FileCheck %s --check-prefix=UNIQUE9 10static int glob;11// foo should be given a uniquefied name under -funique-internal-linkage-names.12static int foo(void) {13  return glob;14}15 16// K&R prototypes should be given uniquefied names under -funique-internal-linkage-names.17static int bar(a) int a;18{19  return glob + a;20}21 22void baz(void) {23  foo();24  bar(1);25}26 27 28// PLAIN: @glob = internal global i3229// PLAIN: define internal i32 @foo()30// PLAIN: define internal i32 @bar(i32 noundef %a)31// PLAIN: distinct !DIGlobalVariable(name: "glob"{{.*}})32// PLAIN: distinct !DISubprogram(name: "foo"{{.*}})33// PLAIN: distinct !DISubprogram(name: "bar"{{.*}})34// PLAIN-NOT: linkageName:35//36// UNIQUE: @glob = internal global i3237// UNIQUE: define internal i32 @_ZL3foov.[[MODHASH:__uniq.[0-9]+]]()38// UNIQUE: define internal i32 @_ZL3bari.[[MODHASH]](i32 noundef %a)39// UNIQUE: distinct !DIGlobalVariable(name: "glob"{{.*}})40// UNIQUE: distinct !DISubprogram(name: "foo", linkageName: "_ZL3foov.[[MODHASH]]"{{.*}})41// UNIQUE: distinct !DISubprogram(name: "bar", linkageName: "_ZL3bari.[[MODHASH]]"{{.*}})42