| Daniel Dunbar | 42b91a8 | 2009-03-26 16:29:05 +0000 | [diff] [blame] | 1 | // Check that ld gets arch_multiple. | 
|  | 2 |  | 
| Daniel Dunbar | 5618e98 | 2009-12-15 22:01:24 +0000 | [diff] [blame] | 3 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -arch i386 -arch x86_64 %s -### -o foo 2> %t.log | 
| Daniel Dunbar | 8b57697 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 4 | // RUN: grep '".*ld.*" .*"-arch_multiple" "-final_output" "foo"' %t.log | 
| Daniel Dunbar | 42b91a8 | 2009-03-26 16:29:05 +0000 | [diff] [blame] | 5 |  | 
| Daniel Dunbar | f89733c | 2009-04-04 00:55:30 +0000 | [diff] [blame] | 6 | // Make sure we run dsymutil on source input files. | 
| Daniel Dunbar | 5618e98 | 2009-12-15 22:01:24 +0000 | [diff] [blame] | 7 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -g %s -o BAR 2> %t.log | 
| Daniel Dunbar | eb86b04 | 2011-05-09 17:23:16 +0000 | [diff] [blame] | 8 | // RUN: grep '".*dsymutil" "-o" "BAR.dSYM" "BAR"' %t.log | 
| Daniel Dunbar | 5618e98 | 2009-12-15 22:01:24 +0000 | [diff] [blame] | 9 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -g -filelist FOO %s -o BAR 2> %t.log | 
| Daniel Dunbar | eb86b04 | 2011-05-09 17:23:16 +0000 | [diff] [blame] | 10 | // RUN: grep '".*dsymutil" "-o" "BAR.dSYM" "BAR"' %t.log | 
| Daniel Dunbar | f89733c | 2009-04-04 00:55:30 +0000 | [diff] [blame] | 11 |  | 
| Daniel Dunbar | 8360803 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 12 | // Check linker changes that came with new linkedit format. | 
|  | 13 | // RUN: touch %t.o | 
| Daniel Dunbar | a9fdb83 | 2010-01-27 04:03:51 +0000 | [diff] [blame] | 14 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log | 
|  | 15 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log | 
|  | 16 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log | 
| Daniel Dunbar | 8360803 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 17 | // RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log | 
| Daniel Dunbar | 42b91a8 | 2009-03-26 16:29:05 +0000 | [diff] [blame] | 18 |  | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 19 | // LINK_IPHONE_3_0: {{ld(.exe)?"}} | 
| Daniel Dunbar | 8360803 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 20 | // LINK_IPHONE_3_0-NOT: -lcrt1.3.1.o | 
|  | 21 | // LINK_IPHONE_3_0: -lcrt1.o | 
|  | 22 | // LINK_IPHONE_3_0: -lSystem | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 23 | // LINK_IPHONE_3_0: {{ld(.exe)?"}} | 
| Daniel Dunbar | 8360803 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 24 | // LINK_IPHONE_3_0: -dylib | 
|  | 25 | // LINK_IPHONE_3_0: -ldylib1.o | 
|  | 26 | // LINK_IPHONE_3_0: -lSystem | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 27 | // LINK_IPHONE_3_0: {{ld(.exe)?"}} | 
| Daniel Dunbar | 8360803 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 28 | // LINK_IPHONE_3_0: -lbundle1.o | 
|  | 29 | // LINK_IPHONE_3_0: -lSystem | 
| Daniel Dunbar | 42b91a8 | 2009-03-26 16:29:05 +0000 | [diff] [blame] | 30 |  | 
| Daniel Dunbar | a9fdb83 | 2010-01-27 04:03:51 +0000 | [diff] [blame] | 31 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log | 
|  | 32 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log | 
|  | 33 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log | 
| Daniel Dunbar | 8360803 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 34 | // RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log | 
|  | 35 |  | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 36 | // LINK_IPHONE_3_1: {{ld(.exe)?"}} | 
| Daniel Dunbar | 8360803 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 37 | // LINK_IPHONE_3_1-NOT: -lcrt1.o | 
|  | 38 | // LINK_IPHONE_3_1: -lcrt1.3.1.o | 
|  | 39 | // LINK_IPHONE_3_1: -lSystem | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 40 | // LINK_IPHONE_3_1: {{ld(.exe)?"}} | 
| Daniel Dunbar | 8360803 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 41 | // LINK_IPHONE_3_1: -dylib | 
|  | 42 | // LINK_IPHONE_3_1-NOT: -ldylib1.o | 
|  | 43 | // LINK_IPHONE_3_1: -lSystem | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 44 | // LINK_IPHONE_3_1: {{ld(.exe)?"}} | 
| Daniel Dunbar | 8360803 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 45 | // LINK_IPHONE_3_1-NOT: -lbundle1.o | 
|  | 46 | // LINK_IPHONE_3_1: -lSystem | 
| Daniel Dunbar | af68a88 | 2010-07-13 23:31:40 +0000 | [diff] [blame] | 47 |  | 
|  | 48 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -fpie %t.o 2> %t.log | 
|  | 49 | // RUN: FileCheck -check-prefix=LINK_EXPLICIT_PIE %s < %t.log | 
|  | 50 | // | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 51 | // LINK_EXPLICIT_PIE: {{ld(.exe)?"}} | 
| Daniel Dunbar | af68a88 | 2010-07-13 23:31:40 +0000 | [diff] [blame] | 52 | // LINK_EXPLICIT_PIE: "-pie" | 
|  | 53 |  | 
|  | 54 | // RUN: %clang -ccc-host-triple i386-apple-darwin9 -### -fno-pie %t.o 2> %t.log | 
|  | 55 | // RUN: FileCheck -check-prefix=LINK_EXPLICIT_NO_PIE %s < %t.log | 
|  | 56 | // | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 57 | // LINK_EXPLICIT_NO_PIE: {{ld(.exe)?"}} | 
| Daniel Dunbar | af68a88 | 2010-07-13 23:31:40 +0000 | [diff] [blame] | 58 | // LINK_EXPLICIT_NO_PIE: "-no_pie" | 
| Daniel Dunbar | cacb0e2 | 2010-08-11 23:07:50 +0000 | [diff] [blame] | 59 |  | 
|  | 60 | // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ | 
|  | 61 | // RUN:   -mlinker-version=100 2> %t.log | 
|  | 62 | // RUN: FileCheck -check-prefix=LINK_NEWER_DEMANGLE %s < %t.log | 
|  | 63 | // | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 64 | // LINK_NEWER_DEMANGLE: {{ld(.exe)?"}} | 
| Daniel Dunbar | cacb0e2 | 2010-08-11 23:07:50 +0000 | [diff] [blame] | 65 | // LINK_NEWER_DEMANGLE: "-demangle" | 
|  | 66 |  | 
|  | 67 | // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ | 
|  | 68 | // RUN:   -mlinker-version=100 -Wl,--no-demangle 2> %t.log | 
|  | 69 | // RUN: FileCheck -check-prefix=LINK_NEWER_NODEMANGLE %s < %t.log | 
|  | 70 | // | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 71 | // LINK_NEWER_NODEMANGLE: {{ld(.exe)?"}} | 
| Daniel Dunbar | cacb0e2 | 2010-08-11 23:07:50 +0000 | [diff] [blame] | 72 | // LINK_NEWER_NODEMANGLE-NOT: "-demangle" | 
| Daniel Dunbar | e31e323 | 2010-08-23 20:58:55 +0000 | [diff] [blame] | 73 | // LINK_NEWER_NODEMANGLE: "-lSystem" | 
| Daniel Dunbar | cacb0e2 | 2010-08-11 23:07:50 +0000 | [diff] [blame] | 74 |  | 
|  | 75 | // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ | 
|  | 76 | // RUN:   -mlinker-version=95 2> %t.log | 
|  | 77 | // RUN: FileCheck -check-prefix=LINK_OLDER_NODEMANGLE %s < %t.log | 
|  | 78 | // | 
| Francois Pichet | 8f170b8 | 2010-09-11 20:43:12 +0000 | [diff] [blame] | 79 | // LINK_OLDER_NODEMANGLE: {{ld(.exe)?"}} | 
| Daniel Dunbar | cacb0e2 | 2010-08-11 23:07:50 +0000 | [diff] [blame] | 80 | // LINK_OLDER_NODEMANGLE-NOT: "-demangle" | 
| Daniel Dunbar | e31e323 | 2010-08-23 20:58:55 +0000 | [diff] [blame] | 81 | // LINK_OLDER_NODEMANGLE: "-lSystem" | 
| Daniel Dunbar | ef889c7 | 2011-06-21 20:55:11 +0000 | [diff] [blame] | 82 |  | 
|  | 83 | // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ | 
| Daniel Dunbar | 3d125d3 | 2011-06-21 21:18:32 +0000 | [diff] [blame] | 84 | // RUN:   -mlinker-version=117 -flto 2> %t.log | 
| Daniel Dunbar | ef889c7 | 2011-06-21 20:55:11 +0000 | [diff] [blame] | 85 | // RUN: cat %t.log | 
|  | 86 | // RUN: FileCheck -check-prefix=LINK_OBJECT_LTO_PATH %s < %t.log | 
|  | 87 | // | 
|  | 88 | // LINK_OBJECT_LTO_PATH: {{ld(.exe)?"}} | 
|  | 89 | // LINK_OBJECT_LTO_PATH: "-object_path_lto" | 
| Daniel Dunbar | 044a390 | 2011-06-28 20:16:02 +0000 | [diff] [blame] | 90 |  | 
|  | 91 | // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### %t.o \ | 
|  | 92 | // RUN:   -force_load a -force_load b 2> %t.log | 
|  | 93 | // RUN: cat %t.log | 
|  | 94 | // RUN: FileCheck -check-prefix=FORCE_LOAD %s < %t.log | 
|  | 95 | // | 
|  | 96 | // FORCE_LOAD: {{ld(.exe)?"}} | 
|  | 97 | // FORCE_LOAD: "-force_load" "a" "-force_load" "b" |