brintos

brintos / llvm-project-archived public Read only

0
0
Text · 938 B · 0c158df Raw
33 lines · c
1// RUN: %clang_cc1 -triple x86_64 -emit-llvm -o - %s | FileCheck %s2 3// Check that we don't generate unnecessary reloads.4//5// CHECK-LABEL: define{{.*}} void @f0()6// CHECK:      [[x_0:%.*]] = alloca i32, align 47// CHECK-NEXT: [[y_0:%.*]] = alloca i32, align 48// CHECK-NEXT: store i32 1, ptr [[x_0]]9// CHECK-NEXT: store i32 1, ptr [[x_0]]10// CHECK-NEXT: store i32 1, ptr [[y_0]]11// CHECK: }12void f0(void) {13  int x, y;14  x = 1;15  y = (x = 1);16}17 18// This used to test that we generate reloads for volatile access,19// but that does not appear to be correct behavior for C.20//21// CHECK-LABEL: define{{.*}} void @f1()22// CHECK:      [[x_1:%.*]] = alloca i32, align 423// CHECK-NEXT: [[y_1:%.*]] = alloca i32, align 424// CHECK-NEXT: store volatile i32 1, ptr [[x_1]]25// CHECK-NEXT: store volatile i32 1, ptr [[x_1]]26// CHECK-NEXT: store volatile i32 1, ptr [[y_1]]27// CHECK: }28void f1(void) {29  volatile int x, y;30  x = 1;31  y = (x = 1);32}33