xref: /minix3/external/bsd/llvm/dist/clang/test/Preprocessor/pic.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -dM -E -o - %s \
2*f4a2713aSLionel Sambuc // RUN:   | FileCheck %s
3*f4a2713aSLionel Sambuc // CHECK-NOT: #define __PIC__
4*f4a2713aSLionel Sambuc // CHECK-NOT: #define __PIE__
5*f4a2713aSLionel Sambuc // CHECK-NOT: #define __pic__
6*f4a2713aSLionel Sambuc // CHECK-NOT: #define __pie__
7*f4a2713aSLionel Sambuc //
8*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -pic-level 1 -dM -E -o - %s \
9*f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PIC1 %s
10*f4a2713aSLionel Sambuc // CHECK-PIC1: #define __PIC__ 1
11*f4a2713aSLionel Sambuc // CHECK-PIC1-NOT: #define __PIE__
12*f4a2713aSLionel Sambuc // CHECK-PIC1: #define __pic__ 1
13*f4a2713aSLionel Sambuc // CHECK-PIC1-NOT: #define __pie__
14*f4a2713aSLionel Sambuc //
15*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -pic-level 2 -dM -E -o - %s \
16*f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PIC2 %s
17*f4a2713aSLionel Sambuc // CHECK-PIC2: #define __PIC__ 2
18*f4a2713aSLionel Sambuc // CHECK-PIC2-NOT: #define __PIE__
19*f4a2713aSLionel Sambuc // CHECK-PIC2: #define __pic__ 2
20*f4a2713aSLionel Sambuc // CHECK-PIC2-NOT: #define __pie__
21*f4a2713aSLionel Sambuc //
22*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -pie-level 1 -dM -E -o - %s \
23*f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PIE1 %s
24*f4a2713aSLionel Sambuc // CHECK-PIE1-NOT: #define __PIC__
25*f4a2713aSLionel Sambuc // CHECK-PIE1: #define __PIE__ 1
26*f4a2713aSLionel Sambuc // CHECK-PIE1-NOT: #define __pic__
27*f4a2713aSLionel Sambuc // CHECK-PIE1: #define __pie__ 1
28*f4a2713aSLionel Sambuc //
29*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -pie-level 2 -dM -E -o - %s \
30*f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PIE2 %s
31*f4a2713aSLionel Sambuc // CHECK-PIE2-NOT: #define __PIC__
32*f4a2713aSLionel Sambuc // CHECK-PIE2: #define __PIE__ 2
33*f4a2713aSLionel Sambuc // CHECK-PIE2-NOT: #define __pic__
34*f4a2713aSLionel Sambuc // CHECK-PIE2: #define __pie__ 2
35