Peter Collingbourne | 9881b78 | 2015-06-18 23:59:22 +0000 | [diff] [blame] | 1 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-trap=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP |
| 2 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-trap=undefined -fno-sanitize-trap=signed-integer-overflow %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP2 |
| 3 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP |
Alexey Samsonov | 9bc2ad5 | 2015-06-17 22:27:32 +0000 | [diff] [blame] | 4 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP |
| 5 | // RUN: %clang -target x86_64-linux-gnu -fsanitize-undefined-trap-on-error -fsanitize=undefined-trap %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP |
Peter Collingbourne | 9881b78 | 2015-06-18 23:59:22 +0000 | [diff] [blame] | 6 | // CHECK-UNDEFINED-TRAP: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute|function),?){18}"}} |
| 7 | // CHECK-UNDEFINED-TRAP: "-fsanitize-trap=alignment,array-bounds,bool,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,nonnull-attribute,null,object-size,return,returns-nonnull-attribute,shift-base,shift-exponent,signed-integer-overflow,unreachable,vla-bound" |
| 8 | // CHECK-UNDEFINED-TRAP2: "-fsanitize-trap=alignment,array-bounds,bool,enum,float-cast-overflow,float-divide-by-zero,function,integer-divide-by-zero,nonnull-attribute,null,object-size,return,returns-nonnull-attribute,shift-base,shift-exponent,unreachable,vla-bound" |
Chad Rosier | ae229d5 | 2013-01-29 23:31:22 +0000 | [diff] [blame] | 9 | |
Richard Smith | 52be619 | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 10 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED |
Alexey Samsonov | 21d2dda | 2015-03-09 21:50:19 +0000 | [diff] [blame] | 11 | // CHECK-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){19}"}} |
Richard Smith | 52be619 | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 12 | |
Peter Collingbourne | 3270164 | 2013-11-01 18:16:25 +0000 | [diff] [blame] | 13 | // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-DARWIN |
Alexey Samsonov | 1d4cff2 | 2015-06-25 00:58:02 +0000 | [diff] [blame] | 14 | // CHECK-UNDEFINED-DARWIN: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){17}"}} |
Peter Collingbourne | 3270164 | 2013-11-01 18:16:25 +0000 | [diff] [blame] | 15 | |
Alexey Samsonov | 7f2a0d2 | 2015-06-19 21:36:47 +0000 | [diff] [blame] | 16 | // RUN: %clang -target i386-unknown-openbsd -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-OPENBSD |
| 17 | // CHECK-UNDEFINED-OPENBSD: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){17}"}} |
| 18 | |
Peter Collingbourne | 581f438 | 2015-07-02 01:48:12 +0000 | [diff] [blame] | 19 | // RUN: %clang -target i386-pc-win32 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN32 |
| 20 | // RUN: %clang -target i386-pc-win32 -fsanitize=undefined -x c++ %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN32 --check-prefix=CHECK-UNDEFINED-WIN-CXX |
| 21 | // RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN64 |
| 22 | // RUN: %clang -target x86_64-pc-win32 -fsanitize=undefined -x c++ %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-WIN --check-prefix=CHECK-UNDEFINED-WIN64 --check-prefix=CHECK-UNDEFINED-WIN-CXX |
| 23 | // CHECK-UNDEFINED-WIN: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){17}"}} |
| 24 | // CHECK-UNDEFINED-WIN32-SAME: "--dependent-lib={{[^"]*}}ubsan_standalone-i386.lib" |
| 25 | // CHECK-UNDEFINED-WIN64-SAME: "--dependent-lib={{[^"]*}}ubsan_standalone-x86_64.lib" |
| 26 | // CHECK-UNDEFINED-WIN-CXX-SAME: "--dependent-lib={{[^"]*}}ubsan_standalone_cxx{{[^"]*}}.lib" |
| 27 | |
Will Dietz | 1897cb3 | 2012-11-27 15:01:55 +0000 | [diff] [blame] | 28 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER |
Alexey Samsonov | 21d2dda | 2015-03-09 21:50:19 +0000 | [diff] [blame] | 29 | // CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift-base|shift-exponent),?){5}"}} |
Will Dietz | 1897cb3 | 2012-11-27 15:01:55 +0000 | [diff] [blame] | 30 | |
Alexey Samsonov | e123799 | 2014-03-21 07:15:47 +0000 | [diff] [blame] | 31 | // RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOUNDS |
| 32 | // CHECK-BOUNDS: "-fsanitize={{((array-bounds|local-bounds),?){2}"}} |
| 33 | |
Alexey Samsonov | abd5bea | 2014-12-19 18:41:43 +0000 | [diff] [blame] | 34 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=all %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSANITIZE-ALL |
| 35 | // CHECK-FSANITIZE-ALL: error: unsupported argument 'all' to option 'fsanitize=' |
| 36 | |
| 37 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,undefined -fno-sanitize=all -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FNO-SANITIZE-ALL |
| 38 | // CHECK-FNO-SANITIZE-ALL: "-fsanitize=thread" |
| 39 | |
Alexey Samsonov | cb3f812 | 2014-03-20 10:48:29 +0000 | [diff] [blame] | 40 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined -fno-sanitize=thread -fno-sanitize=float-cast-overflow,vptr,bool,enum %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-UNDEFINED |
Alexey Samsonov | 21d2dda | 2015-03-09 21:50:19 +0000 | [diff] [blame] | 41 | // CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|object-size|array-bounds|returns-nonnull-attribute|nonnull-attribute),?){15}"}} |
| 42 | |
| 43 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=shift -fno-sanitize=shift-base %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSANITIZE-SHIFT-PARTIAL |
| 44 | // CHECK-FSANITIZE-SHIFT-PARTIAL: "-fsanitize=shift-exponent" |
Richard Smith | 52be619 | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 45 | |
Peter Collingbourne | 9881b78 | 2015-06-18 23:59:22 +0000 | [diff] [blame] | 46 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fsanitize-trap=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-TRAP-UNDEF |
| 47 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-TRAP-UNDEF |
| 48 | // CHECK-VPTR-TRAP-UNDEF: error: invalid argument '-fsanitize=vptr' not allowed with '-fsanitize-trap=undefined' |
Chad Rosier | ae229d5 | 2013-01-29 23:31:22 +0000 | [diff] [blame] | 49 | |
Joey Gouly | a35a289 | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 50 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI |
Richard Smith | aa71657 | 2012-11-06 01:12:02 +0000 | [diff] [blame] | 51 | // CHECK-VPTR-NO-RTTI: '-fsanitize=vptr' not allowed with '-fno-rtti' |
Richard Smith | 52be619 | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 52 | |
Filipe Cabecinhas | ec5d0e6 | 2015-02-19 01:04:49 +0000 | [diff] [blame] | 53 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-NO-RTTI |
| 54 | // CHECK-UNDEFINED-NO-RTTI-NOT: vptr |
| 55 | |
Joey Gouly | a35a289 | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 56 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,thread -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANT |
Richard Smith | 52be619 | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 57 | // CHECK-SANA-SANT: '-fsanitize=address' not allowed with '-fsanitize=thread' |
| 58 | |
Evgeniy Stepanov | ad8ab3d | 2012-12-24 08:42:34 +0000 | [diff] [blame] | 59 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANM |
Evgeniy Stepanov | cdc2255 | 2012-12-05 13:37:12 +0000 | [diff] [blame] | 60 | // CHECK-SANA-SANM: '-fsanitize=address' not allowed with '-fsanitize=memory' |
| 61 | |
Evgeniy Stepanov | ad8ab3d | 2012-12-24 08:42:34 +0000 | [diff] [blame] | 62 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANT-SANM |
Evgeniy Stepanov | cdc2255 | 2012-12-05 13:37:12 +0000 | [diff] [blame] | 63 | // CHECK-SANT-SANM: '-fsanitize=thread' not allowed with '-fsanitize=memory' |
| 64 | |
Evgeniy Stepanov | ad8ab3d | 2012-12-24 08:42:34 +0000 | [diff] [blame] | 65 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANM-SANT |
Evgeniy Stepanov | cdc2255 | 2012-12-05 13:37:12 +0000 | [diff] [blame] | 66 | // CHECK-SANM-SANT: '-fsanitize=thread' not allowed with '-fsanitize=memory' |
| 67 | |
Sergey Matveev | 1814e9e | 2013-05-27 11:17:01 +0000 | [diff] [blame] | 68 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANT |
| 69 | // CHECK-SANL-SANT: '-fsanitize=leak' not allowed with '-fsanitize=thread' |
| 70 | |
| 71 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANM |
| 72 | // CHECK-SANL-SANM: '-fsanitize=leak' not allowed with '-fsanitize=memory' |
| 73 | |
Alexander Potapenko | b9b73ef | 2015-06-19 12:19:07 +0000 | [diff] [blame] | 74 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,thread -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANT |
| 75 | // CHECK-SANKA-SANT: '-fsanitize=kernel-address' not allowed with '-fsanitize=thread' |
| 76 | |
| 77 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANM |
| 78 | // CHECK-SANKA-SANM: '-fsanitize=kernel-address' not allowed with '-fsanitize=memory' |
| 79 | |
| 80 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,address -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANA |
| 81 | // CHECK-SANKA-SANA: '-fsanitize=kernel-address' not allowed with '-fsanitize=address' |
| 82 | |
| 83 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=kernel-address,leak -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANKA-SANL |
| 84 | // CHECK-SANKA-SANL: '-fsanitize=kernel-address' not allowed with '-fsanitize=leak' |
| 85 | |
Evgeniy Stepanov | ad8ab3d | 2012-12-24 08:42:34 +0000 | [diff] [blame] | 86 | // RUN: %clang -target x86_64-linux-gnu -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-TRACK-ORIGINS |
| 87 | // CHECK-ONLY-TRACK-ORIGINS: warning: argument unused during compilation: '-fsanitize-memory-track-origins' |
| 88 | |
Alexey Samsonov | de0aff3 | 2015-05-21 01:07:52 +0000 | [diff] [blame] | 89 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize=memory -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-DISABLED-MSAN |
| 90 | // CHECK-TRACK-ORIGINS-DISABLED-MSAN-NOT: warning: argument unused |
| 91 | |
Alexey Samsonov | f7a2476 | 2013-01-16 11:34:36 +0000 | [diff] [blame] | 92 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-EXTRA-TRACK-ORIGINS |
| 93 | // CHECK-NO-EXTRA-TRACK-ORIGINS-NOT: "-fsanitize-memory-track-origins" |
| 94 | |
Joey Gouly | a35a289 | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 95 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize=alignment -fsanitize=vptr -fno-sanitize=vptr %s -### 2>&1 |
Richard Smith | 06d87f1 | 2012-12-01 01:02:45 +0000 | [diff] [blame] | 96 | // OK |
Alexey Samsonov | 53f7e12 | 2012-11-28 17:34:24 +0000 | [diff] [blame] | 97 | |
Evgeniy Stepanov | ad8ab3d | 2012-12-24 08:42:34 +0000 | [diff] [blame] | 98 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -pie %s -### 2>&1 |
| 99 | // OK |
| 100 | |
Evgeniy Stepanov | 6e09bca | 2015-02-26 15:59:30 +0000 | [diff] [blame] | 101 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 |
Evgeniy Stepanov | 2bfcaab | 2014-03-20 14:58:36 +0000 | [diff] [blame] | 102 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=1 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1 |
Evgeniy Stepanov | 6e09bca | 2015-02-26 15:59:30 +0000 | [diff] [blame] | 103 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=1 -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 |
| 104 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 |
| 105 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize-memory-track-origins -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 |
| 106 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -fsanitize-memory-track-origins=1 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1 |
| 107 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 |
Evgeniy Stepanov | 2bfcaab | 2014-03-20 14:58:36 +0000 | [diff] [blame] | 108 | |
| 109 | // CHECK-TRACK-ORIGINS-1: -fsanitize-memory-track-origins=1 |
| 110 | |
| 111 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS |
| 112 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS |
| 113 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -fno-sanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS |
| 114 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -fsanitize-memory-track-origins=0 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS |
| 115 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-sanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS |
| 116 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-memory-track-origins=0 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS |
| 117 | // CHECK-NO-TRACK-ORIGINS-NOT: sanitize-memory-track-origins |
| 118 | |
| 119 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2 |
| 120 | // CHECK-TRACK-ORIGINS-2: -fsanitize-memory-track-origins=2 |
| 121 | |
| 122 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=3 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-3 |
| 123 | // CHECK-TRACK-ORIGINS-3: error: invalid value '3' in '-fsanitize-memory-track-origins=3' |
Evgeniy Stepanov | ad8ab3d | 2012-12-24 08:42:34 +0000 | [diff] [blame] | 124 | |
Kostya Serebryany | aed71a8 | 2014-10-09 17:53:04 +0000 | [diff] [blame] | 125 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=0 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-0 |
| 126 | // CHECK-ASAN-FIELD-PADDING-0-NOT: -fsanitize-address-field-padding |
| 127 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=1 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-1 |
| 128 | // CHECK-ASAN-FIELD-PADDING-1: -fsanitize-address-field-padding=1 |
| 129 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=2 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-2 |
| 130 | // CHECK-ASAN-FIELD-PADDING-2: -fsanitize-address-field-padding=2 |
| 131 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize-address-field-padding=3 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-3 |
| 132 | // CHECK-ASAN-FIELD-PADDING-3: error: invalid value '3' in '-fsanitize-address-field-padding=3' |
| 133 | // RUN: %clang -target x86_64-linux-gnu -fsanitize-address-field-padding=2 %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-NO-ASAN |
| 134 | // CHECK-ASAN-FIELD-PADDING-NO-ASAN: warning: argument unused during compilation: '-fsanitize-address-field-padding=2' |
Alexey Samsonov | de0aff3 | 2015-05-21 01:07:52 +0000 | [diff] [blame] | 135 | // RUN: %clang -target x86_64-linux-gnu -fsanitize-address-field-padding=2 -fsanitize=address -fno-sanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FIELD-PADDING-DISABLED-ASAN |
| 136 | // CHECK-ASAN-FIELD-PADDING-DISABLED-ASAN-NOT: warning: argument unused |
| 137 | |
Kostya Serebryany | aed71a8 | 2014-10-09 17:53:04 +0000 | [diff] [blame] | 138 | |
Joey Gouly | a35a289 | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 139 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 |
Richard Smith | 06d87f1 | 2012-12-01 01:02:45 +0000 | [diff] [blame] | 140 | // OK |
Alexey Samsonov | 53f7e12 | 2012-11-28 17:34:24 +0000 | [diff] [blame] | 141 | |
Evgeniy Stepanov | cdc2255 | 2012-12-05 13:37:12 +0000 | [diff] [blame] | 142 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-NO-PIE |
Dmitry Vyukov | 45bac8d | 2014-11-21 12:48:43 +0000 | [diff] [blame] | 143 | // CHECK-TSAN-NO-PIE: "-mrelocation-model" "static" |
Evgeniy Stepanov | cdc2255 | 2012-12-05 13:37:12 +0000 | [diff] [blame] | 144 | |
| 145 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NO-PIE |
Peter Collingbourne | 54d770c | 2013-04-09 04:35:11 +0000 | [diff] [blame] | 146 | // CHECK-MSAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2" |
| 147 | // CHECK-MSAN-NO-PIE: "-pie" |
Evgeniy Stepanov | cdc2255 | 2012-12-05 13:37:12 +0000 | [diff] [blame] | 148 | |
| 149 | // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-ASAN-NO-PIE |
Peter Collingbourne | 54d770c | 2013-04-09 04:35:11 +0000 | [diff] [blame] | 150 | // CHECK-ANDROID-ASAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2" |
| 151 | // CHECK-ANDROID-ASAN-NO-PIE: "-pie" |
Will Dietz | 3676d56 | 2012-12-30 20:53:28 +0000 | [diff] [blame] | 152 | |
Alexey Samsonov | 71c197b | 2013-08-09 10:56:42 +0000 | [diff] [blame] | 153 | // RUN: %clang -target arm-linux-androideabi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-NO-ASAN |
Alexey Bataev | 40e7522 | 2014-01-28 06:30:35 +0000 | [diff] [blame] | 154 | // CHECK-ANDROID-NO-ASAN: "-mrelocation-model" "pic" |
Alexey Samsonov | 71c197b | 2013-08-09 10:56:42 +0000 | [diff] [blame] | 155 | |
Alexey Samsonov | 1e715a6 | 2014-11-16 20:53:53 +0000 | [diff] [blame] | 156 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER |
| 157 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER |
Alexey Samsonov | 8845952 | 2015-01-12 22:39:12 +0000 | [diff] [blame] | 158 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=all -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER |
Alexey Samsonov | ce2e77c | 2015-03-11 23:34:25 +0000 | [diff] [blame] | 159 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER |
Alexey Samsonov | 8845952 | 2015-01-12 22:39:12 +0000 | [diff] [blame] | 160 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=all -fsanitize-recover=thread -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER |
| 161 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover -fsanitize-recover=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER |
Alexey Samsonov | ce2e77c | 2015-03-11 23:34:25 +0000 | [diff] [blame] | 162 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=all -fno-sanitize-recover=undefined -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER |
Alexey Samsonov | 21d2dda | 2015-03-09 21:50:19 +0000 | [diff] [blame] | 163 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fno-sanitize-recover=all -fsanitize-recover=object-size,shift-base -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-RECOVER |
Alexey Samsonov | 8845952 | 2015-01-12 22:39:12 +0000 | [diff] [blame] | 164 | |
Alexey Samsonov | 21d2dda | 2015-03-09 21:50:19 +0000 | [diff] [blame] | 165 | // CHECK-RECOVER: "-fsanitize-recover={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift-base|shift-exponent|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool|returns-nonnull-attribute|nonnull-attribute),?){17}"}} |
Alexey Samsonov | 8845952 | 2015-01-12 22:39:12 +0000 | [diff] [blame] | 166 | // CHECK-NO-RECOVER-NOT: sanitize-recover |
Alexey Samsonov | 21d2dda | 2015-03-09 21:50:19 +0000 | [diff] [blame] | 167 | // CHECK-PARTIAL-RECOVER: "-fsanitize-recover={{((object-size|shift-base),?){2}"}} |
Alexey Samsonov | 8845952 | 2015-01-12 22:39:12 +0000 | [diff] [blame] | 168 | |
| 169 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover=address,foobar,object-size,unreachable -### 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG-RECOVER |
| 170 | // CHECK-DIAG-RECOVER: unsupported argument 'foobar' to option 'fsanitize-recover=' |
| 171 | // CHECK-DIAG-RECOVER: unsupported argument 'address,unreachable' to option 'fsanitize-recover=' |
Sergey Matveev | 1814e9e | 2013-05-27 11:17:01 +0000 | [diff] [blame] | 172 | |
Alexey Samsonov | ce2e77c | 2015-03-11 23:34:25 +0000 | [diff] [blame] | 173 | // RUN: %clang -target x86_64-linux-gnu %s -fsanitize=undefined -fsanitize-recover -fno-sanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-DEPRECATED-RECOVER |
| 174 | // CHECK-DEPRECATED-RECOVER: argument '-fsanitize-recover' is deprecated, use '-fsanitize-recover=undefined,integer' instead |
| 175 | // CHECK-DEPRECATED-RECOVER: argument '-fno-sanitize-recover' is deprecated, use '-fno-sanitize-recover=undefined,integer' instead |
| 176 | // CHECK-DEPRECATED-RECOVER-NOT: is deprecated |
| 177 | |
Sergey Matveev | 1814e9e | 2013-05-27 11:17:01 +0000 | [diff] [blame] | 178 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL |
| 179 | // CHECK-SANL: "-fsanitize=leak" |
| 180 | |
| 181 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,leak -fno-sanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANL-NO-SANA |
| 182 | // CHECK-SANA-SANL-NO-SANA: "-fsanitize=leak" |
Evgeniy Stepanov | edc9142 | 2013-06-20 10:49:46 +0000 | [diff] [blame] | 183 | |
| 184 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN |
| 185 | // CHECK-MSAN: "-fno-assume-sane-operator-new" |
Sergey Matveev | 2ba8778 | 2015-02-17 15:09:33 +0000 | [diff] [blame] | 186 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN |
| 187 | // CHECK-ASAN: "-fno-assume-sane-operator-new" |
Alexey Samsonov | 609213f9 | 2013-08-19 09:14:21 +0000 | [diff] [blame] | 188 | |
| 189 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=zzz %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG1 |
| 190 | // CHECK-DIAG1: unsupported argument 'zzz' to option 'fsanitize=' |
| 191 | // CHECK-DIAG1-NOT: unsupported argument 'zzz' to option 'fsanitize=' |
Peter Collingbourne | 3270164 | 2013-11-01 18:16:25 +0000 | [diff] [blame] | 192 | |
| 193 | // RUN: %clang -target i686-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-X86 |
| 194 | // CHECK-MSAN-X86: error: unsupported option '-fsanitize=memory' for target 'i686--linux-gnu' |
| 195 | |
| 196 | // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-DARWIN |
| 197 | // CHECK-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10' |
| 198 | |
| 199 | // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fno-sanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NOMSAN-DARWIN |
| 200 | // CHECK-MSAN-NOMSAN-DARWIN-NOT: unsupported option |
| 201 | |
| 202 | // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fsanitize=thread,memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-TSAN-MSAN-DARWIN |
| 203 | // CHECK-MSAN-TSAN-MSAN-DARWIN: unsupported option '-fsanitize=thread,memory' for target 'x86_64-apple-darwin10' |
| 204 | // CHECK-MSAN-TSAN-MSAN-DARWIN-NOT: unsupported option |
| 205 | |
| 206 | // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=thread,memory -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MSAN-MSAN-DARWIN |
| 207 | // CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10' |
| 208 | // CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=thread' for target 'x86_64-apple-darwin10' |
| 209 | // CHECK-TSAN-MSAN-MSAN-DARWIN-NOT: unsupported option |
| 210 | |
| 211 | // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-DARWIN |
| 212 | // CHECK-FSAN-DARWIN: unsupported option '-fsanitize=function' for target 'x86_64-apple-darwin10' |
| 213 | |
| 214 | // RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-DARWIN |
| 215 | // CHECK-FSAN-UBSAN-DARWIN: unsupported option '-fsanitize=function' for target 'x86_64-apple-darwin10' |
Ehsan Akhgari | e0db196 | 2014-10-14 23:15:44 +0000 | [diff] [blame] | 216 | |
Alexey Samsonov | 1d4cff2 | 2015-06-25 00:58:02 +0000 | [diff] [blame] | 217 | // RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.8 -fsanitize=vptr %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-DARWIN-OLD |
| 218 | // CHECK-VPTR-DARWIN-OLD: unsupported option '-fsanitize=vptr' for target 'x86_64-apple-darwin10' |
| 219 | |
| 220 | // RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.9 -fsanitize=alignment,vptr %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-DARWIN-NEW |
| 221 | // CHECK-VPTR-DARWIN-NEW: -fsanitize=alignment,vptr |
| 222 | |
Alexey Samsonov | 7f2a0d2 | 2015-06-19 21:36:47 +0000 | [diff] [blame] | 223 | // RUN: %clang -target armv7-apple-ios7 -miphoneos-version-min=7.0 -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-IOS |
| 224 | // CHECK-ASAN-IOS: unsupported option '-fsanitize=address' for target 'arm-apple-ios7' |
| 225 | |
| 226 | // RUN: %clang -target i386-pc-openbsd -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-OPENBSD |
| 227 | // CHECK-ASAN-OPENBSD: unsupported option '-fsanitize=address' for target 'i386-pc-openbsd' |
| 228 | |
Alexey Samsonov | 907880e | 2015-06-19 19:57:46 +0000 | [diff] [blame] | 229 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI |
| 230 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi-derived-cast -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-DCAST |
| 231 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=cfi-unrelated-cast -flto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-UCAST |
| 232 | // RUN: %clang -target x86_64-linux-gnu -flto -fsanitize=cfi-nvcall -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NVCALL |
| 233 | // RUN: %clang -target x86_64-linux-gnu -flto -fsanitize=cfi-vcall -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-VCALL |
Peter Collingbourne | 1a7488a | 2015-04-02 00:23:30 +0000 | [diff] [blame] | 234 | // CHECK-CFI: -emit-llvm-bc{{.*}}-fsanitize=cfi-derived-cast,cfi-unrelated-cast,cfi-nvcall,cfi-vcall |
Peter Collingbourne | d2926c9 | 2015-03-14 02:42:25 +0000 | [diff] [blame] | 235 | // CHECK-CFI-DCAST: -emit-llvm-bc{{.*}}-fsanitize=cfi-derived-cast |
| 236 | // CHECK-CFI-UCAST: -emit-llvm-bc{{.*}}-fsanitize=cfi-unrelated-cast |
Peter Collingbourne | 1a7488a | 2015-04-02 00:23:30 +0000 | [diff] [blame] | 237 | // CHECK-CFI-NVCALL: -emit-llvm-bc{{.*}}-fsanitize=cfi-nvcall |
| 238 | // CHECK-CFI-VCALL: -emit-llvm-bc{{.*}}-fsanitize=cfi-vcall |
Peter Collingbourne | a4ccff3 | 2015-02-20 20:30:56 +0000 | [diff] [blame] | 239 | |
Alexey Samsonov | 907880e | 2015-06-19 19:57:46 +0000 | [diff] [blame] | 240 | // RUN: %clang -target x86_64-linux-gnu -flto -fsanitize=cfi-derived-cast -fno-lto -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOLTO |
| 241 | // CHECK-CFI-NOLTO: '-fsanitize=cfi-derived-cast' only allowed with '-flto' |
| 242 | |
Peter Collingbourne | 9881b78 | 2015-06-18 23:59:22 +0000 | [diff] [blame] | 243 | // RUN: %clang -target x86_64-linux-gnu -fsanitize-trap=address -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-TRAP |
| 244 | // CHECK-ASAN-TRAP: error: unsupported argument 'address' to option '-fsanitize-trap' |
| 245 | |
Alexey Samsonov | 9b87309 | 2015-06-25 23:14:32 +0000 | [diff] [blame] | 246 | // RUN: %clang -target x86_64-apple-darwin10 -mmacosx-version-min=10.7 -flto -fsanitize=cfi-vcall -fno-sanitize-trap=cfi -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOTRAP-OLD-MACOS |
| 247 | // CHECK-CFI-NOTRAP-OLD-MACOS: error: unsupported option '-fno-sanitize-trap=cfi-vcall' for target 'x86_64-apple-darwin10' |
| 248 | |
Peter Collingbourne | 4bdceaa | 2015-07-08 21:08:05 +0000 | [diff] [blame^] | 249 | // RUN: %clang -target x86_64-pc-win32 -flto -fsanitize=cfi-vcall -fno-sanitize-trap=cfi -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CFI-NOTRAP-WIN |
| 250 | // CHECK-CFI-NOTRAP-WIN: -emit-llvm-bc |
| 251 | // CHECK-CFI-NOTRAP-WIN-NOT: -fsanitize-trap=cfi |
| 252 | |
Ehsan Akhgari | e0db196 | 2014-10-14 23:15:44 +0000 | [diff] [blame] | 253 | // RUN: %clang_cl -fsanitize=address -c -MDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL |
| 254 | // RUN: %clang_cl -fsanitize=address -c -MTd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL |
| 255 | // RUN: %clang_cl -fsanitize=address -c -LDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL |
| 256 | // RUN: %clang_cl -fsanitize=address -c -MD -MDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL |
| 257 | // RUN: %clang_cl -fsanitize=address -c -MT -MTd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL |
| 258 | // RUN: %clang_cl -fsanitize=address -c -LD -LDd -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-DEBUGRTL |
| 259 | // CHECK-ASAN-DEBUGRTL: error: invalid argument |
| 260 | // CHECK-ASAN-DEBUGRTL: not allowed with '-fsanitize=address' |
| 261 | // CHECK-ASAN-DEBUGRTL: note: AddressSanitizer doesn't support linking with debug runtime libraries yet |
| 262 | |
| 263 | // RUN: %clang_cl -fsanitize=address -c -MT -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL |
| 264 | // RUN: %clang_cl -fsanitize=address -c -MD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL |
| 265 | // RUN: %clang_cl -fsanitize=address -c -LD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL |
| 266 | // RUN: %clang_cl -fsanitize=address -c -MTd -MT -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL |
| 267 | // RUN: %clang_cl -fsanitize=address -c -MDd -MD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL |
| 268 | // RUN: %clang_cl -fsanitize=address -c -LDd -LD -### -- %s 2>&1 | FileCheck %s -check-prefix=CHECK-ASAN-RELEASERTL |
| 269 | // CHECK-ASAN-RELEASERTL-NOT: error: invalid argument |
Peter Collingbourne | c4122c1 | 2015-06-15 21:08:13 +0000 | [diff] [blame] | 270 | |
| 271 | // RUN: %clang -fno-sanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=NOSP |
| 272 | // NOSP-NOT: "-fsanitize=safe-stack" |
| 273 | |
| 274 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP |
| 275 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP-ASAN |
| 276 | // RUN: %clang -target x86_64-linux-gnu -fstack-protector -fsanitize=safe-stack -### %s 2>&1 | FileCheck %s -check-prefix=SP |
| 277 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=safe-stack -fstack-protector-all -### %s 2>&1 | FileCheck %s -check-prefix=SP |
| 278 | // SP-NOT: stack-protector |
| 279 | // SP: "-fsanitize=safe-stack" |
| 280 | // SP-ASAN-NOT: stack-protector |
| 281 | // SP-ASAN: "-fsanitize=address,safe-stack" |
Jay Foad | e967dd0 | 2015-06-25 10:35:19 +0000 | [diff] [blame] | 282 | |
| 283 | // RUN: %clang -target powerpc64-unknown-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-SANM |
| 284 | // RUN: %clang -target powerpc64le-unknown-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s -check-prefix=CHECK-SANM |
| 285 | // CHECK-SANM: "-fsanitize=memory" |