Artur Pilipenko | e5e1a3c | 2015-10-09 17:41:29 +0000 | [diff] [blame] | 1 | ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s |
| 2 | |
| 3 | declare i8* @foo() |
| 4 | |
| 5 | define void @f1() { |
| 6 | entry: |
| 7 | call i8* @foo(), !align !{i64 2} |
| 8 | ret void |
| 9 | } |
| 10 | ; CHECK: align applies only to load instructions |
| 11 | ; CHECK-NEXT: call i8* @foo() |
| 12 | |
| 13 | define i8 @f2(i8* %x) { |
| 14 | entry: |
| 15 | %y = load i8, i8* %x, !align !{i64 2} |
| 16 | ret i8 %y |
| 17 | } |
| 18 | ; CHECK: align applies only to pointer types |
| 19 | ; CHECK-NEXT: load i8, i8* %x |
| 20 | |
| 21 | define i8* @f3(i8** %x) { |
| 22 | entry: |
| 23 | %y = load i8*, i8** %x, !align !{} |
| 24 | ret i8* %y |
| 25 | } |
| 26 | ; CHECK: align takes one operand |
| 27 | ; CHECK-NEXT: load i8*, i8** %x |
| 28 | |
| 29 | define i8* @f4(i8** %x) { |
| 30 | entry: |
| 31 | %y = load i8*, i8** %x, !align !{!"str"} |
| 32 | ret i8* %y |
| 33 | } |
| 34 | ; CHECK: align metadata value must be an i64! |
| 35 | ; CHECK-NEXT: load i8*, i8** %x |
| 36 | |
| 37 | define i8* @f5(i8** %x) { |
| 38 | entry: |
| 39 | %y = load i8*, i8** %x, !align !{i32 2} |
| 40 | ret i8* %y |
| 41 | } |
| 42 | ; CHECK: align metadata value must be an i64! |
| 43 | ; CHECK-NEXT: load i8*, i8** %x |
| 44 | |
| 45 | define i8* @f6(i8** %x) { |
| 46 | entry: |
| 47 | %y = load i8*, i8** %x, !align !{i64 3} |
| 48 | ret i8* %y |
| 49 | } |
| 50 | ; CHECK: align metadata value must be a power of 2! |
| 51 | ; CHECK-NEXT: load i8*, i8** %x |
| 52 | |
| 53 | define i8* @f7(i8** %x) { |
| 54 | entry: |
| 55 | %y = load i8*, i8** %x, !align !{i64 1073741824} |
| 56 | ret i8* %y |
| 57 | } |
| 58 | ; CHECK: alignment is larger that implementation defined limit |
| 59 | ; CHECK-NEXT: load i8*, i8** %x |