brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · a4c3619 Raw
94 lines · c
1// RUN: rm -rf %t2// RUN: %clang_cc1 -extract-api --pretty-sgf --emit-sgf-symbol-labels-for-testing \3// RUN:   -triple arm64-apple-macosx -x objective-c-header %s -o %t/output.symbols.json -verify4 5// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix MYINT6typedef int MyInt;7// MYINT-LABEL: "!testLabel": "c:typedef.c@T@MyInt"8// MYINT: "accessLevel": "public",9// MYINT:      "declarationFragments": [10// MYINT-NEXT:   {11// MYINT-NEXT:     "kind": "keyword",12// MYINT-NEXT:     "spelling": "typedef"13// MYINT-NEXT:   },14// MYINT-NEXT:   {15// MYINT-NEXT:     "kind": "text",16// MYINT-NEXT:     "spelling": " "17// MYINT-NEXT:   },18// MYINT-NEXT:   {19// MYINT-NEXT:     "kind": "typeIdentifier",20// MYINT-NEXT:     "preciseIdentifier": "c:I",21// MYINT-NEXT:     "spelling": "int"22// MYINT-NEXT:   },23// MYINT-NEXT:   {24// MYINT-NEXT:     "kind": "text",25// MYINT-NEXT:     "spelling": " "26// MYINT-NEXT:   },27// MYINT-NEXT:   {28// MYINT-NEXT:     "kind": "identifier",29// MYINT-NEXT:     "spelling": "MyInt"30// MYINT-NEXT:   },31// MYINT-NEXT:   {32// MYINT-NEXT:     "kind": "text",33// MYINT-NEXT:     "spelling": ";"34// MYINT-NEXT:   }35// MYINT-NEXT: ],36// MYINT:      "kind": {37// MYINT-NEXT:   "displayName": "Type Alias",38// MYINT-NEXT:   "identifier": "objective-c.typealias"39// MYINT-NEXT: },40// MYINT: "title": "MyInt"41// MYINT:      "pathComponents": [42// MYINT-NEXT:   "MyInt"43// MYINT-NEXT: ],44// MYINT: "type": "c:I"45 46// RUN: FileCheck %s --input-file %t/output.symbols.json --check-prefix BARPTR47typedef struct Bar *BarPtr;48// BARPTR-LABEL: "!testLabel": "c:typedef.c@T@BarPtr"49// BARPTR: "accessLevel": "public",50// BARPTR:      "declarationFragments": [51// BARPTR-NEXT:   {52// BARPTR-NEXT:     "kind": "keyword",53// BARPTR-NEXT:     "spelling": "typedef"54// BARPTR-NEXT:   },55// BARPTR-NEXT:   {56// BARPTR-NEXT:     "kind": "text",57// BARPTR-NEXT:     "spelling": " "58// BARPTR-NEXT:   },59// BARPTR-NEXT:   {60// BARPTR-NEXT:     "kind": "keyword",61// BARPTR-NEXT:     "spelling": "struct"62// BARPTR-NEXT:   },63// BARPTR-NEXT:   {64// BARPTR-NEXT:     "kind": "text",65// BARPTR-NEXT:     "spelling": " "66// BARPTR-NEXT:   },67// BARPTR-NEXT:   {68// BARPTR-NEXT:     "kind": "typeIdentifier",69// BARPTR-NEXT:     "preciseIdentifier": "c:@S@Bar",70// BARPTR-NEXT:     "spelling": "Bar"71// BARPTR-NEXT:   },72// BARPTR-NEXT:   {73// BARPTR-NEXT:     "kind": "text",74// BARPTR-NEXT:     "spelling": " * "75// BARPTR-NEXT:   },76// BARPTR-NEXT:   {77// BARPTR-NEXT:     "kind": "identifier",78// BARPTR-NEXT:     "spelling": "BarPtr"79// BARPTR-NEXT:   },80// BARPTR-NEXT:   {81// BARPTR-NEXT:     "kind": "text",82// BARPTR-NEXT:     "spelling": ";"83// BARPTR-NEXT:   }84// BARPTR-NEXT: ],85// BARPTR: "type": "c:*$@S@Bar"86 87// RUN: FileCheck %s --input-file %t/output.symbols.json88void foo(BarPtr value);89 90void baz(BarPtr *value);91// CHECK-NOT: struct Bar *92 93// expected-no-diagnostics94