Debian Codegraph @

clang/test/utils/update_cc_test_checks/Inputs/c-symbol-mangling.c

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 /// Check that we generate checks for functions even though the mangledName
3 /// property in the AST dump JSON does not match the LLVM IR name.
4 // RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=ELF
5 // RUN: %clang_cc1 -triple=x86_64-apple-macho -emit-llvm -o - %s | FileCheck %s --check-prefix=MACHO
6 // RUN: %clang_cc1 -triple=x86_64-windows-msvc -emit-llvm -o - %s | FileCheck %s --check-prefix=MSVC
7 // RUN: %clang_cc1 -triple=x86_64-windows-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=MINGW
8 // RUN: %clang_cc1 -triple=i686-unknown-win32 -emit-llvm -o - %s | FileCheck %s --check-prefix=WIN32
9 // RUN: %clang_cc1 -triple thumbv7s-apple-darwin -target-abi apcs-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=THUMB-DARWIN
10
11 // UTC_ARGS: --disable
12 // ELF: target datalayout = "e-m:e-
13 // MACHO: target datalayout = "e-m:o-
14 // MSVC: target datalayout = "e-m:w-
15 // MINGW: target datalayout = "e-m:w-
16 // WIN32: target datalayout = "e-m:x-
17 // THUMB-DARWIN: target datalayout = "e-m:o-
18 // UTC_ARGS: --enable
19
20 #ifdef __arm__
21 typedef __attribute__((neon_vector_type(8))) __INT8_TYPE__ int8x8_t;
22 int8x8_t test_vaba_s8(int8x8_t a, int8x8_t b, int8x8_t c) {
23 return a + b + c;
24 }
25 #endif
26
27 /// Check global variable mangling
28 [[gnu::used]] static int i1 = 1;
29 int i2 = 2;
30
31 [[clang::noinline,gnu::used]] static int static_noinline_fn(int arg) { return arg; }
32
33 [[gnu::visibility("hidden")]] int hidden_visibility(int arg) { return arg; }
34
35 #ifdef __ELF__
36 [[gnu::visibility("protected")]] int protected_visibility(int arg) { return arg; }
37 #endif
38
39 [[gnu::visibility("default")]] int default_visibility(int arg) { return arg; }
40
41 int no_visibility(int arg) { return arg; }
42
43
44 /// FIXME: the i386 @fastcall@12 is not being checked here
45 #ifdef _WIN32
46 int __fastcall fastcall(int arg, long arg2, long arg3) { return arg; }
47 #endif
48