1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/Linker/module-flags-pic-2-a.ll
Justin Hibbits 9894c70714 Add Position-independent Code model Module API.
Summary:
This makes PIC levels a Module flag attribute, which can be queried by the
backend.  The flag is named `PIC Level`, and can have a value of:

  0 - Backend-default
  1 - Small-model (-fpic)
  2 - Large-model (-fPIC)

These match the `-pic-level' command line argument for clang, and the value of the
preprocessor macro `__PIC__'.

Test Plan:
New flags tests specific for the 'PIC Level' module flag.
Tests to be added as part of a future commit for PowerPC, which will use this new API.

Reviewers: rafael, echristo

Reviewed By: rafael, echristo

Subscribers: rafael, llvm-commits

Differential Revision: http://reviews.llvm.org/D5882

llvm-svn: 221510
2014-11-07 04:46:10 +00:00

11 lines
349 B
LLVM

; RUN: not llvm-link %s %p/Inputs/module-flags-pic-2-b.ll -S -o - 2> %t
; RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
; test linking modules with two different PIC levels
!0 = metadata !{ i32 1, metadata !"PIC Level", i32 1 }
!llvm.module.flags = !{!0}
; CHECK-ERRORS: ERROR: linking module flags 'PIC Level': IDs have conflicting values