"Fossies" - the Fresh Open Source Software Archive

Member "cfe-9.0.0.src/test/Analysis/func-mapping-test.cpp" (23 Apr 2019, 723 Bytes) of package /linux/misc/cfe-9.0.0.src.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "func-mapping-test.cpp": 8.0.1_vs_9.0.0.

    1 // RUN: %clang_extdef_map %s -- | FileCheck --implicit-check-not "c:@y" --implicit-check-not "c:@z" %s
    2 
    3 int f(int) {
    4   return 0;
    5 }
    6 // CHECK-DAG: c:@F@f#I#
    7 
    8 extern const int x = 5;
    9 // CHECK-DAG: c:@x
   10 
   11 // Non-const variables should not be collected.
   12 int y = 5;
   13 
   14 // In C++, const implies internal linkage, so not collected.
   15 const int z = 5;
   16 
   17 struct S {
   18   int a;
   19 };
   20 extern S const s = {.a = 2};
   21 // CHECK-DAG: c:@s
   22 
   23 struct SF {
   24   const int a;
   25 };
   26 SF sf = {.a = 2};
   27 // CHECK-DAG: c:@sf
   28 
   29 struct SStatic {
   30   static const int a = 4;
   31 };
   32 const int SStatic::a;
   33 // CHECK-DAG: c:@S@SStatic@a
   34 
   35 extern int const arr[5] = { 0, 1 };
   36 // CHECK-DAG: c:@arr
   37 
   38 union U {
   39   const int a;
   40   const unsigned int b;
   41 };
   42 U u = {.a = 6};
   43 // CHECK-DAG: c:@u