Home | History | Annotate | Download | only in Internalize
      1 ; No arguments means internalize everything
      2 ; RUN: opt < %s -internalize -S | FileCheck --check-prefix=NOARGS %s
      3 
      4 ; Internalize all but foo and j
      5 ; RUN: opt < %s -internalize -internalize-public-api-list foo -internalize-public-api-list j -S | FileCheck --check-prefix=LIST %s
      6 
      7 ; Non existent files should be treated as if they were empty (so internalize
      8 ; everything)
      9 ; RUN: opt < %s -internalize -internalize-public-api-file /nonexistent/file 2> /dev/null -S | FileCheck --check-prefix=EMPTYFILE %s
     10 
     11 ; RUN: opt < %s -S -internalize -internalize-public-api-list bar -internalize-public-api-list foo -internalize-public-api-file /nonexistent/file  2> /dev/null | FileCheck --check-prefix=LIST2 %s
     12 
     13 ; -file and -list options should be merged, the .apifile contains foo and j
     14 ; RUN: opt < %s -internalize -internalize-public-api-list bar -internalize-public-api-file %s.apifile -S | FileCheck --check-prefix=MERGE %s
     15 
     16 ; NOARGS: @i = internal global
     17 ; LIST: @i = internal global
     18 ; EMPTYFILE: @i = internal global
     19 ; LIST2: @i = internal global
     20 ; MERGE: @i = internal global
     21 @i = global i32 0
     22 
     23 ; NOARGS: @j = internal global
     24 ; LIST: @j = global
     25 ; EMPTYFILE: @j = internal global
     26 ; LIST2: @j = internal global
     27 ; MERGE: @j = global
     28 @j = global i32 0
     29 
     30 ; NOARGS: define internal void @main
     31 ; LIST: define internal void @main
     32 ; EMPTYFILE: define internal void @main
     33 ; LIST2: define internal void @main
     34 ; MERGE: define internal void @main
     35 define void @main() {
     36         ret void
     37 }
     38 
     39 ; NOARGS: define internal void @foo
     40 ; LIST: define void @foo
     41 ; EMPTYFILE: define internal void @foo
     42 ; LIST2: define void @foo
     43 ; MERGE: define void @foo
     44 define void @foo() {
     45         ret void
     46 }
     47 
     48 ; NOARGS: define internal void @bar
     49 ; LIST: define internal void @bar
     50 ; EMPTYFILE: define internal void @bar
     51 ; LIST2: define void @bar
     52 ; MERGE: define void @bar
     53 define void @bar() {
     54         ret void
     55 }
     56