1*f4a2713aSLionel Sambuc // Test with pch. 2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t1.pch %S/Inputs/chain-external-defs1.h 3*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t2.pch %S/Inputs/chain-external-defs2.h -include-pch %t1.pch 4*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t2.pch -emit-llvm -o %t %s 5*f4a2713aSLionel Sambuc // RUN: echo FINI >> %t 6*f4a2713aSLionel Sambuc // RUN: FileCheck -input-file=%t -check-prefix=Z %s 7*f4a2713aSLionel Sambuc // RUN: FileCheck -input-file=%t -check-prefix=XA %s 8*f4a2713aSLionel Sambuc // RUN: FileCheck -input-file=%t -check-prefix=YA %s 9*f4a2713aSLionel Sambuc // RUN: FileCheck -input-file=%t -check-prefix=XB %s 10*f4a2713aSLionel Sambuc // RUN: FileCheck -input-file=%t -check-prefix=YB %s 11*f4a2713aSLionel Sambuc // RUN: FileCheck -input-file=%t -check-prefix=AA %s 12*f4a2713aSLionel Sambuc // RUN: FileCheck -input-file=%t -check-prefix=AB %s 13*f4a2713aSLionel Sambuc // RUN: FileCheck -input-file=%t -check-prefix=AC %s 14*f4a2713aSLionel Sambuc // RUN: FileCheck -input-file=%t -check-prefix=S %s 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambuc // Z-NOT: @z 17*f4a2713aSLionel Sambuc 18*f4a2713aSLionel Sambuc // XA: @x = common global i32 0 19*f4a2713aSLionel Sambuc // XA-NOT: @x = common global i32 0 20*f4a2713aSLionel Sambuc 21*f4a2713aSLionel Sambuc // YA: @y = common global i32 0 22*f4a2713aSLionel Sambuc // YA-NOT: @y = common global i32 0 23*f4a2713aSLionel Sambuc 24*f4a2713aSLionel Sambuc // XB: @x2 = global i32 19 25*f4a2713aSLionel Sambuc // XB-NOT: @x2 = global i32 19 26*f4a2713aSLionel Sambuc int x2 = 19; 27*f4a2713aSLionel Sambuc // YB: @y2 = global i32 18 28*f4a2713aSLionel Sambuc // YB-NOT: @y2 = global i32 18 29*f4a2713aSLionel Sambuc int y2 = 18; 30*f4a2713aSLionel Sambuc 31*f4a2713aSLionel Sambuc // AA: @incomplete_array = common global [1 x i32] 32*f4a2713aSLionel Sambuc // AA-NOT: @incomplete_array = common global [1 x i32] 33*f4a2713aSLionel Sambuc // AB: @incomplete_array2 = common global [17 x i32] 34*f4a2713aSLionel Sambuc // AB-NOT: @incomplete_array2 = common global [17 x i32] 35*f4a2713aSLionel Sambuc int incomplete_array2[17]; 36*f4a2713aSLionel Sambuc // AC: @incomplete_array3 = common global [1 x i32] 37*f4a2713aSLionel Sambuc // AC-NOT: @incomplete_array3 = common global [1 x i32] 38*f4a2713aSLionel Sambuc int incomplete_array3[]; 39*f4a2713aSLionel Sambuc 40*f4a2713aSLionel Sambuc // S: @s = common global %struct.S 41*f4a2713aSLionel Sambuc // S-NOT: @s = common global %struct.S 42*f4a2713aSLionel Sambuc struct S { 43*f4a2713aSLionel Sambuc int x, y; 44*f4a2713aSLionel Sambuc }; 45*f4a2713aSLionel Sambuc 46*f4a2713aSLionel Sambuc // Z: FINI 47*f4a2713aSLionel Sambuc // XA: FINI 48*f4a2713aSLionel Sambuc // YA: FINI 49*f4a2713aSLionel Sambuc // XB: FINI 50*f4a2713aSLionel Sambuc // YB: FINI 51*f4a2713aSLionel Sambuc // AA: FINI 52*f4a2713aSLionel Sambuc // AB: FINI 53*f4a2713aSLionel Sambuc // AC: FINI 54*f4a2713aSLionel Sambuc // S: FINI 55