r273450 - Make this test a bit more strict and fix it.

Rafael Espindola via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 11:04:52 PDT 2016


Author: rafael
Date: Wed Jun 22 13:04:52 2016
New Revision: 273450

URL: http://llvm.org/viewvc/llvm-project?rev=273450&view=rev
Log:
Make this test a bit more strict and fix it.

We do pass -pic-level to cc1 when targeting darwin. Given that codegen
itself doesn't use it, the only difference is whether __PIE__ and
__pie__ are defined.

Modified:
    cfe/trunk/test/Driver/pic.c

Modified: cfe/trunk/test/Driver/pic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/pic.c?rev=273450&r1=273449&r2=273450&view=diff
==============================================================================
--- cfe/trunk/test/Driver/pic.c (original)
+++ cfe/trunk/test/Driver/pic.c Wed Jun 22 13:04:52 2016
@@ -7,9 +7,11 @@
 //
 // CHECK-PIC1: "-mrelocation-model" "pic"
 // CHECK-PIC1: "-pic-level" "1"
+// CHECK-PIC1-NOT: "-pie-level"
 //
 // CHECK-PIC2: "-mrelocation-model" "pic"
 // CHECK-PIC2: "-pic-level" "2"
+// CHECK-PIC2-NOT: "-pie-level"
 //
 // CHECK-STATIC: "-static"
 // CHECK-NO-STATIC-NOT: "-static"
@@ -151,10 +153,9 @@
 // RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIE
 //
 // Darwin is a beautiful and unique snowflake when it comes to these flags.
-// When targeting a 32-bit darwin system, the -fno-* flag variants work and
-// disable PIC, but any other flag enables PIC (*not* PIE) even if the flag
-// specifies PIE. On 64-bit targets, there is simply nothing you can do, there
-// is no PIE, there is only PIC when it comes to compilation.
+// When targeting a 32-bit darwin system, only level 2 is supported. On 64-bit
+// targets, there is simply nothing you can do, there is no PIE, there is only
+// PIC when it comes to compilation.
 // RUN: %clang -c %s -target i386-apple-darwin -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
 // RUN: %clang -c %s -target i386-apple-darwin -fpic -### 2>&1 \
@@ -162,9 +163,9 @@
 // RUN: %clang -c %s -target i386-apple-darwin -fPIC -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
 // RUN: %clang -c %s -target i386-apple-darwin -fpie -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
+// RUN:   | FileCheck %s --check-prefix=CHECK-PIE2
 // RUN: %clang -c %s -target i386-apple-darwin -fPIE -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
+// RUN:   | FileCheck %s --check-prefix=CHECK-PIE2
 // RUN: %clang -c %s -target i386-apple-darwin -fno-PIC -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-NO-PIC
 // RUN: %clang -c %s -target i386-apple-darwin -fno-PIE -### 2>&1 \
@@ -172,7 +173,7 @@
 // RUN: %clang -c %s -target i386-apple-darwin -fno-PIC -fpic -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
 // RUN: %clang -c %s -target i386-apple-darwin -fno-PIC -fPIE -### 2>&1 \
-// RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
+// RUN:   | FileCheck %s --check-prefix=CHECK-PIE2
 // RUN: %clang -c %s -target x86_64-apple-darwin -fno-PIC -### 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=CHECK-PIC2
 // RUN: %clang -c %s -target x86_64-apple-darwin -fno-PIE -### 2>&1 \




More information about the cfe-commits mailing list