brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · c32f8f2 Raw
86 lines · plain
1// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck -check-prefix CHECK-DWARF %s2 3// RUN: %clang_cc1 -triple x86_64-w64-windows-gnu -emit-llvm -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck -check-prefix CHECK-MINGW %s4 5// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck -check-prefix CHECK-MSVC %s6 7// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -fobjc-runtime=gnustep-2.0 -o - %s | FileCheck -check-prefix CHECK-ELF %s8 9typedef struct {} Z;10 11@interface A12-(void)bar:(Z)a;13-(void)foo:(Z)a : (char*)b : (Z)c : (double) d;14@end15 16@implementation A17-(void)bar:(Z)a {}18-(void)foo:(Z)a: (char*)b : (Z)c : (double) d {}19@end20 21// CHECK-DWARF: private unnamed_addr constant [14 x i8] c"v16@0:8{?=}1622// CHECK-DWARF: private unnamed_addr constant [26 x i8] c"v32@0:8{?=}16*16{?=}24d2423 24// CHECK-MINGW: @".objc_sel_types_v16@0:8{?\02}16" = linkonce_odr hidden constant [14 x i8] c"v16@0:8{?=}16\00"25// CHECK-MINGW: @".objc_sel_types_v32@0:8{?\02}16*16{?\02}24d24" = linkonce_odr hidden constant [26 x i8] c"v32@0:8{?=}16*16{?=}24d24\00"26 27// CHECK-MSVC: @".objc_sel_types_v20@0:8{?\02}16" = linkonce_odr hidden constant [14 x i8] c"v20@0:8{?=}16\00"28// CHECK-MSVC: @".objc_sel_types_v40@0:8{?\02}16*20{?\02}28d32" = linkonce_odr hidden constant [26 x i8] c"v40@0:8{?=}16*20{?=}28d32\00"29 30// CHECK-ELF: @".objc_sel_types_v16\010:8{?=}16" = linkonce_odr hidden constant [14 x i8] c"v16@0:8{?=}16\00"31// CHECK-ELF: @".objc_sel_types_v32\010:8{?=}16*16{?=}24d24" = linkonce_odr hidden constant [26 x i8] c"v32@0:8{?=}16*16{?=}24d24\00"32 33@interface NSObject @end34 35@class BABugExample;36typedef BABugExample BABugExampleRedefinition;37 38@interface BABugExample : NSObject {39    BABugExampleRedefinition *_property; // .asciz   "^{BABugExample=^{BABugExample}}"40}41@property (copy) BABugExampleRedefinition *property;42@end43 44@implementation BABugExample45@synthesize property = _property;46@end47 48// CHECK-DWARF: private unnamed_addr constant [8 x i8] c"@1649// CHECK-MINGW: @".objc_sel_types_@16@0:8" = linkonce_odr hidden constant [8 x i8] c"@16@0:8\00"50// CHECK-MSVC: @".objc_sel_types_@16@0:8" = linkonce_odr hidden constant [8 x i8] c"@16@0:8\00"51// CHECK-ELF @".objc_sel_types_\0116\010:8" = linkonce_odr hidden constant [8 x i8] c"@16@0:8\00"52 53@class SCNCamera;54typedef SCNCamera C3DCamera;55typedef struct56{57    C3DCamera *presentationInstance;58}  C3DCameraStorage;59 60@interface SCNCamera61@end62 63@implementation SCNCamera64{65    C3DCameraStorage _storage;66}67@end68// CHECK-DWARF: private unnamed_addr constant [39 x i8] c"{?=\22presentationInstance\22@\22SCNCamera\22}\00"69// CHECK-MINGW: @"__objc_ivar_offset_SCNCamera._storage.{?\02@}"70// CHECK-MSVC: @"__objc_ivar_offset_SCNCamera._storage.{?\02@}"71// CHECK-ELF: @"__objc_ivar_offset_SCNCamera._storage.{?=\01}"72 73int i;74typeof(@encode(typeof(i))) e = @encode(typeof(i));75const char * Test(void)76{77    return e;78}79// CHECK-DWARF: @e ={{.*}} global [2 x i8] c"i\00", align 180// CHECK-DWARF: define{{.*}} ptr @Test()81// CHECK-DWARF: ret ptr @e82 83// CHECK-MSVC: @e = dso_local global [2 x i8] c"i\00", align 184// CHECK-MINGW: @e = dso_local global [2 x i8] c"i\00", align 185// CHECK-ELF: @e = global [2 x i8] c"i\00", align 186