2015-07-08 09:00:30 +08:00
|
|
|
// REQUIRES: x86-registered-target
|
2010-07-29 05:07:02 +08:00
|
|
|
// Test with pch.
|
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t1.pch %S/Inputs/chain-external-defs1.h
|
2011-08-26 06:54:01 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t2.pch %S/Inputs/chain-external-defs2.h -include-pch %t1.pch
|
2010-07-29 05:07:02 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t2.pch -emit-llvm -o %t %s
|
|
|
|
// RUN: echo FINI >> %t
|
|
|
|
// RUN: FileCheck -input-file=%t -check-prefix=Z %s
|
|
|
|
// RUN: FileCheck -input-file=%t -check-prefix=XA %s
|
|
|
|
// RUN: FileCheck -input-file=%t -check-prefix=YA %s
|
|
|
|
// RUN: FileCheck -input-file=%t -check-prefix=XB %s
|
|
|
|
// RUN: FileCheck -input-file=%t -check-prefix=YB %s
|
|
|
|
// RUN: FileCheck -input-file=%t -check-prefix=AA %s
|
|
|
|
// RUN: FileCheck -input-file=%t -check-prefix=AB %s
|
|
|
|
// RUN: FileCheck -input-file=%t -check-prefix=AC %s
|
|
|
|
// RUN: FileCheck -input-file=%t -check-prefix=S %s
|
|
|
|
|
|
|
|
// Z-NOT: @z
|
|
|
|
|
2020-03-10 03:25:24 +08:00
|
|
|
// XA: @x = global i32 0
|
|
|
|
// XA-NOT: @x = global i32 0
|
2010-07-29 05:07:02 +08:00
|
|
|
|
2020-03-10 03:25:24 +08:00
|
|
|
// YA: @y = global i32 0
|
|
|
|
// YA-NOT: @y = global i32 0
|
2010-07-29 05:07:02 +08:00
|
|
|
|
|
|
|
// XB: @x2 = global i32 19
|
|
|
|
// XB-NOT: @x2 = global i32 19
|
|
|
|
int x2 = 19;
|
|
|
|
// YB: @y2 = global i32 18
|
|
|
|
// YB-NOT: @y2 = global i32 18
|
|
|
|
int y2 = 18;
|
|
|
|
|
2020-03-10 03:25:24 +08:00
|
|
|
// AA: @incomplete_array = global [1 x i32]
|
|
|
|
// AA-NOT: @incomplete_array = global [1 x i32]
|
|
|
|
// AB: @incomplete_array2 = global [17 x i32]
|
|
|
|
// AB-NOT: @incomplete_array2 = global [17 x i32]
|
2010-07-29 05:07:02 +08:00
|
|
|
int incomplete_array2[17];
|
2020-03-10 03:25:24 +08:00
|
|
|
// AC: @incomplete_array3 = global [1 x i32]
|
|
|
|
// AC-NOT: @incomplete_array3 = global [1 x i32]
|
2010-07-29 05:07:02 +08:00
|
|
|
int incomplete_array3[];
|
|
|
|
|
2020-03-10 03:25:24 +08:00
|
|
|
// S: @s = global %struct.S
|
|
|
|
// S-NOT: @s = global %struct.S
|
2010-07-29 05:07:02 +08:00
|
|
|
struct S {
|
|
|
|
int x, y;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Z: FINI
|
|
|
|
// XA: FINI
|
|
|
|
// YA: FINI
|
|
|
|
// XB: FINI
|
|
|
|
// YB: FINI
|
|
|
|
// AA: FINI
|
|
|
|
// AB: FINI
|
|
|
|
// AC: FINI
|
|
|
|
// S: FINI
|